From a6ba86b04de6b53d2646c3f2d8f5120138af4edb Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Fri, 6 Feb 2026 22:00:56 +0000 Subject: [PATCH] server is striped --- .devcontainer/devcontainer.json | 147 - .../mobile/container-compose-overrides.yml | 40 - .devcontainer/mobile/devcontainer.json | 52 - .devcontainer/server/container-common.sh | 81 - .../server/container-compose-overrides.yml | 43 - .../server/container-start-backend.sh | 22 - .../server/container-start-frontend.sh | 29 - .devcontainer/server/container-start.sh | 17 - .env.example | 2 +- .github/.nvmrc | 1 - .github/.prettierignore | 4 - .../DISCUSSION_TEMPLATE/feature-request.yaml | 33 - .github/FUNDING.yml | 1 - .github/ISSUE_TEMPLATE/bug_report.yaml | 119 - .github/ISSUE_TEMPLATE/config.yml | 14 - .github/PULL_REQUEST_TEMPLATE/config.yml | 1 - .github/labeler.yml | 37 - .github/mise.toml | 10 - .github/package.json | 9 - .github/pull_request_template.md | 40 - .github/release.yml | 33 - .github/workflows/build-mobile.yml | 297 - .github/workflows/cache-cleanup.yml | 52 - .github/workflows/cli.yml | 126 - .github/workflows/close-duplicates.yml | 107 - .github/workflows/codeql-analysis.yml | 88 - .github/workflows/docker.yml | 194 - .github/workflows/docs-build.yml | 94 - .github/workflows/docs-deploy.yml | 225 - .github/workflows/docs-destroy.yml | 50 - .github/workflows/fix-format.yml | 61 - .github/workflows/merge-translations.yml | 128 - .../org-pr-require-conventional-commit.yml | 12 - .github/workflows/org-zizmor.yml | 15 - .github/workflows/pr-label-validation.yml | 31 - .github/workflows/pr-labeler.yml | 22 - .github/workflows/prepare-release.yml | 158 - .github/workflows/preview-label.yaml | 63 - .github/workflows/release-pr.yml | 170 - .github/workflows/release.yml | 148 - .github/workflows/sdk.yml | 47 - .github/workflows/static_analysis.yml | 118 - .github/workflows/test.yml | 865 - .github/workflows/weblate-lock.yml | 73 - .gitignore | 2 + .gitmodules | 6 - .pnpmfile.cjs | 18 - Makefile | 12 +- README.md | 166 +- docker/docker-compose.yml | 7 +- e2e/package.json | 18 +- e2e/src/api/specs/activity.e2e-spec.ts | 378 - e2e/src/api/specs/album.e2e-spec.ts | 721 - e2e/src/api/specs/api-key.e2e-spec.ts | 2 +- e2e/src/api/specs/asset.e2e-spec.ts | 1242 - .../api/specs/database-backups.e2e-spec.ts | 350 - e2e/src/api/specs/download.e2e-spec.ts | 57 - e2e/src/api/specs/jobs.e2e-spec.ts | 225 - e2e/src/api/specs/library.e2e-spec.ts | 1448 - e2e/src/api/specs/maintenance.e2e-spec.ts | 199 - e2e/src/api/specs/map.e2e-spec.ts | 170 - e2e/src/api/specs/memory.e2e-spec.ts | 175 - e2e/src/api/specs/oauth.e2e-spec.ts | 383 - e2e/src/api/specs/partner.e2e-spec.ts | 131 - e2e/src/api/specs/person.e2e-spec.ts | 346 - e2e/src/api/specs/search.e2e-spec.ts | 703 - e2e/src/api/specs/server.e2e-spec.ts | 2 +- e2e/src/api/specs/session.e2e-spec.ts | 2 +- e2e/src/api/specs/shared-link.e2e-spec.ts | 477 - e2e/src/api/specs/stack.e2e-spec.ts | 202 - e2e/src/api/specs/system-config.e2e-spec.ts | 51 - e2e/src/api/specs/system-metadata.e2e-spec.ts | 76 - e2e/src/api/specs/tag.e2e-spec.ts | 603 - e2e/src/api/specs/trash.e2e-spec.ts | 261 - e2e/src/api/specs/user-admin.e2e-spec.ts | 383 - e2e/src/api/specs/user.e2e-spec.ts | 2 +- e2e/src/cli/specs/login.e2e-spec.ts | 61 - e2e/src/cli/specs/server-info.e2e-spec.ts | 28 - e2e/src/cli/specs/upload.e2e-spec.ts | 763 - e2e/src/cli/specs/version.e2e-spec.ts | 25 - e2e/src/generators.ts | 30 - e2e/src/generators/memory.ts | 2 - e2e/src/generators/memory/model-objects.ts | 84 - e2e/src/generators/timeline.ts | 37 - .../timeline/distribution-patterns.ts | 183 - e2e/src/generators/timeline/images.ts | 111 - e2e/src/generators/timeline/model-objects.ts | 265 - e2e/src/generators/timeline/rest-response.ts | 439 - .../generators/timeline/timeline-config.ts | 200 - e2e/src/generators/timeline/utils.ts | 186 - .../specs/immich-admin.e2e-spec.ts | 79 - e2e/src/mock-network/base-network.ts | 285 - e2e/src/mock-network/memory-network.ts | 65 - e2e/src/mock-network/timeline-network.ts | 179 - e2e/src/utils.ts | 4 +- e2e/src/web/specs/album.e2e-spec.ts | 25 - .../asset-viewer/asset-viewer.ui-spec.ts | 269 - .../asset-viewer/detail-panel.e2e-spec.ts | 86 - .../web/specs/asset-viewer/navbar.e2e-spec.ts | 65 - .../specs/asset-viewer/slideshow.e2e-spec.ts | 56 - .../web/specs/asset-viewer/stack.e2e-spec.ts | 66 - .../web/specs/database-backups.e2e-spec.ts | 105 - e2e/src/web/specs/maintenance.e2e-spec.ts | 51 - .../web/specs/memory/memory-viewer.ui-spec.ts | 289 - e2e/src/web/specs/memory/utils.ts | 123 - e2e/src/web/specs/photo-viewer.e2e-spec.ts | 56 - .../specs/search/search-gallery.ui-spec.ts | 116 - e2e/src/web/specs/shared-link.e2e-spec.ts | 113 - .../web/specs/timeline/timeline.ui-spec.ts | 862 - e2e/src/web/specs/timeline/utils.ts | 228 - e2e/src/web/specs/user-admin.e2e-spec.ts | 97 - e2e/src/web/specs/websocket.e2e-spec.ts | 25 - i18n/af.json | 1 - i18n/ar.json | 1 - i18n/az.json | 1 - i18n/be.json | 1 - i18n/bg.json | 1 - i18n/bi.json | 1 - i18n/bn.json | 1 - i18n/br.json | 1 - i18n/ca.json | 1 - i18n/cs.json | 1 - i18n/cv.json | 1 - i18n/da.json | 1 - i18n/de.json | 1 - i18n/de_CH.json | 1 - i18n/el.json | 1 - i18n/en.json | 2408 +- i18n/eo.json | 1 - i18n/es.json | 1 - i18n/et.json | 1 - i18n/eu.json | 1 - i18n/fa.json | 1 - i18n/fi.json | 1 - i18n/fil.json | 1 - i18n/fr.json | 1 - i18n/ga.json | 1 - i18n/gl.json | 1 - i18n/gsw.json | 1 - i18n/gu.json | 1 - i18n/he.json | 1 - i18n/hi.json | 1 - i18n/hr.json | 1 - i18n/hu.json | 1 - i18n/hy.json | 1 - i18n/id.json | 1 - i18n/is.json | 1 - i18n/it.json | 1 - i18n/ja.json | 1 - i18n/ka.json | 1 - i18n/kk.json | 1 - i18n/km.json | 1 - i18n/kmr.json | 1 - i18n/kn.json | 1 - i18n/ko.json | 1 - i18n/lb.json | 1 - i18n/lt.json | 1 - i18n/lv.json | 1 - i18n/mfa.json | 1 - i18n/mk.json | 1 - i18n/ml.json | 1 - i18n/mn.json | 1 - i18n/mr.json | 1 - i18n/ms.json | 1 - i18n/nb_NO.json | 1 - i18n/nl.json | 1 - i18n/nn.json | 1 - i18n/pa.json | 1 - i18n/package.json | 4 +- i18n/pl.json | 1 - i18n/pt.json | 1 - i18n/pt_BR.json | 1 - i18n/ro.json | 1 - i18n/ru.json | 1 - i18n/si.json | 1 - i18n/sk.json | 1 - i18n/sl.json | 1 - i18n/sq.json | 1 - i18n/sr_Cyrl.json | 1 - i18n/sr_Latn.json | 1 - i18n/sv.json | 1 - i18n/ta.json | 1 - i18n/te.json | 1 - i18n/th.json | 1 - i18n/tr.json | 1 - i18n/uk.json | 1 - i18n/ur.json | 1 - i18n/uz.json | 1 - i18n/vi.json | 1 - i18n/yue_Hant.json | 1 - i18n/zh_Hant.json | 1 - i18n/zh_SIMPLIFIED.json | 1 - mobile/openapi/README.md | 557 +- mobile/openapi/lib/api.dart | 358 - mobile/openapi/lib/api/activities_api.dart | 291 - mobile/openapi/lib/api/albums_api.dart | 774 - mobile/openapi/lib/api/assets_api.dart | 1839 -- .../lib/api/authentication_admin_api.dart | 58 - .../openapi/lib/api/authentication_api.dart | 536 - .../lib/api/database_backups_admin_api.dart | 269 - mobile/openapi/lib/api/deprecated_api.dart | 576 - mobile/openapi/lib/api/download_api.dart | 160 - mobile/openapi/lib/api/duplicates_api.dart | 166 - mobile/openapi/lib/api/faces_api.dart | 243 - mobile/openapi/lib/api/jobs_api.dart | 177 - mobile/openapi/lib/api/libraries_api.dart | 459 - .../lib/api/maintenance_admin_api.dart | 218 - mobile/openapi/lib/api/map_api.dart | 198 - mobile/openapi/lib/api/memories_api.dart | 586 - .../lib/api/notifications_admin_api.dart | 191 - mobile/openapi/lib/api/notifications_api.dart | 373 - mobile/openapi/lib/api/partners_api.dart | 304 - mobile/openapi/lib/api/people_api.dart | 688 - mobile/openapi/lib/api/plugins_api.dart | 177 - mobile/openapi/lib/api/queues_api.dart | 318 - mobile/openapi/lib/api/search_api.dart | 943 - mobile/openapi/lib/api/server_api.dart | 483 - mobile/openapi/lib/api/sessions_api.dart | 110 - mobile/openapi/lib/api/shared_links_api.dart | 558 - mobile/openapi/lib/api/stacks_api.dart | 408 - mobile/openapi/lib/api/sync_api.dart | 328 - mobile/openapi/lib/api/system_config_api.dart | 218 - .../openapi/lib/api/system_metadata_api.dart | 210 - mobile/openapi/lib/api/tags_api.dart | 535 - mobile/openapi/lib/api/timeline_api.dart | 360 - mobile/openapi/lib/api/trash_api.dart | 170 - mobile/openapi/lib/api/users_admin_api.dart | 647 - mobile/openapi/lib/api/users_api.dart | 561 +- mobile/openapi/lib/api/views_api.dart | 130 - mobile/openapi/lib/api/workflows_api.dart | 292 - mobile/openapi/lib/api_client.dart | 652 - mobile/openapi/lib/api_helper.dart | 132 - .../lib/model/activity_create_dto.dart | 145 - .../lib/model/activity_response_dto.dart | 151 - .../activity_statistics_response_dto.dart | 109 - mobile/openapi/lib/model/add_users_dto.dart | 100 - .../model/admin_onboarding_update_dto.dart | 100 - .../openapi/lib/model/album_response_dto.dart | 297 - .../model/album_statistics_response_dto.dart | 118 - .../openapi/lib/model/album_user_add_dto.dart | 108 - .../lib/model/album_user_create_dto.dart | 109 - .../lib/model/album_user_response_dto.dart | 108 - mobile/openapi/lib/model/album_user_role.dart | 85 - .../lib/model/albums_add_assets_dto.dart | 113 - .../model/albums_add_assets_response_dto.dart | 118 - mobile/openapi/lib/model/albums_response.dart | 100 - mobile/openapi/lib/model/albums_update.dart | 109 - .../model/api_key_create_response_dto.dart | 22 +- .../lib/model/api_key_response_dto.dart | 40 +- .../lib/model/asset_bulk_delete_dto.dart | 120 - .../lib/model/asset_bulk_update_dto.dart | 279 - .../model/asset_bulk_upload_check_dto.dart | 100 - .../model/asset_bulk_upload_check_item.dart | 109 - .../asset_bulk_upload_check_response_dto.dart | 100 - .../model/asset_bulk_upload_check_result.dart | 305 - mobile/openapi/lib/model/asset_copy_dto.dart | 149 - .../lib/model/asset_delta_sync_dto.dart | 111 - .../model/asset_delta_sync_response_dto.dart | 120 - .../openapi/lib/model/asset_edit_action.dart | 88 - .../lib/model/asset_edit_action_crop.dart | 108 - .../lib/model/asset_edit_action_list_dto.dart | 100 - ...sset_edit_action_list_dto_edits_inner.dart | 108 - .../lib/model/asset_edit_action_mirror.dart | 108 - .../lib/model/asset_edit_action_rotate.dart | 108 - mobile/openapi/lib/model/asset_edits_dto.dart | 109 - .../lib/model/asset_face_create_dto.dart | 163 - .../lib/model/asset_face_delete_dto.dart | 100 - .../lib/model/asset_face_response_dto.dart | 185 - .../lib/model/asset_face_update_dto.dart | 100 - .../lib/model/asset_face_update_item.dart | 109 - ...sset_face_without_person_response_dto.dart | 172 - .../lib/model/asset_full_sync_dto.dart | 147 - mobile/openapi/lib/model/asset_ids_dto.dart | 102 - .../lib/model/asset_ids_response_dto.dart | 198 - mobile/openapi/lib/model/asset_job_name.dart | 91 - mobile/openapi/lib/model/asset_jobs_dto.dart | 111 - .../lib/model/asset_media_response_dto.dart | 109 - .../openapi/lib/model/asset_media_size.dart | 91 - .../openapi/lib/model/asset_media_status.dart | 88 - .../model/asset_metadata_bulk_delete_dto.dart | 100 - .../asset_metadata_bulk_delete_item_dto.dart | 109 - .../asset_metadata_bulk_response_dto.dart | 127 - .../model/asset_metadata_bulk_upsert_dto.dart | 100 - .../asset_metadata_bulk_upsert_item_dto.dart | 118 - .../model/asset_metadata_response_dto.dart | 118 - .../lib/model/asset_metadata_upsert_dto.dart | 100 - .../model/asset_metadata_upsert_item_dto.dart | 109 - .../lib/model/asset_ocr_response_dto.dart | 206 - mobile/openapi/lib/model/asset_order.dart | 85 - .../openapi/lib/model/asset_response_dto.dart | 461 - .../lib/model/asset_stack_response_dto.dart | 118 - .../lib/model/asset_stats_response_dto.dart | 118 - mobile/openapi/lib/model/asset_type_enum.dart | 91 - .../openapi/lib/model/asset_visibility.dart | 91 - mobile/openapi/lib/model/audio_codec.dart | 91 - .../lib/model/auth_status_response_dto.dart | 154 - mobile/openapi/lib/model/avatar_update.dart | 109 - .../lib/model/bulk_id_error_reason.dart | 91 - .../lib/model/bulk_id_response_dto.dart | 201 - mobile/openapi/lib/model/bulk_ids_dto.dart | 102 - mobile/openapi/lib/model/cast_response.dart | 100 - mobile/openapi/lib/model/cast_update.dart | 109 - .../lib/model/change_password_dto.dart | 36 +- .../lib/model/check_existing_assets_dto.dart | 111 - .../check_existing_assets_response_dto.dart | 102 - mobile/openapi/lib/model/clip_config.dart | 109 - mobile/openapi/lib/model/colorspace.dart | 85 - .../model/contributor_count_response_dto.dart | 109 - mobile/openapi/lib/model/cq_mode.dart | 88 - .../openapi/lib/model/create_album_dto.dart | 136 - .../openapi/lib/model/create_library_dto.dart | 138 - .../create_profile_image_response_dto.dart | 118 - mobile/openapi/lib/model/crop_parameters.dart | 135 - .../lib/model/database_backup_config.dart | 120 - .../lib/model/database_backup_delete_dto.dart | 101 - .../lib/model/database_backup_dto.dart | 107 - .../database_backup_list_response_dto.dart | 99 - .../lib/model/download_archive_info.dart | 111 - .../openapi/lib/model/download_info_dto.dart | 157 - .../openapi/lib/model/download_response.dart | 109 - .../lib/model/download_response_dto.dart | 109 - mobile/openapi/lib/model/download_update.dart | 129 - .../lib/model/duplicate_detection_config.dart | 112 - .../lib/model/duplicate_response_dto.dart | 109 - .../model/email_notifications_response.dart | 118 - .../lib/model/email_notifications_update.dart | 145 - .../openapi/lib/model/exif_response_dto.dart | 371 - mobile/openapi/lib/model/face_dto.dart | 100 - .../lib/model/facial_recognition_config.dart | 144 - .../openapi/lib/model/folders_response.dart | 109 - mobile/openapi/lib/model/folders_update.dart | 127 - mobile/openapi/lib/model/image_format.dart | 85 - mobile/openapi/lib/model/job_create_dto.dart | 100 - mobile/openapi/lib/model/job_name.dart | 247 - .../openapi/lib/model/job_settings_dto.dart | 102 - .../lib/model/library_response_dto.dart | 180 - .../lib/model/library_stats_response_dto.dart | 127 - mobile/openapi/lib/model/license_key_dto.dart | 109 - .../lib/model/license_response_dto.dart | 118 - mobile/openapi/lib/model/log_level.dart | 97 - .../openapi/lib/model/login_response_dto.dart | 88 +- .../lib/model/logout_response_dto.dart | 24 +- ...hine_learning_availability_checks_dto.dart | 116 - .../openapi/lib/model/maintenance_action.dart | 91 - .../lib/model/maintenance_auth_dto.dart | 100 - ...intenance_detect_install_response_dto.dart | 99 - ...nce_detect_install_storage_folder_dto.dart | 127 - .../lib/model/maintenance_login_dto.dart | 109 - .../maintenance_status_response_dto.dart | 159 - mobile/openapi/lib/model/manual_job_name.dart | 97 - .../lib/model/map_marker_response_dto.dart | 157 - .../map_reverse_geocode_response_dto.dart | 130 - .../openapi/lib/model/memories_response.dart | 109 - mobile/openapi/lib/model/memories_update.dart | 129 - .../openapi/lib/model/memory_create_dto.dart | 163 - .../lib/model/memory_response_dto.dart | 242 - .../lib/model/memory_search_order.dart | 88 - .../model/memory_statistics_response_dto.dart | 100 - mobile/openapi/lib/model/memory_type.dart | 82 - .../openapi/lib/model/memory_update_dto.dart | 145 - .../openapi/lib/model/merge_person_dto.dart | 102 - .../lib/model/metadata_search_dto.dart | 825 - mobile/openapi/lib/model/mirror_axis.dart | 85 - .../openapi/lib/model/mirror_parameters.dart | 100 - .../lib/model/notification_create_dto.dart | 187 - .../model/notification_delete_all_dto.dart | 102 - .../openapi/lib/model/notification_dto.dart | 190 - .../openapi/lib/model/notification_level.dart | 91 - .../openapi/lib/model/notification_type.dart | 97 - .../model/notification_update_all_dto.dart | 114 - .../lib/model/notification_update_dto.dart | 103 - .../model/o_auth_authorize_response_dto.dart | 100 - .../lib/model/o_auth_callback_dto.dart | 136 - .../openapi/lib/model/o_auth_config_dto.dart | 136 - .../o_auth_token_endpoint_auth_method.dart | 85 - mobile/openapi/lib/model/ocr_config.dart | 144 - mobile/openapi/lib/model/on_this_day_dto.dart | 102 - mobile/openapi/lib/model/onboarding_dto.dart | 100 - .../lib/model/onboarding_response_dto.dart | 100 - .../openapi/lib/model/partner_create_dto.dart | 100 - .../openapi/lib/model/partner_direction.dart | 85 - .../lib/model/partner_response_dto.dart | 163 - .../openapi/lib/model/partner_update_dto.dart | 100 - mobile/openapi/lib/model/people_response.dart | 109 - .../lib/model/people_response_dto.dart | 136 - mobile/openapi/lib/model/people_update.dart | 127 - .../openapi/lib/model/people_update_dto.dart | 100 - .../openapi/lib/model/people_update_item.dart | 196 - mobile/openapi/lib/model/permission.dart | 414 +- .../openapi/lib/model/person_create_dto.dart | 169 - .../lib/model/person_response_dto.dart | 194 - .../model/person_statistics_response_dto.dart | 100 - .../openapi/lib/model/person_update_dto.dart | 187 - .../model/person_with_faces_response_dto.dart | 203 - .../lib/model/pin_code_change_dto.dart | 136 - .../openapi/lib/model/pin_code_reset_dto.dart | 127 - .../openapi/lib/model/pin_code_setup_dto.dart | 100 - .../lib/model/places_response_dto.dart | 154 - .../lib/model/plugin_action_response_dto.dart | 158 - .../lib/model/plugin_context_type.dart | 88 - .../lib/model/plugin_filter_response_dto.dart | 158 - .../lib/model/plugin_response_dto.dart | 181 - .../model/plugin_trigger_response_dto.dart | 109 - .../lib/model/plugin_trigger_type.dart | 85 - .../openapi/lib/model/purchase_response.dart | 109 - mobile/openapi/lib/model/purchase_update.dart | 127 - mobile/openapi/lib/model/queue_command.dart | 94 - .../openapi/lib/model/queue_command_dto.dart | 118 - .../openapi/lib/model/queue_delete_dto.dart | 109 - .../lib/model/queue_job_response_dto.dart | 136 - .../openapi/lib/model/queue_job_status.dart | 97 - mobile/openapi/lib/model/queue_name.dart | 133 - .../openapi/lib/model/queue_response_dto.dart | 117 - .../lib/model/queue_response_legacy_dto.dart | 107 - .../lib/model/queue_statistics_dto.dart | 145 - .../lib/model/queue_status_legacy_dto.dart | 109 - .../openapi/lib/model/queue_update_dto.dart | 109 - .../lib/model/queues_response_legacy_dto.dart | 235 - .../openapi/lib/model/random_search_dto.dart | 635 - .../openapi/lib/model/ratings_response.dart | 100 - mobile/openapi/lib/model/ratings_update.dart | 109 - mobile/openapi/lib/model/reaction_level.dart | 85 - mobile/openapi/lib/model/reaction_type.dart | 85 - .../reverse_geocoding_state_response_dto.dart | 117 - .../openapi/lib/model/rotate_parameters.dart | 100 - .../lib/model/search_album_response_dto.dart | 125 - .../lib/model/search_asset_response_dto.dart | 138 - .../lib/model/search_explore_item.dart | 108 - .../model/search_explore_response_dto.dart | 108 - .../search_facet_count_response_dto.dart | 109 - .../lib/model/search_facet_response_dto.dart | 109 - .../lib/model/search_response_dto.dart | 107 - .../model/search_statistics_response_dto.dart | 100 - .../lib/model/search_suggestion_type.dart | 97 - .../lib/model/server_about_response_dto.dart | 317 +- .../lib/model/server_apk_links_dto.dart | 127 - .../openapi/lib/model/server_config_dto.dart | 96 +- .../lib/model/server_features_dto.dart | 132 +- .../server_media_types_response_dto.dart | 124 - .../lib/model/server_stats_response_dto.dart | 144 - .../model/server_storage_response_dto.dart | 154 - .../openapi/lib/model/server_theme_dto.dart | 100 - .../server_version_history_response_dto.dart | 118 - .../openapi/lib/model/session_create_dto.dart | 66 +- .../model/session_create_response_dto.dart | 124 +- .../lib/model/session_response_dto.dart | 124 +- .../openapi/lib/model/session_unlock_dto.dart | 127 - .../openapi/lib/model/session_update_dto.dart | 109 - .../lib/model/set_maintenance_mode_dto.dart | 118 - .../lib/model/shared_link_create_dto.dart | 210 - .../lib/model/shared_link_edit_dto.dart | 211 - .../lib/model/shared_link_response_dto.dart | 252 - .../openapi/lib/model/shared_link_type.dart | 85 - .../lib/model/shared_links_response.dart | 109 - .../lib/model/shared_links_update.dart | 127 - mobile/openapi/lib/model/sign_up_dto.dart | 24 +- .../openapi/lib/model/smart_search_dto.dart | 673 - mobile/openapi/lib/model/source_type.dart | 88 - .../openapi/lib/model/stack_create_dto.dart | 102 - .../openapi/lib/model/stack_response_dto.dart | 118 - .../openapi/lib/model/stack_update_dto.dart | 109 - .../lib/model/statistics_search_dto.dart | 560 - mobile/openapi/lib/model/storage_folder.dart | 97 - .../lib/model/sync_ack_delete_dto.dart | 99 - mobile/openapi/lib/model/sync_ack_dto.dart | 109 - .../openapi/lib/model/sync_ack_set_dto.dart | 102 - .../lib/model/sync_album_delete_v1.dart | 100 - .../model/sync_album_to_asset_delete_v1.dart | 109 - .../lib/model/sync_album_to_asset_v1.dart | 109 - .../lib/model/sync_album_user_delete_v1.dart | 109 - .../openapi/lib/model/sync_album_user_v1.dart | 118 - mobile/openapi/lib/model/sync_album_v1.dart | 175 - .../lib/model/sync_asset_delete_v1.dart | 100 - .../openapi/lib/model/sync_asset_exif_v1.dart | 412 - .../lib/model/sync_asset_face_delete_v1.dart | 100 - .../openapi/lib/model/sync_asset_face_v1.dart | 179 - .../model/sync_asset_metadata_delete_v1.dart | 109 - .../lib/model/sync_asset_metadata_v1.dart | 118 - mobile/openapi/lib/model/sync_asset_v1.dart | 306 - .../openapi/lib/model/sync_auth_user_v1.dart | 226 - .../openapi/lib/model/sync_entity_type.dart | 220 - .../model/sync_memory_asset_delete_v1.dart | 109 - .../lib/model/sync_memory_asset_v1.dart | 109 - .../lib/model/sync_memory_delete_v1.dart | 100 - mobile/openapi/lib/model/sync_memory_v1.dart | 215 - .../lib/model/sync_partner_delete_v1.dart | 109 - mobile/openapi/lib/model/sync_partner_v1.dart | 118 - .../lib/model/sync_person_delete_v1.dart | 100 - mobile/openapi/lib/model/sync_person_v1.dart | 193 - .../openapi/lib/model/sync_request_type.dart | 139 - .../lib/model/sync_stack_delete_v1.dart | 100 - mobile/openapi/lib/model/sync_stack_v1.dart | 136 - mobile/openapi/lib/model/sync_stream_dto.dart | 118 - .../lib/model/sync_user_delete_v1.dart | 100 - .../model/sync_user_metadata_delete_v1.dart | 109 - .../lib/model/sync_user_metadata_v1.dart | 118 - mobile/openapi/lib/model/sync_user_v1.dart | 162 - .../lib/model/system_config_backups_dto.dart | 99 - .../openapi/lib/model/system_config_dto.dart | 259 - .../lib/model/system_config_f_fmpeg_dto.dart | 293 - .../lib/model/system_config_faces_dto.dart | 100 - ...m_config_generated_fullsize_image_dto.dart | 129 - .../system_config_generated_image_dto.dart | 130 - .../lib/model/system_config_image_dto.dart | 133 - .../lib/model/system_config_job_dto.dart | 203 - .../lib/model/system_config_library_dto.dart | 107 - .../model/system_config_library_scan_dto.dart | 108 - .../system_config_library_watch_dto.dart | 100 - .../lib/model/system_config_logging_dto.dart | 108 - .../system_config_machine_learning_dto.dart | 150 - .../lib/model/system_config_map_dto.dart | 116 - .../lib/model/system_config_metadata_dto.dart | 99 - .../system_config_new_version_check_dto.dart | 100 - .../system_config_nightly_tasks_dto.dart | 144 - .../system_config_notifications_dto.dart | 99 - .../lib/model/system_config_o_auth_dto.dart | 260 - .../system_config_password_login_dto.dart | 100 - .../system_config_reverse_geocoding_dto.dart | 100 - .../lib/model/system_config_server_dto.dart | 118 - .../lib/model/system_config_smtp_dto.dart | 126 - .../system_config_smtp_transport_dto.dart | 148 - .../system_config_storage_template_dto.dart | 118 - .../system_config_template_emails_dto.dart | 115 - ...em_config_template_storage_option_dto.dart | 179 - .../model/system_config_templates_dto.dart | 99 - .../lib/model/system_config_theme_dto.dart | 100 - .../lib/model/system_config_trash_dto.dart | 111 - .../lib/model/system_config_user_dto.dart | 102 - .../lib/model/tag_bulk_assets_dto.dart | 113 - .../model/tag_bulk_assets_response_dto.dart | 100 - mobile/openapi/lib/model/tag_create_dto.dart | 130 - .../openapi/lib/model/tag_response_dto.dart | 172 - mobile/openapi/lib/model/tag_update_dto.dart | 103 - mobile/openapi/lib/model/tag_upsert_dto.dart | 102 - mobile/openapi/lib/model/tags_response.dart | 109 - mobile/openapi/lib/model/tags_update.dart | 127 - mobile/openapi/lib/model/template_dto.dart | 100 - .../lib/model/template_response_dto.dart | 109 - .../lib/model/test_email_response_dto.dart | 100 - .../model/time_bucket_asset_response_dto.dart | 286 - .../lib/model/time_buckets_response_dto.dart | 109 - mobile/openapi/lib/model/tone_mapping.dart | 91 - .../openapi/lib/model/transcode_hw_accel.dart | 94 - .../openapi/lib/model/transcode_policy.dart | 94 - .../openapi/lib/model/trash_response_dto.dart | 100 - .../openapi/lib/model/update_album_dto.dart | 181 - .../lib/model/update_album_user_dto.dart | 100 - .../openapi/lib/model/update_asset_dto.dart | 232 - .../openapi/lib/model/update_library_dto.dart | 129 - .../openapi/lib/model/usage_by_user_dto.dart | 167 - .../lib/model/user_admin_create_dto.dart | 222 - .../lib/model/user_admin_delete_dto.dart | 109 - .../lib/model/user_admin_response_dto.dart | 198 +- .../lib/model/user_admin_update_dto.dart | 231 - .../openapi/lib/model/user_avatar_color.dart | 109 - mobile/openapi/lib/model/user_license.dart | 118 - .../openapi/lib/model/user_metadata_key.dart | 88 - .../model/user_preferences_response_dto.dart | 179 - .../model/user_preferences_update_dto.dart | 295 - .../openapi/lib/model/user_response_dto.dart | 45 +- .../openapi/lib/model/user_update_me_dto.dart | 36 +- .../lib/model/validate_library_dto.dart | 111 - ...date_library_import_path_response_dto.dart | 127 - .../model/validate_library_response_dto.dart | 99 - .../version_check_state_response_dto.dart | 117 - mobile/openapi/lib/model/video_codec.dart | 91 - mobile/openapi/lib/model/video_container.dart | 91 - .../lib/model/workflow_action_item_dto.dart | 118 - .../model/workflow_action_response_dto.dart | 140 - .../lib/model/workflow_create_dto.dart | 163 - .../lib/model/workflow_filter_item_dto.dart | 118 - .../model/workflow_filter_response_dto.dart | 140 - .../lib/model/workflow_response_dto.dart | 176 - .../lib/model/workflow_update_dto.dart | 179 - open-api/bin/generate-open-api.sh | 29 +- open-api/immich-openapi-specs.json | 25871 ---------------- open-api/server-openapi-specs.json | 1863 ++ open-api/typescript-sdk/README.md | 6 +- open-api/typescript-sdk/package.json | 6 +- open-api/typescript-sdk/src/fetch-client.ts | 7179 +---- open-api/typescript-sdk/src/index.ts | 10 - package.json | 6 +- pnpm-lock.yaml | 23046 ++++---------- pnpm-workspace.yaml | 2 - server/.gitignore | 2 +- server/Dockerfile | 8 +- server/package.json | 58 +- server/server-openapi-specs.json | 1863 ++ server/src/bin/sync-open-api.ts | 12 + server/src/controllers/auth.controller.ts | 14 +- server/src/decorators.ts | 2 +- server/src/dtos/auth.dto.ts | 5 - server/src/dtos/user.dto.ts | 63 +- server/src/main.ts | 2 +- server/src/repositories/user.repository.ts | 10 +- server/src/services/auth.service.ts | 389 +- server/src/services/server.service.ts | 2 +- server/src/utils/misc.ts | 23 +- server/src/workers/api.ts | 10 +- server/src/workers/microservices.ts | 2 +- server/test/fixtures/album.stub.ts | 152 - server/test/fixtures/asset.stub.ts | 1133 - server/test/fixtures/face.stub.ts | 160 - server/test/fixtures/file.stub.ts | 31 - server/test/fixtures/media.stub.ts | 275 - server/test/fixtures/notification.stub.ts | 14 - server/test/fixtures/person.stub.ts | 262 - server/test/fixtures/shared-link.stub.ts | 221 - server/test/fixtures/tag.stub.ts | 71 - .../medium/specs/exif/exif-date-time.spec.ts | 65 - .../test/medium/specs/exif/exif-gps.spec.ts | 31 - .../test/medium/specs/exif/exif-tags.spec.ts | 34 - .../asset-edit.repository.spec.ts | 115 - .../repositories/asset.repository.spec.ts | 150 - .../services/asset-media.service.spec.ts | 261 - .../specs/services/asset.service.spec.ts | 707 - .../specs/services/audit.database.spec.ts | 84 - .../specs/services/memory.service.spec.ts | 246 - .../specs/services/metadata.service.spec.ts | 108 - .../medium/specs/services/ocr.service.spec.ts | 249 - .../specs/services/person.service.spec.ts | 689 - .../specs/services/plugin.service.spec.ts | 308 - .../specs/services/search.service.spec.ts | 91 - .../services/shared-link.service.spec.ts | 127 - .../specs/services/storage.service.spec.ts | 46 - .../specs/services/sync.service.spec.ts | 226 - .../medium/specs/services/tag.service.spec.ts | 145 - .../specs/services/timeline.service.spec.ts | 209 - .../specs/services/version.service.spec.ts | 70 - .../specs/services/workflow.service.spec.ts | 776 - .../specs/sync/sync-album-asset-exif.spec.ts | 373 - .../specs/sync/sync-album-asset.spec.ts | 312 - .../specs/sync/sync-album-to-asset.spec.ts | 265 - .../medium/specs/sync/sync-album-user.spec.ts | 306 - .../test/medium/specs/sync/sync-album.spec.ts | 235 - .../medium/specs/sync/sync-asset-exif.spec.ts | 81 - .../medium/specs/sync/sync-asset-face.spec.ts | 99 - .../specs/sync/sync-asset-metadata.spec.ts | 128 - .../test/medium/specs/sync/sync-asset.spec.ts | 121 - .../medium/specs/sync/sync-auth-user.spec.ts | 106 - .../medium/specs/sync/sync-complete.spec.ts | 60 - .../specs/sync/sync-memory-asset.spec.ts | 91 - .../medium/specs/sync/sync-memory.spec.ts | 115 - .../sync/sync-partner-asset-exif.spec.ts | 253 - .../specs/sync/sync-partner-asset.spec.ts | 279 - .../specs/sync/sync-partner-stack.spec.ts | 247 - .../medium/specs/sync/sync-partner.spec.ts | 178 - .../medium/specs/sync/sync-person.spec.ts | 93 - .../test/medium/specs/sync/sync-reset.spec.ts | 94 - .../test/medium/specs/sync/sync-stack.spec.ts | 114 - .../test/medium/specs/sync/sync-types.spec.ts | 19 - .../specs/sync/sync-user-metadata.spec.ts | 125 - .../test/medium/specs/sync/sync-user.spec.ts | 137 - .../repositories/access.repository.mock.ts | 73 - .../repositories/asset.repository.mock.ts | 57 - .../repositories/media.repository.mock.ts | 17 - .../repositories/metadata.repository.mock.ts | 13 - .../repositories/storage.repository.mock.ts | 78 - web/bin/immich-web | 2 +- web/package.json | 42 +- web/src/hooks.client.ts | 2 +- web/src/lib/__mocks__/sdk.mock.ts | 6 +- web/src/lib/actions/drag-and-drop.ts | 118 - web/src/lib/actions/thumbhash.ts | 29 - web/src/lib/actions/zoom-image.ts | 35 - web/src/lib/components/AdminCard.svelte | 33 - .../components/ApiKeyPermissionsPicker.svelte | 2 +- .../lib/components/AssetViewerEvents.svelte | 24 - web/src/lib/components/QueueCard.svelte | 187 - web/src/lib/components/QueueCardBadge.svelte | 23 - web/src/lib/components/QueueCardButton.svelte | 37 - web/src/lib/components/QueueGraph.svelte | 165 - web/src/lib/components/QueuePanel.svelte | 132 - .../QueueStorageMigrationDescription.svelte | 17 - web/src/lib/components/ServerAboutItem.svelte | 24 - .../components/SharedLinkExpiration.svelte | 75 - .../components/SharedLinkFormFields.spec.ts | 34 - .../components/SharedLinkFormFields.svelte | 65 - .../lib/components/VersionAnnouncement.svelte | 41 - .../components/layouts/AdminPageLayout.svelte | 47 - .../lib/components/layouts/ErrorLayout.svelte | 24 +- .../layouts/user-page-layout.svelte | 12 +- .../pages/SharedLinkErrorPage.svelte | 14 - .../components/pages/SharedLinkPage.svelte | 108 - .../__test__/number-range-input.spec.ts | 81 - .../album-selection-utils.spec.ts | 181 - .../album-selection/album-selection-utils.ts | 97 - .../new-album-list-item.svelte | 40 - .../shared-components/change-location.svelte | 232 - .../context-menu/button-context-menu.svelte | 205 - .../context-menu/context-menu.svelte | 91 - .../context-menu/menu-option.svelte | 79 - .../right-click-context-menu.svelte | 111 - .../shared-components/control-app-bar.svelte | 104 - .../coordinates-input.svelte | 55 - .../drag-and-drop-upload-overlay.svelte | 174 - .../empty-placeholder.svelte | 34 - .../gallery-viewer/gallery-viewer.svelte | 417 - .../shared-components/map/map.svelte | 409 - .../navigation-bar/account-info-panel.svelte | 43 +- .../navigation-bar/navigation-bar.svelte | 114 +- .../navigation-bar/notification-item.svelte | 133 - .../navigation-bar/notification-panel.svelte | 109 - .../number-range-input.svelte | 2 +- .../progress-bar/progress-bar.svelte | 95 - .../individual-purchase-option-card.svelte | 43 - .../purchase-activation-success.svelte | 33 - .../purchasing/purchase-content.svelte | 84 - .../server-purchase-option-card.svelte | 43 - .../shared-components/qrcode.svelte | 20 - .../search-bar/search-bar.svelte | 386 - .../search-bar/search-camera-section.svelte | 117 - .../search-bar/search-date-section.svelte | 37 - .../search-bar/search-display-section.svelte | 40 - .../search-bar/search-history-box.svelte | 151 - .../search-bar/search-location-section.svelte | 111 - .../search-bar/search-media-section.svelte | 36 - .../search-bar/search-people-section.svelte | 106 - .../search-bar/search-ratings-section.svelte | 32 - .../search-bar/search-tags-section.svelte | 98 - .../search-bar/search-text-section.svelte | 59 - .../settings/SystemConfigButtonRow.svelte | 3 +- .../side-bar/bottom-info.svelte | 15 - .../side-bar/purchase-info.svelte | 178 - .../side-bar/recent-albums.spec.ts | 31 - .../side-bar/recent-albums.svelte | 45 - .../side-bar/server-status.svelte | 115 - .../side-bar/storage-space.svelte | 77 - .../side-bar/supporter-badge.svelte | 53 - .../side-bar/user-sidebar.svelte | 107 +- .../shared-components/single-grid-row.svelte | 44 - .../shared-components/tree/breadcrumbs.svelte | 68 - .../tree/tree-item-thumbnails.svelte | 33 - .../shared-components/tree/tree-items.svelte | 21 - .../shared-components/tree/tree.svelte | 50 - .../upload-asset-preview.svelte | 116 - .../shared-components/upload-panel.svelte | 161 - .../shared-components/user-avatar.svelte | 2 +- .../lib/components/sidebar/sidebar.spec.ts | 80 - web/src/lib/components/sidebar/sidebar.svelte | 51 - .../PinCodeChangeForm.svelte | 59 - .../PinCodeCreateForm.svelte | 62 - .../user-settings-page/PinCodeInput.svelte | 139 - .../user-settings-page/PinCodeSettings.svelte | 33 - .../user-settings-page/app-settings.svelte | 49 +- .../user-settings-page/device-card.svelte | 2 +- .../user-settings-page/device-list.svelte | 2 +- .../download-settings.svelte | 60 - .../feature-settings.svelte | 175 - .../notifications-settings.svelte | 64 - .../user-settings-page/oauth-settings.svelte | 64 - .../partner-settings.svelte | 200 - .../user-api-key-grid.svelte | 2 +- .../user-api-key-list.svelte | 2 +- .../user-profile-settings.svelte | 9 +- .../user-purchase-settings.svelte | 185 - .../user-settings-list.svelte | 113 +- .../user-usage-statistic.svelte | 98 - .../components/users/FeatureSetting.svelte | 16 - web/src/lib/constants.ts | 200 - web/src/lib/elements/Dropdown.svelte | 2 +- web/src/lib/elements/DurationInput.svelte | 52 - web/src/lib/elements/StarRating.svelte | 121 - .../lib/elements/__test__/star-rating.spec.ts | 78 - web/src/lib/managers/auth-manager.svelte.ts | 7 +- web/src/lib/managers/event-manager.svelte.ts | 67 +- .../managers/feature-flags-manager.svelte.ts | 30 - web/src/lib/managers/queue-manager.svelte.ts | 47 - .../managers/server-config-manager.svelte.ts | 2 +- web/src/lib/modals/ApiKeyCreateModal.svelte | 2 +- web/src/lib/modals/ApiKeyUpdateModal.svelte | 2 +- .../AuthDisableLoginConfirmModal.svelte | 34 - .../lib/modals/HelpAndFeedbackModal.svelte | 71 - .../modals/PasswordResetSuccessModal.svelte | 34 - web/src/lib/modals/ServerAboutModal.svelte | 104 - web/src/lib/modals/ShortcutsModal.svelte | 4 - .../lib/modals/UserDeleteConfirmModal.svelte | 76 - .../lib/modals/UserRestoreConfirmModal.svelte | 45 - web/src/lib/modals/timezone-utils.ts | 161 - web/src/lib/route.ts | 111 +- web/src/lib/services/api-key.service.ts | 6 +- web/src/lib/services/app.service.ts | 21 +- web/src/lib/services/system-config.service.ts | 118 - web/src/lib/services/user-admin.service.ts | 215 - web/src/lib/services/user.service.ts | 48 +- .../lib/stores/notification-manager.svelte.ts | 42 - web/src/lib/stores/preferences.store.ts | 124 - web/src/lib/stores/user.store.ts | 6 +- web/src/lib/stores/user.svelte.ts | 14 +- web/src/lib/stores/websocket.ts | 71 +- web/src/lib/types.ts | 39 - web/src/lib/utils.ts | 254 +- web/src/lib/utils/auth.ts | 42 +- web/src/lib/utils/handle-error.ts | 2 +- web/src/lib/utils/layout-utils.ts | 131 - web/src/lib/utils/navigation.ts | 136 - web/src/lib/utils/server.ts | 19 +- web/src/params/photos.ts | 5 - web/src/routes/(user)/+layout.svelte | 32 +- web/src/routes/(user)/+layout.ts | 11 +- web/src/routes/(user)/user-settings/+page.ts | 2 +- web/src/routes/+layout.svelte | 69 +- web/src/routes/+layout.ts | 5 +- web/src/routes/+page.ts | 9 +- .../routes/auth/change-password/+page.svelte | 2 +- web/src/routes/auth/change-password/+page.ts | 2 +- web/src/routes/auth/login/+page.svelte | 135 +- web/src/routes/auth/login/+page.ts | 2 +- web/src/routes/auth/onboarding/+page.svelte | 184 - web/src/routes/auth/onboarding/+page.ts | 15 - web/src/routes/auth/pin-prompt/+page.svelte | 82 - web/src/routes/auth/pin-prompt/+page.ts | 21 - web/src/routes/auth/register/+page.svelte | 2 +- web/src/service-worker/broadcast-channel.ts | 25 - web/src/service-worker/cache.ts | 42 - web/src/service-worker/index.ts | 39 - web/src/service-worker/request.ts | 73 - web/src/test-data/factories/album-factory.ts | 2 +- web/src/test-data/factories/asset-factory.ts | 96 - web/src/test-data/factories/person-factory.ts | 2 +- .../factories/preferences-factory.ts | 2 +- .../factories/shared-link-factory.ts | 2 +- web/src/test-data/factories/user-factory.ts | 2 +- 823 files changed, 12705 insertions(+), 153814 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/mobile/container-compose-overrides.yml delete mode 100644 .devcontainer/mobile/devcontainer.json delete mode 100755 .devcontainer/server/container-common.sh delete mode 100644 .devcontainer/server/container-compose-overrides.yml delete mode 100755 .devcontainer/server/container-start-backend.sh delete mode 100755 .devcontainer/server/container-start-frontend.sh delete mode 100755 .devcontainer/server/container-start.sh delete mode 100644 .github/.nvmrc delete mode 100644 .github/.prettierignore delete mode 100644 .github/DISCUSSION_TEMPLATE/feature-request.yaml delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/PULL_REQUEST_TEMPLATE/config.yml delete mode 100644 .github/labeler.yml delete mode 100644 .github/mise.toml delete mode 100644 .github/package.json delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/release.yml delete mode 100644 .github/workflows/build-mobile.yml delete mode 100644 .github/workflows/cache-cleanup.yml delete mode 100644 .github/workflows/cli.yml delete mode 100644 .github/workflows/close-duplicates.yml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/docs-build.yml delete mode 100644 .github/workflows/docs-deploy.yml delete mode 100644 .github/workflows/docs-destroy.yml delete mode 100644 .github/workflows/fix-format.yml delete mode 100644 .github/workflows/merge-translations.yml delete mode 100644 .github/workflows/org-pr-require-conventional-commit.yml delete mode 100644 .github/workflows/org-zizmor.yml delete mode 100644 .github/workflows/pr-label-validation.yml delete mode 100644 .github/workflows/pr-labeler.yml delete mode 100644 .github/workflows/prepare-release.yml delete mode 100644 .github/workflows/preview-label.yaml delete mode 100644 .github/workflows/release-pr.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/sdk.yml delete mode 100644 .github/workflows/static_analysis.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/weblate-lock.yml delete mode 100644 .gitmodules delete mode 100644 .pnpmfile.cjs delete mode 100644 e2e/src/api/specs/activity.e2e-spec.ts delete mode 100644 e2e/src/api/specs/album.e2e-spec.ts delete mode 100644 e2e/src/api/specs/asset.e2e-spec.ts delete mode 100644 e2e/src/api/specs/database-backups.e2e-spec.ts delete mode 100644 e2e/src/api/specs/download.e2e-spec.ts delete mode 100644 e2e/src/api/specs/jobs.e2e-spec.ts delete mode 100644 e2e/src/api/specs/library.e2e-spec.ts delete mode 100644 e2e/src/api/specs/maintenance.e2e-spec.ts delete mode 100644 e2e/src/api/specs/map.e2e-spec.ts delete mode 100644 e2e/src/api/specs/memory.e2e-spec.ts delete mode 100644 e2e/src/api/specs/oauth.e2e-spec.ts delete mode 100644 e2e/src/api/specs/partner.e2e-spec.ts delete mode 100644 e2e/src/api/specs/person.e2e-spec.ts delete mode 100644 e2e/src/api/specs/search.e2e-spec.ts delete mode 100644 e2e/src/api/specs/shared-link.e2e-spec.ts delete mode 100644 e2e/src/api/specs/stack.e2e-spec.ts delete mode 100644 e2e/src/api/specs/system-config.e2e-spec.ts delete mode 100644 e2e/src/api/specs/system-metadata.e2e-spec.ts delete mode 100644 e2e/src/api/specs/tag.e2e-spec.ts delete mode 100644 e2e/src/api/specs/trash.e2e-spec.ts delete mode 100644 e2e/src/api/specs/user-admin.e2e-spec.ts delete mode 100644 e2e/src/cli/specs/login.e2e-spec.ts delete mode 100644 e2e/src/cli/specs/server-info.e2e-spec.ts delete mode 100644 e2e/src/cli/specs/upload.e2e-spec.ts delete mode 100644 e2e/src/cli/specs/version.e2e-spec.ts delete mode 100644 e2e/src/generators.ts delete mode 100644 e2e/src/generators/memory.ts delete mode 100644 e2e/src/generators/memory/model-objects.ts delete mode 100644 e2e/src/generators/timeline.ts delete mode 100644 e2e/src/generators/timeline/distribution-patterns.ts delete mode 100644 e2e/src/generators/timeline/images.ts delete mode 100644 e2e/src/generators/timeline/model-objects.ts delete mode 100644 e2e/src/generators/timeline/rest-response.ts delete mode 100644 e2e/src/generators/timeline/timeline-config.ts delete mode 100644 e2e/src/generators/timeline/utils.ts delete mode 100644 e2e/src/immich-admin/specs/immich-admin.e2e-spec.ts delete mode 100644 e2e/src/mock-network/base-network.ts delete mode 100644 e2e/src/mock-network/memory-network.ts delete mode 100644 e2e/src/mock-network/timeline-network.ts delete mode 100644 e2e/src/web/specs/album.e2e-spec.ts delete mode 100644 e2e/src/web/specs/asset-viewer/asset-viewer.ui-spec.ts delete mode 100644 e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts delete mode 100644 e2e/src/web/specs/asset-viewer/navbar.e2e-spec.ts delete mode 100644 e2e/src/web/specs/asset-viewer/slideshow.e2e-spec.ts delete mode 100644 e2e/src/web/specs/asset-viewer/stack.e2e-spec.ts delete mode 100644 e2e/src/web/specs/database-backups.e2e-spec.ts delete mode 100644 e2e/src/web/specs/maintenance.e2e-spec.ts delete mode 100644 e2e/src/web/specs/memory/memory-viewer.ui-spec.ts delete mode 100644 e2e/src/web/specs/memory/utils.ts delete mode 100644 e2e/src/web/specs/photo-viewer.e2e-spec.ts delete mode 100644 e2e/src/web/specs/search/search-gallery.ui-spec.ts delete mode 100644 e2e/src/web/specs/shared-link.e2e-spec.ts delete mode 100644 e2e/src/web/specs/timeline/timeline.ui-spec.ts delete mode 100644 e2e/src/web/specs/timeline/utils.ts delete mode 100644 e2e/src/web/specs/user-admin.e2e-spec.ts delete mode 100644 e2e/src/web/specs/websocket.e2e-spec.ts delete mode 100644 i18n/af.json delete mode 100644 i18n/ar.json delete mode 100644 i18n/az.json delete mode 100644 i18n/be.json delete mode 100644 i18n/bg.json delete mode 100644 i18n/bi.json delete mode 100644 i18n/bn.json delete mode 100644 i18n/br.json delete mode 100644 i18n/ca.json delete mode 100644 i18n/cs.json delete mode 100644 i18n/cv.json delete mode 100644 i18n/da.json delete mode 100644 i18n/de.json delete mode 100644 i18n/de_CH.json delete mode 100644 i18n/el.json delete mode 100644 i18n/eo.json delete mode 100644 i18n/es.json delete mode 100644 i18n/et.json delete mode 100644 i18n/eu.json delete mode 100644 i18n/fa.json delete mode 100644 i18n/fi.json delete mode 100644 i18n/fil.json delete mode 100644 i18n/fr.json delete mode 100644 i18n/ga.json delete mode 100644 i18n/gl.json delete mode 100644 i18n/gsw.json delete mode 100644 i18n/gu.json delete mode 100644 i18n/he.json delete mode 100644 i18n/hi.json delete mode 100644 i18n/hr.json delete mode 100644 i18n/hu.json delete mode 100644 i18n/hy.json delete mode 100644 i18n/id.json delete mode 100644 i18n/is.json delete mode 100644 i18n/it.json delete mode 100644 i18n/ja.json delete mode 100644 i18n/ka.json delete mode 100644 i18n/kk.json delete mode 100644 i18n/km.json delete mode 100644 i18n/kmr.json delete mode 100644 i18n/kn.json delete mode 100644 i18n/ko.json delete mode 100644 i18n/lb.json delete mode 100644 i18n/lt.json delete mode 100644 i18n/lv.json delete mode 100644 i18n/mfa.json delete mode 100644 i18n/mk.json delete mode 100644 i18n/ml.json delete mode 100644 i18n/mn.json delete mode 100644 i18n/mr.json delete mode 100644 i18n/ms.json delete mode 100644 i18n/nb_NO.json delete mode 100644 i18n/nl.json delete mode 100644 i18n/nn.json delete mode 100644 i18n/pa.json delete mode 100644 i18n/pl.json delete mode 100644 i18n/pt.json delete mode 100644 i18n/pt_BR.json delete mode 100644 i18n/ro.json delete mode 100644 i18n/ru.json delete mode 100644 i18n/si.json delete mode 100644 i18n/sk.json delete mode 100644 i18n/sl.json delete mode 100644 i18n/sq.json delete mode 100644 i18n/sr_Cyrl.json delete mode 100644 i18n/sr_Latn.json delete mode 100644 i18n/sv.json delete mode 100644 i18n/ta.json delete mode 100644 i18n/te.json delete mode 100644 i18n/th.json delete mode 100644 i18n/tr.json delete mode 100644 i18n/uk.json delete mode 100644 i18n/ur.json delete mode 100644 i18n/uz.json delete mode 100644 i18n/vi.json delete mode 100644 i18n/yue_Hant.json delete mode 100644 i18n/zh_Hant.json delete mode 100644 i18n/zh_SIMPLIFIED.json delete mode 100644 mobile/openapi/lib/api/activities_api.dart delete mode 100644 mobile/openapi/lib/api/albums_api.dart delete mode 100644 mobile/openapi/lib/api/assets_api.dart delete mode 100644 mobile/openapi/lib/api/authentication_admin_api.dart delete mode 100644 mobile/openapi/lib/api/database_backups_admin_api.dart delete mode 100644 mobile/openapi/lib/api/deprecated_api.dart delete mode 100644 mobile/openapi/lib/api/download_api.dart delete mode 100644 mobile/openapi/lib/api/duplicates_api.dart delete mode 100644 mobile/openapi/lib/api/faces_api.dart delete mode 100644 mobile/openapi/lib/api/jobs_api.dart delete mode 100644 mobile/openapi/lib/api/libraries_api.dart delete mode 100644 mobile/openapi/lib/api/maintenance_admin_api.dart delete mode 100644 mobile/openapi/lib/api/map_api.dart delete mode 100644 mobile/openapi/lib/api/memories_api.dart delete mode 100644 mobile/openapi/lib/api/notifications_admin_api.dart delete mode 100644 mobile/openapi/lib/api/notifications_api.dart delete mode 100644 mobile/openapi/lib/api/partners_api.dart delete mode 100644 mobile/openapi/lib/api/people_api.dart delete mode 100644 mobile/openapi/lib/api/plugins_api.dart delete mode 100644 mobile/openapi/lib/api/queues_api.dart delete mode 100644 mobile/openapi/lib/api/search_api.dart delete mode 100644 mobile/openapi/lib/api/shared_links_api.dart delete mode 100644 mobile/openapi/lib/api/stacks_api.dart delete mode 100644 mobile/openapi/lib/api/sync_api.dart delete mode 100644 mobile/openapi/lib/api/system_config_api.dart delete mode 100644 mobile/openapi/lib/api/system_metadata_api.dart delete mode 100644 mobile/openapi/lib/api/tags_api.dart delete mode 100644 mobile/openapi/lib/api/timeline_api.dart delete mode 100644 mobile/openapi/lib/api/trash_api.dart delete mode 100644 mobile/openapi/lib/api/users_admin_api.dart delete mode 100644 mobile/openapi/lib/api/views_api.dart delete mode 100644 mobile/openapi/lib/api/workflows_api.dart delete mode 100644 mobile/openapi/lib/model/activity_create_dto.dart delete mode 100644 mobile/openapi/lib/model/activity_response_dto.dart delete mode 100644 mobile/openapi/lib/model/activity_statistics_response_dto.dart delete mode 100644 mobile/openapi/lib/model/add_users_dto.dart delete mode 100644 mobile/openapi/lib/model/admin_onboarding_update_dto.dart delete mode 100644 mobile/openapi/lib/model/album_response_dto.dart delete mode 100644 mobile/openapi/lib/model/album_statistics_response_dto.dart delete mode 100644 mobile/openapi/lib/model/album_user_add_dto.dart delete mode 100644 mobile/openapi/lib/model/album_user_create_dto.dart delete mode 100644 mobile/openapi/lib/model/album_user_response_dto.dart delete mode 100644 mobile/openapi/lib/model/album_user_role.dart delete mode 100644 mobile/openapi/lib/model/albums_add_assets_dto.dart delete mode 100644 mobile/openapi/lib/model/albums_add_assets_response_dto.dart delete mode 100644 mobile/openapi/lib/model/albums_response.dart delete mode 100644 mobile/openapi/lib/model/albums_update.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_update_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_upload_check_item.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_bulk_upload_check_result.dart delete mode 100644 mobile/openapi/lib/model/asset_copy_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_delta_sync_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_delta_sync_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action_crop.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action_list_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action_list_dto_edits_inner.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action_mirror.dart delete mode 100644 mobile/openapi/lib/model/asset_edit_action_rotate.dart delete mode 100644 mobile/openapi/lib/model/asset_edits_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_face_create_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_face_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_face_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_face_update_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_face_update_item.dart delete mode 100644 mobile/openapi/lib/model/asset_face_without_person_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_full_sync_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_ids_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_ids_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_job_name.dart delete mode 100644 mobile/openapi/lib/model/asset_jobs_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_media_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_media_size.dart delete mode 100644 mobile/openapi/lib/model/asset_media_status.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_upsert_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_ocr_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_order.dart delete mode 100644 mobile/openapi/lib/model/asset_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_stack_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_stats_response_dto.dart delete mode 100644 mobile/openapi/lib/model/asset_type_enum.dart delete mode 100644 mobile/openapi/lib/model/asset_visibility.dart delete mode 100644 mobile/openapi/lib/model/audio_codec.dart delete mode 100644 mobile/openapi/lib/model/auth_status_response_dto.dart delete mode 100644 mobile/openapi/lib/model/avatar_update.dart delete mode 100644 mobile/openapi/lib/model/bulk_id_error_reason.dart delete mode 100644 mobile/openapi/lib/model/bulk_id_response_dto.dart delete mode 100644 mobile/openapi/lib/model/bulk_ids_dto.dart delete mode 100644 mobile/openapi/lib/model/cast_response.dart delete mode 100644 mobile/openapi/lib/model/cast_update.dart delete mode 100644 mobile/openapi/lib/model/check_existing_assets_dto.dart delete mode 100644 mobile/openapi/lib/model/check_existing_assets_response_dto.dart delete mode 100644 mobile/openapi/lib/model/clip_config.dart delete mode 100644 mobile/openapi/lib/model/colorspace.dart delete mode 100644 mobile/openapi/lib/model/contributor_count_response_dto.dart delete mode 100644 mobile/openapi/lib/model/cq_mode.dart delete mode 100644 mobile/openapi/lib/model/create_album_dto.dart delete mode 100644 mobile/openapi/lib/model/create_library_dto.dart delete mode 100644 mobile/openapi/lib/model/create_profile_image_response_dto.dart delete mode 100644 mobile/openapi/lib/model/crop_parameters.dart delete mode 100644 mobile/openapi/lib/model/database_backup_config.dart delete mode 100644 mobile/openapi/lib/model/database_backup_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/database_backup_dto.dart delete mode 100644 mobile/openapi/lib/model/database_backup_list_response_dto.dart delete mode 100644 mobile/openapi/lib/model/download_archive_info.dart delete mode 100644 mobile/openapi/lib/model/download_info_dto.dart delete mode 100644 mobile/openapi/lib/model/download_response.dart delete mode 100644 mobile/openapi/lib/model/download_response_dto.dart delete mode 100644 mobile/openapi/lib/model/download_update.dart delete mode 100644 mobile/openapi/lib/model/duplicate_detection_config.dart delete mode 100644 mobile/openapi/lib/model/duplicate_response_dto.dart delete mode 100644 mobile/openapi/lib/model/email_notifications_response.dart delete mode 100644 mobile/openapi/lib/model/email_notifications_update.dart delete mode 100644 mobile/openapi/lib/model/exif_response_dto.dart delete mode 100644 mobile/openapi/lib/model/face_dto.dart delete mode 100644 mobile/openapi/lib/model/facial_recognition_config.dart delete mode 100644 mobile/openapi/lib/model/folders_response.dart delete mode 100644 mobile/openapi/lib/model/folders_update.dart delete mode 100644 mobile/openapi/lib/model/image_format.dart delete mode 100644 mobile/openapi/lib/model/job_create_dto.dart delete mode 100644 mobile/openapi/lib/model/job_name.dart delete mode 100644 mobile/openapi/lib/model/job_settings_dto.dart delete mode 100644 mobile/openapi/lib/model/library_response_dto.dart delete mode 100644 mobile/openapi/lib/model/library_stats_response_dto.dart delete mode 100644 mobile/openapi/lib/model/license_key_dto.dart delete mode 100644 mobile/openapi/lib/model/license_response_dto.dart delete mode 100644 mobile/openapi/lib/model/log_level.dart delete mode 100644 mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart delete mode 100644 mobile/openapi/lib/model/maintenance_action.dart delete mode 100644 mobile/openapi/lib/model/maintenance_auth_dto.dart delete mode 100644 mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart delete mode 100644 mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart delete mode 100644 mobile/openapi/lib/model/maintenance_login_dto.dart delete mode 100644 mobile/openapi/lib/model/maintenance_status_response_dto.dart delete mode 100644 mobile/openapi/lib/model/manual_job_name.dart delete mode 100644 mobile/openapi/lib/model/map_marker_response_dto.dart delete mode 100644 mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart delete mode 100644 mobile/openapi/lib/model/memories_response.dart delete mode 100644 mobile/openapi/lib/model/memories_update.dart delete mode 100644 mobile/openapi/lib/model/memory_create_dto.dart delete mode 100644 mobile/openapi/lib/model/memory_response_dto.dart delete mode 100644 mobile/openapi/lib/model/memory_search_order.dart delete mode 100644 mobile/openapi/lib/model/memory_statistics_response_dto.dart delete mode 100644 mobile/openapi/lib/model/memory_type.dart delete mode 100644 mobile/openapi/lib/model/memory_update_dto.dart delete mode 100644 mobile/openapi/lib/model/merge_person_dto.dart delete mode 100644 mobile/openapi/lib/model/metadata_search_dto.dart delete mode 100644 mobile/openapi/lib/model/mirror_axis.dart delete mode 100644 mobile/openapi/lib/model/mirror_parameters.dart delete mode 100644 mobile/openapi/lib/model/notification_create_dto.dart delete mode 100644 mobile/openapi/lib/model/notification_delete_all_dto.dart delete mode 100644 mobile/openapi/lib/model/notification_dto.dart delete mode 100644 mobile/openapi/lib/model/notification_level.dart delete mode 100644 mobile/openapi/lib/model/notification_type.dart delete mode 100644 mobile/openapi/lib/model/notification_update_all_dto.dart delete mode 100644 mobile/openapi/lib/model/notification_update_dto.dart delete mode 100644 mobile/openapi/lib/model/o_auth_authorize_response_dto.dart delete mode 100644 mobile/openapi/lib/model/o_auth_callback_dto.dart delete mode 100644 mobile/openapi/lib/model/o_auth_config_dto.dart delete mode 100644 mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart delete mode 100644 mobile/openapi/lib/model/ocr_config.dart delete mode 100644 mobile/openapi/lib/model/on_this_day_dto.dart delete mode 100644 mobile/openapi/lib/model/onboarding_dto.dart delete mode 100644 mobile/openapi/lib/model/onboarding_response_dto.dart delete mode 100644 mobile/openapi/lib/model/partner_create_dto.dart delete mode 100644 mobile/openapi/lib/model/partner_direction.dart delete mode 100644 mobile/openapi/lib/model/partner_response_dto.dart delete mode 100644 mobile/openapi/lib/model/partner_update_dto.dart delete mode 100644 mobile/openapi/lib/model/people_response.dart delete mode 100644 mobile/openapi/lib/model/people_response_dto.dart delete mode 100644 mobile/openapi/lib/model/people_update.dart delete mode 100644 mobile/openapi/lib/model/people_update_dto.dart delete mode 100644 mobile/openapi/lib/model/people_update_item.dart delete mode 100644 mobile/openapi/lib/model/person_create_dto.dart delete mode 100644 mobile/openapi/lib/model/person_response_dto.dart delete mode 100644 mobile/openapi/lib/model/person_statistics_response_dto.dart delete mode 100644 mobile/openapi/lib/model/person_update_dto.dart delete mode 100644 mobile/openapi/lib/model/person_with_faces_response_dto.dart delete mode 100644 mobile/openapi/lib/model/pin_code_change_dto.dart delete mode 100644 mobile/openapi/lib/model/pin_code_reset_dto.dart delete mode 100644 mobile/openapi/lib/model/pin_code_setup_dto.dart delete mode 100644 mobile/openapi/lib/model/places_response_dto.dart delete mode 100644 mobile/openapi/lib/model/plugin_action_response_dto.dart delete mode 100644 mobile/openapi/lib/model/plugin_context_type.dart delete mode 100644 mobile/openapi/lib/model/plugin_filter_response_dto.dart delete mode 100644 mobile/openapi/lib/model/plugin_response_dto.dart delete mode 100644 mobile/openapi/lib/model/plugin_trigger_response_dto.dart delete mode 100644 mobile/openapi/lib/model/plugin_trigger_type.dart delete mode 100644 mobile/openapi/lib/model/purchase_response.dart delete mode 100644 mobile/openapi/lib/model/purchase_update.dart delete mode 100644 mobile/openapi/lib/model/queue_command.dart delete mode 100644 mobile/openapi/lib/model/queue_command_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_job_response_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_job_status.dart delete mode 100644 mobile/openapi/lib/model/queue_name.dart delete mode 100644 mobile/openapi/lib/model/queue_response_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_response_legacy_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_statistics_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_status_legacy_dto.dart delete mode 100644 mobile/openapi/lib/model/queue_update_dto.dart delete mode 100644 mobile/openapi/lib/model/queues_response_legacy_dto.dart delete mode 100644 mobile/openapi/lib/model/random_search_dto.dart delete mode 100644 mobile/openapi/lib/model/ratings_response.dart delete mode 100644 mobile/openapi/lib/model/ratings_update.dart delete mode 100644 mobile/openapi/lib/model/reaction_level.dart delete mode 100644 mobile/openapi/lib/model/reaction_type.dart delete mode 100644 mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart delete mode 100644 mobile/openapi/lib/model/rotate_parameters.dart delete mode 100644 mobile/openapi/lib/model/search_album_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_asset_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_explore_item.dart delete mode 100644 mobile/openapi/lib/model/search_explore_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_facet_count_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_facet_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_statistics_response_dto.dart delete mode 100644 mobile/openapi/lib/model/search_suggestion_type.dart delete mode 100644 mobile/openapi/lib/model/server_apk_links_dto.dart delete mode 100644 mobile/openapi/lib/model/server_media_types_response_dto.dart delete mode 100644 mobile/openapi/lib/model/server_stats_response_dto.dart delete mode 100644 mobile/openapi/lib/model/server_storage_response_dto.dart delete mode 100644 mobile/openapi/lib/model/server_theme_dto.dart delete mode 100644 mobile/openapi/lib/model/server_version_history_response_dto.dart delete mode 100644 mobile/openapi/lib/model/session_unlock_dto.dart delete mode 100644 mobile/openapi/lib/model/session_update_dto.dart delete mode 100644 mobile/openapi/lib/model/set_maintenance_mode_dto.dart delete mode 100644 mobile/openapi/lib/model/shared_link_create_dto.dart delete mode 100644 mobile/openapi/lib/model/shared_link_edit_dto.dart delete mode 100644 mobile/openapi/lib/model/shared_link_response_dto.dart delete mode 100644 mobile/openapi/lib/model/shared_link_type.dart delete mode 100644 mobile/openapi/lib/model/shared_links_response.dart delete mode 100644 mobile/openapi/lib/model/shared_links_update.dart delete mode 100644 mobile/openapi/lib/model/smart_search_dto.dart delete mode 100644 mobile/openapi/lib/model/source_type.dart delete mode 100644 mobile/openapi/lib/model/stack_create_dto.dart delete mode 100644 mobile/openapi/lib/model/stack_response_dto.dart delete mode 100644 mobile/openapi/lib/model/stack_update_dto.dart delete mode 100644 mobile/openapi/lib/model/statistics_search_dto.dart delete mode 100644 mobile/openapi/lib/model/storage_folder.dart delete mode 100644 mobile/openapi/lib/model/sync_ack_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/sync_ack_dto.dart delete mode 100644 mobile/openapi/lib/model/sync_ack_set_dto.dart delete mode 100644 mobile/openapi/lib/model/sync_album_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_album_to_asset_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_album_user_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_album_user_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_album_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_exif_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_face_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_face_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_metadata_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_asset_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_auth_user_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_entity_type.dart delete mode 100644 mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_memory_asset_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_memory_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_memory_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_partner_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_partner_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_person_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_person_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_request_type.dart delete mode 100644 mobile/openapi/lib/model/sync_stack_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_stack_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_stream_dto.dart delete mode 100644 mobile/openapi/lib/model/sync_user_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_user_metadata_v1.dart delete mode 100644 mobile/openapi/lib/model/sync_user_v1.dart delete mode 100644 mobile/openapi/lib/model/system_config_backups_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_faces_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_generated_image_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_image_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_job_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_library_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_library_scan_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_library_watch_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_logging_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_machine_learning_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_map_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_metadata_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_new_version_check_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_notifications_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_o_auth_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_password_login_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_server_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_smtp_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_smtp_transport_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_storage_template_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_template_emails_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_template_storage_option_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_templates_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_theme_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_trash_dto.dart delete mode 100644 mobile/openapi/lib/model/system_config_user_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_bulk_assets_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_create_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_response_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_update_dto.dart delete mode 100644 mobile/openapi/lib/model/tag_upsert_dto.dart delete mode 100644 mobile/openapi/lib/model/tags_response.dart delete mode 100644 mobile/openapi/lib/model/tags_update.dart delete mode 100644 mobile/openapi/lib/model/template_dto.dart delete mode 100644 mobile/openapi/lib/model/template_response_dto.dart delete mode 100644 mobile/openapi/lib/model/test_email_response_dto.dart delete mode 100644 mobile/openapi/lib/model/time_bucket_asset_response_dto.dart delete mode 100644 mobile/openapi/lib/model/time_buckets_response_dto.dart delete mode 100644 mobile/openapi/lib/model/tone_mapping.dart delete mode 100644 mobile/openapi/lib/model/transcode_hw_accel.dart delete mode 100644 mobile/openapi/lib/model/transcode_policy.dart delete mode 100644 mobile/openapi/lib/model/trash_response_dto.dart delete mode 100644 mobile/openapi/lib/model/update_album_dto.dart delete mode 100644 mobile/openapi/lib/model/update_album_user_dto.dart delete mode 100644 mobile/openapi/lib/model/update_asset_dto.dart delete mode 100644 mobile/openapi/lib/model/update_library_dto.dart delete mode 100644 mobile/openapi/lib/model/usage_by_user_dto.dart delete mode 100644 mobile/openapi/lib/model/user_admin_create_dto.dart delete mode 100644 mobile/openapi/lib/model/user_admin_delete_dto.dart delete mode 100644 mobile/openapi/lib/model/user_admin_update_dto.dart delete mode 100644 mobile/openapi/lib/model/user_avatar_color.dart delete mode 100644 mobile/openapi/lib/model/user_license.dart delete mode 100644 mobile/openapi/lib/model/user_metadata_key.dart delete mode 100644 mobile/openapi/lib/model/user_preferences_response_dto.dart delete mode 100644 mobile/openapi/lib/model/user_preferences_update_dto.dart delete mode 100644 mobile/openapi/lib/model/validate_library_dto.dart delete mode 100644 mobile/openapi/lib/model/validate_library_import_path_response_dto.dart delete mode 100644 mobile/openapi/lib/model/validate_library_response_dto.dart delete mode 100644 mobile/openapi/lib/model/version_check_state_response_dto.dart delete mode 100644 mobile/openapi/lib/model/video_codec.dart delete mode 100644 mobile/openapi/lib/model/video_container.dart delete mode 100644 mobile/openapi/lib/model/workflow_action_item_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_action_response_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_create_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_filter_item_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_filter_response_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_response_dto.dart delete mode 100644 mobile/openapi/lib/model/workflow_update_dto.dart delete mode 100644 open-api/immich-openapi-specs.json create mode 100644 open-api/server-openapi-specs.json create mode 100644 server/server-openapi-specs.json create mode 100644 server/src/bin/sync-open-api.ts delete mode 100644 server/test/fixtures/album.stub.ts delete mode 100644 server/test/fixtures/asset.stub.ts delete mode 100644 server/test/fixtures/face.stub.ts delete mode 100644 server/test/fixtures/file.stub.ts delete mode 100644 server/test/fixtures/media.stub.ts delete mode 100644 server/test/fixtures/notification.stub.ts delete mode 100644 server/test/fixtures/person.stub.ts delete mode 100644 server/test/fixtures/shared-link.stub.ts delete mode 100644 server/test/fixtures/tag.stub.ts delete mode 100644 server/test/medium/specs/exif/exif-date-time.spec.ts delete mode 100644 server/test/medium/specs/exif/exif-gps.spec.ts delete mode 100644 server/test/medium/specs/exif/exif-tags.spec.ts delete mode 100644 server/test/medium/specs/repositories/asset-edit.repository.spec.ts delete mode 100644 server/test/medium/specs/repositories/asset.repository.spec.ts delete mode 100644 server/test/medium/specs/services/asset-media.service.spec.ts delete mode 100644 server/test/medium/specs/services/asset.service.spec.ts delete mode 100644 server/test/medium/specs/services/audit.database.spec.ts delete mode 100644 server/test/medium/specs/services/memory.service.spec.ts delete mode 100644 server/test/medium/specs/services/metadata.service.spec.ts delete mode 100644 server/test/medium/specs/services/ocr.service.spec.ts delete mode 100644 server/test/medium/specs/services/person.service.spec.ts delete mode 100644 server/test/medium/specs/services/plugin.service.spec.ts delete mode 100644 server/test/medium/specs/services/search.service.spec.ts delete mode 100644 server/test/medium/specs/services/shared-link.service.spec.ts delete mode 100644 server/test/medium/specs/services/storage.service.spec.ts delete mode 100644 server/test/medium/specs/services/sync.service.spec.ts delete mode 100644 server/test/medium/specs/services/tag.service.spec.ts delete mode 100644 server/test/medium/specs/services/timeline.service.spec.ts delete mode 100644 server/test/medium/specs/services/version.service.spec.ts delete mode 100644 server/test/medium/specs/services/workflow.service.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-album-asset-exif.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-album-asset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-album-to-asset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-album-user.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-album.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-asset-exif.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-asset-face.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-asset-metadata.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-asset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-auth-user.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-complete.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-memory-asset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-memory.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-partner-asset-exif.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-partner-asset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-partner-stack.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-partner.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-person.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-reset.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-stack.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-types.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-user-metadata.spec.ts delete mode 100644 server/test/medium/specs/sync/sync-user.spec.ts delete mode 100644 server/test/repositories/access.repository.mock.ts delete mode 100644 server/test/repositories/asset.repository.mock.ts delete mode 100644 server/test/repositories/media.repository.mock.ts delete mode 100644 server/test/repositories/metadata.repository.mock.ts delete mode 100644 server/test/repositories/storage.repository.mock.ts delete mode 100644 web/src/lib/actions/drag-and-drop.ts delete mode 100644 web/src/lib/actions/thumbhash.ts delete mode 100644 web/src/lib/actions/zoom-image.ts delete mode 100644 web/src/lib/components/AdminCard.svelte delete mode 100644 web/src/lib/components/AssetViewerEvents.svelte delete mode 100644 web/src/lib/components/QueueCard.svelte delete mode 100644 web/src/lib/components/QueueCardBadge.svelte delete mode 100644 web/src/lib/components/QueueCardButton.svelte delete mode 100644 web/src/lib/components/QueueGraph.svelte delete mode 100644 web/src/lib/components/QueuePanel.svelte delete mode 100644 web/src/lib/components/QueueStorageMigrationDescription.svelte delete mode 100644 web/src/lib/components/ServerAboutItem.svelte delete mode 100644 web/src/lib/components/SharedLinkExpiration.svelte delete mode 100644 web/src/lib/components/SharedLinkFormFields.spec.ts delete mode 100644 web/src/lib/components/SharedLinkFormFields.svelte delete mode 100644 web/src/lib/components/VersionAnnouncement.svelte delete mode 100644 web/src/lib/components/layouts/AdminPageLayout.svelte delete mode 100644 web/src/lib/components/pages/SharedLinkErrorPage.svelte delete mode 100644 web/src/lib/components/pages/SharedLinkPage.svelte delete mode 100644 web/src/lib/components/shared-components/__test__/number-range-input.spec.ts delete mode 100644 web/src/lib/components/shared-components/album-selection/album-selection-utils.spec.ts delete mode 100644 web/src/lib/components/shared-components/album-selection/album-selection-utils.ts delete mode 100644 web/src/lib/components/shared-components/album-selection/new-album-list-item.svelte delete mode 100644 web/src/lib/components/shared-components/change-location.svelte delete mode 100644 web/src/lib/components/shared-components/context-menu/button-context-menu.svelte delete mode 100644 web/src/lib/components/shared-components/context-menu/context-menu.svelte delete mode 100644 web/src/lib/components/shared-components/context-menu/menu-option.svelte delete mode 100644 web/src/lib/components/shared-components/context-menu/right-click-context-menu.svelte delete mode 100644 web/src/lib/components/shared-components/control-app-bar.svelte delete mode 100644 web/src/lib/components/shared-components/coordinates-input.svelte delete mode 100644 web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte delete mode 100644 web/src/lib/components/shared-components/empty-placeholder.svelte delete mode 100644 web/src/lib/components/shared-components/gallery-viewer/gallery-viewer.svelte delete mode 100644 web/src/lib/components/shared-components/map/map.svelte delete mode 100644 web/src/lib/components/shared-components/navigation-bar/notification-item.svelte delete mode 100644 web/src/lib/components/shared-components/navigation-bar/notification-panel.svelte delete mode 100644 web/src/lib/components/shared-components/progress-bar/progress-bar.svelte delete mode 100644 web/src/lib/components/shared-components/purchasing/individual-purchase-option-card.svelte delete mode 100644 web/src/lib/components/shared-components/purchasing/purchase-activation-success.svelte delete mode 100644 web/src/lib/components/shared-components/purchasing/purchase-content.svelte delete mode 100644 web/src/lib/components/shared-components/purchasing/server-purchase-option-card.svelte delete mode 100644 web/src/lib/components/shared-components/qrcode.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-bar.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-camera-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-date-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-display-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-history-box.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-location-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-media-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-people-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-ratings-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-tags-section.svelte delete mode 100644 web/src/lib/components/shared-components/search-bar/search-text-section.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/bottom-info.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/purchase-info.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/recent-albums.spec.ts delete mode 100644 web/src/lib/components/shared-components/side-bar/recent-albums.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/server-status.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/storage-space.svelte delete mode 100644 web/src/lib/components/shared-components/side-bar/supporter-badge.svelte delete mode 100644 web/src/lib/components/shared-components/single-grid-row.svelte delete mode 100644 web/src/lib/components/shared-components/tree/breadcrumbs.svelte delete mode 100644 web/src/lib/components/shared-components/tree/tree-item-thumbnails.svelte delete mode 100644 web/src/lib/components/shared-components/tree/tree-items.svelte delete mode 100644 web/src/lib/components/shared-components/tree/tree.svelte delete mode 100644 web/src/lib/components/shared-components/upload-asset-preview.svelte delete mode 100644 web/src/lib/components/shared-components/upload-panel.svelte delete mode 100644 web/src/lib/components/sidebar/sidebar.spec.ts delete mode 100644 web/src/lib/components/sidebar/sidebar.svelte delete mode 100644 web/src/lib/components/user-settings-page/PinCodeChangeForm.svelte delete mode 100644 web/src/lib/components/user-settings-page/PinCodeCreateForm.svelte delete mode 100644 web/src/lib/components/user-settings-page/PinCodeInput.svelte delete mode 100644 web/src/lib/components/user-settings-page/PinCodeSettings.svelte delete mode 100644 web/src/lib/components/user-settings-page/download-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/feature-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/notifications-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/oauth-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/partner-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/user-purchase-settings.svelte delete mode 100644 web/src/lib/components/user-settings-page/user-usage-statistic.svelte delete mode 100644 web/src/lib/components/users/FeatureSetting.svelte delete mode 100644 web/src/lib/elements/DurationInput.svelte delete mode 100644 web/src/lib/elements/StarRating.svelte delete mode 100644 web/src/lib/elements/__test__/star-rating.spec.ts delete mode 100644 web/src/lib/managers/feature-flags-manager.svelte.ts delete mode 100644 web/src/lib/managers/queue-manager.svelte.ts delete mode 100644 web/src/lib/modals/AuthDisableLoginConfirmModal.svelte delete mode 100644 web/src/lib/modals/HelpAndFeedbackModal.svelte delete mode 100644 web/src/lib/modals/PasswordResetSuccessModal.svelte delete mode 100644 web/src/lib/modals/ServerAboutModal.svelte delete mode 100644 web/src/lib/modals/UserDeleteConfirmModal.svelte delete mode 100644 web/src/lib/modals/UserRestoreConfirmModal.svelte delete mode 100644 web/src/lib/modals/timezone-utils.ts delete mode 100644 web/src/lib/services/system-config.service.ts delete mode 100644 web/src/lib/services/user-admin.service.ts delete mode 100644 web/src/lib/stores/notification-manager.svelte.ts delete mode 100644 web/src/lib/utils/layout-utils.ts delete mode 100644 web/src/params/photos.ts delete mode 100644 web/src/routes/auth/onboarding/+page.svelte delete mode 100644 web/src/routes/auth/onboarding/+page.ts delete mode 100644 web/src/routes/auth/pin-prompt/+page.svelte delete mode 100644 web/src/routes/auth/pin-prompt/+page.ts delete mode 100644 web/src/service-worker/broadcast-channel.ts delete mode 100644 web/src/service-worker/cache.ts delete mode 100644 web/src/service-worker/index.ts delete mode 100644 web/src/service-worker/request.ts delete mode 100644 web/src/test-data/factories/asset-factory.ts diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index c6c2b3b51e..0000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "name": "Immich - Backend, Frontend and ML", - "service": "immich-server", - "runServices": [ - "immich-server", - "redis", - "database", - "immich-machine-learning" - ], - "dockerComposeFile": [ - "../docker/docker-compose.dev.yml", - "./server/container-compose-overrides.yml" - ], - "customizations": { - "vscode": { - "extensions": [ - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "svelte.svelte-vscode", - "ms-vscode-remote.remote-containers", - "foxundermoon.shell-format", - "timonwong.shellcheck", - "rvest.vs-code-prettier-eslint", - "bluebrown.yamlfmt", - "vkrishna04.cspell-sync", - "vitest.explorer", - "ms-playwright.playwright", - "ms-azuretools.vscode-docker" - ], - "settings": { - "tasks": { - "version": "2.0.0", - "tasks": [ - { - "label": "Fix Permissions, Install Dependencies", - "type": "shell", - "command": "[ -f /immich-devcontainer/container-start.sh ] && /immich-devcontainer/container-start.sh || exit 0", - "isBackground": true, - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "dedicated", - "showReuseMessage": true, - "clear": false, - "group": "Devcontainer tasks", - "close": true - }, - "runOptions": { - "runOn": "default" - }, - "problemMatcher": [] - }, - { - "label": "Immich API Server (Nest)", - "dependsOn": ["Fix Permissions, Install Dependencies"], - "type": "shell", - "command": "[ -f /immich-devcontainer/container-start-backend.sh ] && /immich-devcontainer/container-start-backend.sh || exit 0", - "isBackground": true, - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "dedicated", - "showReuseMessage": true, - "clear": false, - "group": "Devcontainer tasks", - "close": true - }, - "runOptions": { - "runOn": "folderOpen" - }, - "problemMatcher": [] - }, - { - "label": "Immich Web Server (Vite)", - "dependsOn": ["Fix Permissions, Install Dependencies"], - "type": "shell", - "command": "[ -f /immich-devcontainer/container-start-frontend.sh ] && /immich-devcontainer/container-start-frontend.sh || exit 0", - "isBackground": true, - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "dedicated", - "showReuseMessage": true, - "clear": false, - "group": "Devcontainer tasks", - "close": true - }, - "runOptions": { - "runOn": "folderOpen" - }, - "problemMatcher": [] - }, - { - "label": "Build Immich CLI", - "type": "shell", - "command": "pnpm --filter cli build:dev" - } - ] - } - } - } - }, - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - // https://github.com/devcontainers/features/issues/1466 - "moby": false - } - }, - "forwardPorts": [3000, 9231, 9230, 2283], - "portsAttributes": { - "3000": { - "label": "Immich - Frontend HTTP", - "description": "The frontend of the Immich project", - "onAutoForward": "openBrowserOnce" - }, - "2283": { - "label": "Immich - API Server - HTTP", - "description": "The API server of the Immich project" - }, - "9231": { - "label": "Immich - API Server - DEBUG", - "description": "The API server of the Immich project" - }, - "9230": { - "label": "Immich - Workers - DEBUG", - "description": "The workers of the Immich project" - } - }, - "overrideCommand": true, - "workspaceFolder": "/workspaces/immich", - "remoteUser": "node", - "userEnvProbe": "loginInteractiveShell", - "remoteEnv": { - // The location where your uploaded files are stored - "UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./library}", - // Connection secret for postgres. You should change it to a random password - // Please use only the characters `A-Za-z0-9`, without special characters or spaces - "DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}", - // The database username - "DB_USERNAME": "${localEnv:DB_USERNAME:postgres}", - // The database name - "DB_DATABASE_NAME": "${localEnv:DB_DATABASE_NAME:immich}" - } -} diff --git a/.devcontainer/mobile/container-compose-overrides.yml b/.devcontainer/mobile/container-compose-overrides.yml deleted file mode 100644 index 99e41cbece..0000000000 --- a/.devcontainer/mobile/container-compose-overrides.yml +++ /dev/null @@ -1,40 +0,0 @@ -services: - immich-server: - build: - target: dev-container-mobile - environment: - - IMMICH_SERVER_URL=http://127.0.0.1:2283/ - volumes: !override # bind mount host to /workspaces/immich - - ..:/workspaces/immich - - ${UPLOAD_LOCATION:-upload-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/data - - pnpm-store:/usr/src/app/.pnpm-store - - server-node_modules:/usr/src/app/server/node_modules - - web-node_modules:/usr/src/app/web/node_modules - - github-node_modules:/usr/src/app/.github/node_modules - - cli-node_modules:/usr/src/app/cli/node_modules - - docs-node_modules:/usr/src/app/docs/node_modules - - e2e-node_modules:/usr/src/app/e2e/node_modules - - sdk-node_modules:/usr/src/app/open-api/typescript-sdk/node_modules - - app-node_modules:/usr/src/app/node_modules - - sveltekit:/usr/src/app/web/.svelte-kit - - coverage:/usr/src/app/web/coverage - - /etc/localtime:/etc/localtime:ro - immich-web: - env_file: !reset [] - immich-machine-learning: - env_file: !reset [] - database: - env_file: !reset [] - environment: !override - POSTGRES_PASSWORD: ${DB_PASSWORD-postgres} - POSTGRES_USER: ${DB_USERNAME-postgres} - POSTGRES_DB: ${DB_DATABASE_NAME-immich} - POSTGRES_INITDB_ARGS: '--data-checksums' - POSTGRES_HOST_AUTH_METHOD: md5 - volumes: - - ${UPLOAD_LOCATION:-postgres-devcontainer-volume}${UPLOAD_LOCATION:+/postgres}:/var/lib/postgresql/data - redis: - env_file: !reset [] -volumes: - upload-devcontainer-volume: - postgres-devcontainer-volume: diff --git a/.devcontainer/mobile/devcontainer.json b/.devcontainer/mobile/devcontainer.json deleted file mode 100644 index 140a2ecac3..0000000000 --- a/.devcontainer/mobile/devcontainer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "Immich - Mobile", - "service": "immich-server", - "runServices": [ - "immich-server", - "redis", - "database", - "immich-machine-learning" - ], - "dockerComposeFile": [ - "../../docker/docker-compose.dev.yml", - "./container-compose-overrides.yml" - ], - "customizations": { - "vscode": { - "extensions": [ - "Dart-Code.dart-code", - "Dart-Code.flutter", - "dcmdev.dcm-vscode-extension", - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "svelte.svelte-vscode", - "ms-vscode-remote.remote-containers", - "foxundermoon.shell-format", - "timonwong.shellcheck", - "rvest.vs-code-prettier-eslint", - "bluebrown.yamlfmt", - "vkrishna04.cspell-sync", - "vitest.explorer", - "ms-playwright.playwright", - "ms-azuretools.vscode-docker" - ] - } - }, - "forwardPorts": [], - "overrideCommand": true, - "workspaceFolder": "/workspaces/immich", - "remoteUser": "node", - "userEnvProbe": "loginInteractiveShell", - "remoteEnv": { - // The location where your uploaded files are stored - "UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./library}", - // Connection secret for postgres. You should change it to a random password - // Please use only the characters `A-Za-z0-9`, without special characters or spaces - "DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}", - // The database username - "DB_USERNAME": "${localEnv:DB_USERNAME:postgres}", - // The database name - "DB_DATABASE_NAME": "${localEnv:DB_DATABASE_NAME:immich}" - } -} diff --git a/.devcontainer/server/container-common.sh b/.devcontainer/server/container-common.sh deleted file mode 100755 index 3aa72379c3..0000000000 --- a/.devcontainer/server/container-common.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -export IMMICH_PORT="${DEV_SERVER_PORT:-2283}" -export DEV_PORT="${DEV_PORT:-3000}" - -# search for immich directory inside workspace. -# /workspaces/immich is the bind mount, but other directories can be mounted if runing -# Devcontainer: Clone [repository|pull request] in container volumne -WORKSPACES_DIR="/workspaces" -IMMICH_DIR="$WORKSPACES_DIR/immich" -IMMICH_DEVCONTAINER_LOG="$HOME/immich-devcontainer.log" - -log() { - # Display command on console, log with timestamp to file - echo "$*" - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >>"$IMMICH_DEVCONTAINER_LOG" -} - -run_cmd() { - # Ensure log directory exists - mkdir -p "$(dirname "$IMMICH_DEVCONTAINER_LOG")" - - log "$@" - - # Execute command: display normally on console, log with timestamps to file - "$@" 2>&1 | tee >(while IFS= read -r line; do - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $line" >>"$IMMICH_DEVCONTAINER_LOG" - done) - - # Preserve exit status - return "${PIPESTATUS[0]}" -} - -# Find directories excluding /workspaces/immich -mapfile -t other_dirs < <(find "$WORKSPACES_DIR" -mindepth 1 -maxdepth 1 -type d ! -path "$IMMICH_DIR" ! -name ".*") - -if [ ${#other_dirs[@]} -gt 1 ]; then - log "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR." - exit 1 -elif [ ${#other_dirs[@]} -eq 1 ]; then - export IMMICH_WORKSPACE="${other_dirs[0]}" -else - export IMMICH_WORKSPACE="$IMMICH_DIR" -fi - -log "Found immich workspace in $IMMICH_WORKSPACE" -log "" - -fix_permissions() { - - log "Fixing permissions for ${IMMICH_WORKSPACE}" - - # Change ownership for directories that exist - for dir in "${IMMICH_WORKSPACE}/.vscode" \ - "${IMMICH_WORKSPACE}/server/upload" \ - "${IMMICH_WORKSPACE}/.pnpm-store" \ - "${IMMICH_WORKSPACE}/.github/node_modules" \ - "${IMMICH_WORKSPACE}/cli/node_modules" \ - "${IMMICH_WORKSPACE}/e2e/node_modules" \ - "${IMMICH_WORKSPACE}/open-api/typescript-sdk/node_modules" \ - "${IMMICH_WORKSPACE}/server/node_modules" \ - "${IMMICH_WORKSPACE}/server/dist" \ - "${IMMICH_WORKSPACE}/web/node_modules" \ - "${IMMICH_WORKSPACE}/web/dist"; do - if [ -d "$dir" ]; then - run_cmd sudo chown node -R "$dir" - fi - done - - log "" -} - -install_dependencies() { - - log "Installing dependencies" - ( - cd "${IMMICH_WORKSPACE}" || exit 1 - export CI=1 FROZEN=1 OFFLINE=1 - run_cmd make setup-web-dev setup-server-dev - ) - log "" -} diff --git a/.devcontainer/server/container-compose-overrides.yml b/.devcontainer/server/container-compose-overrides.yml deleted file mode 100644 index cc2b0c907b..0000000000 --- a/.devcontainer/server/container-compose-overrides.yml +++ /dev/null @@ -1,43 +0,0 @@ -services: - immich-server: - build: - target: dev-container-server - env_file: !reset [] - hostname: immich-dev - environment: - - IMMICH_SERVER_URL=http://127.0.0.1:2283/ - volumes: !override - - ..:/workspaces/immich - - ${UPLOAD_LOCATION:-upload-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/data - - /etc/localtime:/etc/localtime:ro - - pnpm-store:/usr/src/app/.pnpm-store - - server-node_modules:/usr/src/app/server/node_modules - - web-node_modules:/usr/src/app/web/node_modules - - github-node_modules:/usr/src/app/.github/node_modules - - cli-node_modules:/usr/src/app/cli/node_modules - - docs-node_modules:/usr/src/app/docs/node_modules - - e2e-node_modules:/usr/src/app/e2e/node_modules - - sdk-node_modules:/usr/src/app/open-api/typescript-sdk/node_modules - - app-node_modules:/usr/src/app/node_modules - - sveltekit:/usr/src/app/web/.svelte-kit - - coverage:/usr/src/app/web/coverage - - ../plugins:/build/corePlugin - immich-web: - env_file: !reset [] - immich-machine-learning: - env_file: !reset [] - database: - env_file: !reset [] - environment: !override - POSTGRES_PASSWORD: ${DB_PASSWORD-postgres} - POSTGRES_USER: ${DB_USERNAME-postgres} - POSTGRES_DB: ${DB_DATABASE_NAME-immich} - POSTGRES_INITDB_ARGS: '--data-checksums' - POSTGRES_HOST_AUTH_METHOD: md5 - volumes: - - ${UPLOAD_LOCATION:-postgres-devcontainer-volume}${UPLOAD_LOCATION:+/postgres}:/var/lib/postgresql/data - redis: - env_file: !reset [] -volumes: - upload-devcontainer-volume: - postgres-devcontainer-volume: diff --git a/.devcontainer/server/container-start-backend.sh b/.devcontainer/server/container-start-backend.sh deleted file mode 100755 index 35fa60f89b..0000000000 --- a/.devcontainer/server/container-start-backend.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# shellcheck source=common.sh -# shellcheck disable=SC1091 -source /immich-devcontainer/container-common.sh - -log "Preparing Immich Nest API Server" -log "" -export CI=1 -run_cmd pnpm --filter immich install - -log "Starting Nest API Server" -log "" -cd "${IMMICH_WORKSPACE}/server" || ( - log "Immich workspace not found" - exit 1 -) - -while true; do - run_cmd pnpm --filter immich exec nest start --debug "0.0.0.0:9230" --watch - log "Nest API Server crashed with exit code $?. Respawning in 3s ..." - sleep 3 -done diff --git a/.devcontainer/server/container-start-frontend.sh b/.devcontainer/server/container-start-frontend.sh deleted file mode 100755 index 9a0d617d41..0000000000 --- a/.devcontainer/server/container-start-frontend.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# shellcheck source=common.sh -# shellcheck disable=SC1091 -source /immich-devcontainer/container-common.sh - -export CI=1 -log "Preparing Immich Web Frontend" -log "" -run_cmd pnpm --filter @immich/sdk install -run_cmd pnpm --filter @immich/sdk build -run_cmd pnpm --filter immich-web install - -log "Starting Immich Web Frontend" -log "" -cd "${IMMICH_WORKSPACE}/web" || ( - log "Immich Workspace not found" - exit 1 -) - -until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_PORT}/api/server/config"; do - log "Waiting for api server..." - sleep 1 -done - -while true; do - run_cmd pnpm --filter immich-web exec vite dev --host 0.0.0.0 --port "${DEV_PORT}" - log "Web crashed with exit code $?. Respawning in 3s ..." - sleep 3 -done diff --git a/.devcontainer/server/container-start.sh b/.devcontainer/server/container-start.sh deleted file mode 100755 index 0edd38172e..0000000000 --- a/.devcontainer/server/container-start.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# shellcheck source=common.sh -# shellcheck disable=SC1091 -source /immich-devcontainer/container-common.sh - -log "Setting up Immich dev container..." -fix_permissions - -log "Setup complete, please wait while backend and frontend services automatically start" -log -log "If necessary, the services may be manually started using" -log -log "$ /immich-devcontainer/container-start-backend.sh" -log "$ /immich-devcontainer/container-start-frontend.sh" -log -log "From different terminal windows, as these scripts automatically restart the server" -log "on error, and will continuously run in a loop" diff --git a/.env.example b/.env.example index 0a443884a1..4dbd8797e5 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ # Database DB_HOSTNAME=localhost -DB_PORT=5432 +DB_PORT=5435 DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=app diff --git a/.github/.nvmrc b/.github/.nvmrc deleted file mode 100644 index 3fe3b1570a..0000000000 --- a/.github/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -24.13.0 diff --git a/.github/.prettierignore b/.github/.prettierignore deleted file mode 100644 index cc41cea9b2..0000000000 --- a/.github/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock diff --git a/.github/DISCUSSION_TEMPLATE/feature-request.yaml b/.github/DISCUSSION_TEMPLATE/feature-request.yaml deleted file mode 100644 index 2c7492fd5b..0000000000 --- a/.github/DISCUSSION_TEMPLATE/feature-request.yaml +++ /dev/null @@ -1,33 +0,0 @@ -title: '[Feature] feature-name-goes-here' -labels: ['feature'] - -body: - - type: markdown - attributes: - value: | - Please use this form to request new feature for Immich. - Stick to only a single feature per request. If you list multiple different features at once, - your request will be closed. - - - type: checkboxes - attributes: - label: I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request. - options: - - label: 'Yes' - - - type: textarea - id: feature - attributes: - label: The feature - validations: - required: true - - - type: checkboxes - validations: - required: true - attributes: - label: Platform - options: - - label: Server - - label: Web - - label: Mobile diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index acbb7c785b..0000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: ['https://buy.immich.app', 'https://immich.store'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml deleted file mode 100644 index 9ed1be3655..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: Report an issue with Immich -description: Report an issue with Immich -body: - - type: checkboxes - attributes: - label: I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - options: - - label: 'Yes' - - - type: markdown - attributes: - value: | - This issue form is for reporting bugs only! - - If you have a feature or enhancement request, please use the [feature request][fr] section of our [GitHub Discussions][fr]. - - [fr]: https://github.com/immich-app/immich/discussions/new?category=feature-request - - - type: textarea - validations: - required: true - attributes: - label: The bug - description: >- - Describe the issue you are experiencing here, to communicate to the - maintainers. Tell us what you were trying to do and what happened. - - Provide a clear and concise description of what the problem is. - - - type: markdown - attributes: - value: | - ## Environment - - - type: input - validations: - required: true - attributes: - label: The OS that Immich Server is running on - placeholder: Ubuntu 22.10, Debian, Arch...etc - - - type: input - id: version - validations: - required: true - attributes: - label: Version of Immich Server - placeholder: v1.0.0 - - - type: input - validations: - required: true - attributes: - label: Version of Immich Mobile App - placeholder: v1.0.0 - - - type: checkboxes - validations: - required: true - attributes: - label: Platform with the issue - options: - - label: Server - - label: Web - - label: Mobile - - - type: input - attributes: - label: Device make and model - placeholder: Samsung S25 Android 16 - - - type: textarea - validations: - required: true - attributes: - label: Your docker-compose.yml content - render: YAML - - - type: textarea - validations: - required: true - attributes: - label: Your .env content - description: Please provide the redacted .env content of your setup - render: Shell - - - type: textarea - id: repro - attributes: - label: Reproduction steps - description: 'How do you trigger this bug? Please walk us through it step by step.' - value: | - 1. - 2. - 3. - ... - validations: - required: true - - - type: textarea - id: logs - attributes: - label: Relevant log output - description: - Please copy and paste any relevant logs below. (code formatting is - enabled, no need for backticks) - render: shell - validations: - required: false - - - type: textarea - attributes: - label: Additional information - description: > - If you have any additional information for us, use the field below. - - - type: markdown - attributes: - value: Thank you for submitting the form diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 0b0cfbafd9..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,14 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: ✋ I have a question or need support - url: https://discord.immich.app - about: We use GitHub for tracking bugs, please check out our Discord channel for freaky fast support. - - name: 📷 My photo or video has a date, time, or timezone problem - url: https://github.com/immich-app/immich/discussions/12650 - about: Upload a sample file to this discussion and we will take a look - - name: 🌟 Feature request - url: https://github.com/immich-app/immich/discussions/new?category=feature-request - about: Please use our GitHub Discussion for making feature requests. - - name: 🫣 I'm unsure where to go - url: https://discord.immich.app - about: If you are unsure where to go, then joining our Discord is recommended; Just ask! diff --git a/.github/PULL_REQUEST_TEMPLATE/config.yml b/.github/PULL_REQUEST_TEMPLATE/config.yml deleted file mode 100644 index 4172e3df95..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_pull_request_template_enabled: false diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index d0e4a3097b..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,37 +0,0 @@ -cli: - - changed-files: - - any-glob-to-any-file: - - cli/src/** - -documentation: - - changed-files: - - any-glob-to-any-file: - - docs/docs/** - - docs/src/** - - docs/static/** - -🖥️web: - - changed-files: - - any-glob-to-any-file: - - web/src/** - - web/static/** - -📱mobile: - - changed-files: - - any-glob-to-any-file: - - mobile/lib/** - - mobile/test/** - -🗄️server: - - changed-files: - - any-glob-to-any-file: - - server/src/** - - server/test/** - -🧠machine-learning: - - changed-files: - - any-glob-to-any-file: - - machine-learning/** - -changelog:translation: - - head-branch: ['^chore/translations$'] diff --git a/.github/mise.toml b/.github/mise.toml deleted file mode 100644 index 6930d41187..0000000000 --- a/.github/mise.toml +++ /dev/null @@ -1,10 +0,0 @@ -[tasks.install] -run = "pnpm install --filter github --frozen-lockfile" - -[tasks.format] -env._.path = "./node_modules/.bin" -run = "prettier --check ." - -[tasks."format-fix"] -env._.path = "./node_modules/.bin" -run = "prettier --write ." diff --git a/.github/package.json b/.github/package.json deleted file mode 100644 index 9b41cc7b4e..0000000000 --- a/.github/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "scripts": { - "format": "prettier --check .", - "format:fix": "prettier --write ." - }, - "devDependencies": { - "prettier": "^3.7.4" - } -} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 0bd3b30814..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,40 +0,0 @@ -## Description - - - - - -Fixes # (issue) - -## How Has This Been Tested? - - - -- [ ] Test A -- [ ] Test B - -

Screenshots (if appropriate)

- - - -
- - - -## Checklist: - -- [ ] I have performed a self-review of my own code -- [ ] I have made corresponding changes to the documentation if applicable -- [ ] I have no unrelated changes in the PR. -- [ ] I have confirmed that any new dependencies are strictly necessary. -- [ ] I have written tests for new code (if applicable) -- [ ] I have followed naming conventions/patterns in the surrounding code -- [ ] All code in `src/services/` uses repositories implementations for database calls, filesystem operations, etc. -- [ ] All code in `src/repositories/` is pretty basic/simple and does not have any immich specific logic (that belongs in `src/services/`) - -## Please describe to which degree, if any, an LLM was used in creating this pull request. - -... diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 108daaf40f..0000000000 --- a/.github/release.yml +++ /dev/null @@ -1,33 +0,0 @@ -changelog: - categories: - - title: 🚨 Breaking Changes - labels: - - changelog:breaking-change - - - title: 🫥 Deprecated Changes - labels: - - changelog:deprecated - - - title: 🔒 Security - labels: - - changelog:security - - - title: 🚀 Features - labels: - - changelog:feature - - - title: 🌟 Enhancements - labels: - - changelog:enhancement - - - title: 🐛 Bug fixes - labels: - - changelog:bugfix - - - title: 📚 Documentation - labels: - - changelog:documentation - - - title: 🌐 Translations - labels: - - changelog:translation diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.yml deleted file mode 100644 index b8ce6387af..0000000000 --- a/.github/workflows/build-mobile.yml +++ /dev/null @@ -1,297 +0,0 @@ -name: Build Mobile - -on: - workflow_call: - inputs: - ref: - required: false - type: string - environment: - description: 'Target environment' - required: true - default: 'development' - type: string - secrets: - KEY_JKS: - required: true - ALIAS: - required: true - ANDROID_KEY_PASSWORD: - required: true - ANDROID_STORE_PASSWORD: - required: true - APP_STORE_CONNECT_API_KEY_ID: - required: true - APP_STORE_CONNECT_API_KEY_ISSUER_ID: - required: true - APP_STORE_CONNECT_API_KEY: - required: true - IOS_CERTIFICATE_P12: - required: true - IOS_CERTIFICATE_PASSWORD: - required: true - FASTLANE_TEAM_ID: - required: true - pull_request: - push: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - mobile: - - 'mobile/**' - force-filters: | - - '.github/workflows/build-mobile.yml' - force-events: 'workflow_call,workflow_dispatch' - - build-sign-android: - name: Build and sign Android - needs: pre-job - permissions: - contents: read - # Skip when PR from a fork - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && fromJSON(needs.pre-job.outputs.should_run).mobile == true }} - runs-on: mich - - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - ref: ${{ inputs.ref || github.sha }} - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Create the Keystore - env: - KEY_JKS: ${{ secrets.KEY_JKS }} - working-directory: ./mobile - run: printf "%s" $KEY_JKS | base64 -d > android/key.jks - - - uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 - with: - distribution: 'zulu' - java-version: '17' - - - name: Restore Gradle Cache - id: cache-gradle-restore - uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - ~/.android/sdk - mobile/android/.gradle - mobile/.dart_tool - key: build-mobile-gradle-${{ runner.os }}-main - - - name: Setup Flutter SDK - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 - with: - channel: 'stable' - flutter-version-file: ./mobile/pubspec.yaml - cache: true - - - name: Setup Android SDK - uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 - with: - packages: '' - - - name: Get Packages - working-directory: ./mobile - run: flutter pub get - - - name: Generate translation file - run: dart run easy_localization:generate -S ../i18n && dart run bin/generate_keys.dart - working-directory: ./mobile - - - name: Generate platform APIs - run: make pigeon - working-directory: ./mobile - - - name: Build Android App Bundle - working-directory: ./mobile - env: - ALIAS: ${{ secrets.ALIAS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} - ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} - IS_MAIN: ${{ github.ref == 'refs/heads/main' }} - run: | - if [[ $IS_MAIN == 'true' ]]; then - flutter build apk --release - flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64 - else - flutter build apk --debug --split-per-abi --target-platform android-arm64 - fi - - - name: Publish Android Artifact - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: release-apk-signed - path: mobile/build/app/outputs/flutter-apk/*.apk - - - name: Save Gradle Cache - id: cache-gradle-save - uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - if: github.ref == 'refs/heads/main' - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - ~/.android/sdk - mobile/android/.gradle - mobile/.dart_tool - key: ${{ steps.cache-gradle-restore.outputs.cache-primary-key }} - - build-sign-ios: - name: Build and sign iOS - needs: pre-job - permissions: - contents: read - # Run on main branch or workflow_dispatch, or on PRs/other branches (build only, no upload) - if: ${{ !github.event.pull_request.head.repo.fork && fromJSON(needs.pre-job.outputs.should_run).mobile == true }} - runs-on: macos-15 - - steps: - - name: Select Xcode 26 - run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - with: - ref: ${{ inputs.ref || github.sha }} - persist-credentials: false - - - name: Setup Flutter SDK - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2 - with: - channel: 'stable' - flutter-version-file: ./mobile/pubspec.yaml - cache: true - - - name: Install Flutter dependencies - working-directory: ./mobile - run: flutter pub get - - - name: Generate translation files - run: dart run easy_localization:generate -S ../i18n && dart run bin/generate_keys.dart - working-directory: ./mobile - - - name: Generate platform APIs - run: make pigeon - working-directory: ./mobile - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - working-directory: ./mobile/ios - - - name: Install CocoaPods dependencies - working-directory: ./mobile/ios - run: | - pod install - - - name: Create API Key - env: - API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - working-directory: ./mobile/ios - run: | - mkdir -p ~/.appstoreconnect/private_keys - echo "$API_KEY_CONTENT" | base64 --decode > ~/.appstoreconnect/private_keys/AuthKey_${API_KEY_ID}.p8 - - - name: Import Certificate - env: - IOS_CERTIFICATE_P12: ${{ secrets.IOS_CERTIFICATE_P12 }} - working-directory: ./mobile/ios - run: | - # Decode certificate - echo "$IOS_CERTIFICATE_P12" | base64 --decode > certificate.p12 - - - name: Create keychain and import certificate - env: - KEYCHAIN_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - working-directory: ./mobile/ios - run: | - # Create keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain - security set-keychain-settings -t 3600 -u build.keychain - - # Import certificate - security import certificate.p12 -k build.keychain -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security - security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" build.keychain - - # Verify certificate was imported - security find-identity -v -p codesigning build.keychain - - - name: Build and deploy to TestFlight - env: - FASTLANE_TEAM_ID: ${{ secrets.FASTLANE_TEAM_ID }} - IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - KEYCHAIN_NAME: build.keychain - KEYCHAIN_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - ENVIRONMENT: ${{ inputs.environment || 'development' }} - BUNDLE_ID_SUFFIX: ${{ inputs.environment == 'production' && '' || 'development' }} - GITHUB_REF: ${{ github.ref }} - FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120 - FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 6 - working-directory: ./mobile/ios - run: | - # Only upload to TestFlight on main branch - if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then - if [[ "$ENVIRONMENT" == "development" ]]; then - bundle exec fastlane gha_testflight_dev - else - bundle exec fastlane gha_release_prod - fi - else - # Build only, no TestFlight upload for non-main branches - bundle exec fastlane gha_build_only - fi - - - name: Clean up keychain - if: always() - run: | - security delete-keychain build.keychain || true - - - name: Upload IPA artifact - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: ios-release-ipa - path: mobile/ios/Runner.ipa diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml deleted file mode 100644 index 55f91e7989..0000000000 --- a/.github/workflows/cache-cleanup.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Cache Cleanup -on: - pull_request: - types: - - closed - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - cleanup: - name: Cleanup - runs-on: ubuntu-latest - permissions: - contents: read - actions: write - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check out code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Cleanup - env: - GH_TOKEN: ${{ steps.token.outputs.token }} - REF: ${{ github.ref }} - run: | - gh extension install actions/gh-actions-cache - - REPO=${{ github.repository }} - - echo "Fetching list of cache keys" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B ${REF} -L 100 | cut -f 1 ) - - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - gh actions-cache delete $cacheKey -R "$REPO" -B "${REF}" --confirm - done - echo "Done" diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml deleted file mode 100644 index 3591539b68..0000000000 --- a/.github/workflows/cli.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: CLI Build -on: - push: - branches: [main] - paths: - - 'cli/**' - - '.github/workflows/cli.yml' - pull_request: - paths: - - 'cli/**' - - '.github/workflows/cli.yml' - release: - types: [published] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - publish: - name: CLI Publish - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - packages: write - defaults: - run: - working-directory: ./cli - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './cli/.nvmrc' - registry-url: 'https://registry.npmjs.org' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - - name: Setup typescript-sdk - run: pnpm install && pnpm run build - working-directory: ./open-api/typescript-sdk - - - run: pnpm install --frozen-lockfile - - run: pnpm build - - run: pnpm publish --provenance --no-git-checks - if: ${{ github.event_name == 'release' }} - - docker: - name: Docker - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - needs: publish - - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - - - name: Login to GitHub Container Registry - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 - if: ${{ !github.event.pull_request.head.repo.fork }} - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get package version - id: package-version - run: | - version=$(jq -r '.version' cli/package.json) - echo "version=$version" >> "$GITHUB_OUTPUT" - - - name: Generate docker image tags - id: metadata - uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 - with: - flavor: | - latest=false - images: | - name=ghcr.io/${{ github.repository_owner }}/immich-cli - tags: | - type=raw,value=${{ steps.package-version.outputs.version }},enable=${{ github.event_name == 'release' }} - type=raw,value=latest,enable=${{ github.event_name == 'release' }} - - - name: Build and push image - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 - with: - file: cli/Dockerfile - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name == 'release' }} - cache-from: type=gha - cache-to: type=gha,mode=max - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} diff --git a/.github/workflows/close-duplicates.yml b/.github/workflows/close-duplicates.yml deleted file mode 100644 index 09e9dbb338..0000000000 --- a/.github/workflows/close-duplicates.yml +++ /dev/null @@ -1,107 +0,0 @@ -on: - issues: - types: [opened] - discussion: - types: [created] - -name: Close likely duplicates -permissions: {} - -jobs: - should_run: - runs-on: ubuntu-latest - outputs: - should_run: ${{ steps.should_run.outputs.run }} - steps: - - id: should_run - run: echo "run=${{ github.event_name == 'issues' || github.event.discussion.category.name == 'Feature Request' }}" >> $GITHUB_OUTPUT - - get_body: - runs-on: ubuntu-latest - needs: should_run - if: ${{ needs.should_run.outputs.should_run == 'true' }} - env: - EVENT: ${{ toJSON(github.event) }} - outputs: - body: ${{ steps.get_body.outputs.body }} - steps: - - id: get_body - run: | - BODY=$(echo """$EVENT""" | jq -r '.issue // .discussion | .body' | base64 -w 0) - echo "body=$BODY" >> $GITHUB_OUTPUT - - get_checkbox_json: - runs-on: ubuntu-latest - needs: [get_body, should_run] - if: ${{ needs.should_run.outputs.should_run == 'true' }} - container: - image: ghcr.io/immich-app/mdq:main@sha256:ab9f163cd5d5cec42704a26ca2769ecf3f10aa8e7bae847f1d527cdf075946e6 - outputs: - checked: ${{ steps.get_checkbox.outputs.checked }} - steps: - - id: get_checkbox - env: - BODY: ${{ needs.get_body.outputs.body }} - run: | - CHECKED=$(echo "$BODY" | base64 -d | /mdq --output json '# I have searched | - [?] Yes' | jq '.items[0].list[0].checked // false') - echo "checked=$CHECKED" >> $GITHUB_OUTPUT - - close_and_comment: - runs-on: ubuntu-latest - needs: [get_checkbox_json, should_run] - if: ${{ needs.should_run.outputs.should_run == 'true' && needs.get_checkbox_json.outputs.checked != 'true' }} - permissions: - issues: write - discussions: write - steps: - - name: Close issue - if: ${{ github.event_name == 'issues' }} - env: - GH_TOKEN: ${{ github.token }} - NODE_ID: ${{ github.event.issue.node_id }} - run: | - gh api graphql \ - -f issueId="$NODE_ID" \ - -f body="This issue has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary." \ - -f query=' - mutation CommentAndCloseIssue($issueId: ID!, $body: String!) { - addComment(input: { - subjectId: $issueId, - body: $body - }) { - __typename - } - - closeIssue(input: { - issueId: $issueId, - stateReason: DUPLICATE - }) { - __typename - } - }' - - - name: Close discussion - if: ${{ github.event_name == 'discussion' && github.event.discussion.category.name == 'Feature Request' }} - env: - GH_TOKEN: ${{ github.token }} - NODE_ID: ${{ github.event.discussion.node_id }} - run: | - gh api graphql \ - -f discussionId="$NODE_ID" \ - -f body="This discussion has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary." \ - -f query=' - mutation CommentAndCloseDiscussion($discussionId: ID!, $body: String!) { - addDiscussionComment(input: { - discussionId: $discussionId, - body: $body - }) { - __typename - } - - closeDiscussion(input: { - discussionId: $discussionId, - reason: DUPLICATE - }) { - __typename - } - }' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 71b5968960..0000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,88 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: 'CodeQL' - -on: - push: - branches: ['main'] - pull_request: - # The branches below must be a subset of the branches above - branches: ['main'] - schedule: - - cron: '20 13 * * 1' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ['javascript', 'python'] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9 - with: - category: '/language:${{matrix.language}}' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index e27f1ebdf9..0000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,194 +0,0 @@ -name: Docker - -on: - workflow_dispatch: - push: - branches: [main] - pull_request: - release: - types: [published] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - server: - - 'server/**' - - 'openapi/**' - - 'web/**' - - 'i18n/**' - machine-learning: - - 'machine-learning/**' - force-filters: | - - '.github/workflows/docker.yml' - - '.github/workflows/multi-runner-build.yml' - - '.github/actions/image-build' - force-events: 'workflow_dispatch,release' - - retag_ml: - name: Re-Tag ML - needs: pre-job - permissions: - contents: read - packages: write - if: ${{ fromJSON(needs.pre-job.outputs.should_run).machine-learning == false && !github.event.pull_request.head.repo.fork }} - runs-on: ubuntu-latest - strategy: - matrix: - suffix: ['', '-cuda', '-rocm', '-openvino', '-armnn', '-rknn'] - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Re-tag image - env: - REGISTRY_NAME: 'ghcr.io' - REPOSITORY: ${{ github.repository_owner }}/immich-machine-learning - TAG_OLD: main${{ matrix.suffix }} - TAG_PR: ${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }} - TAG_COMMIT: commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }} - run: | - docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_PR}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}" - docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_COMMIT}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}" - - retag_server: - name: Re-Tag Server - needs: pre-job - permissions: - contents: read - packages: write - if: ${{ fromJSON(needs.pre-job.outputs.should_run).server == false && !github.event.pull_request.head.repo.fork }} - runs-on: ubuntu-latest - strategy: - matrix: - suffix: [''] - steps: - - name: Login to GitHub Container Registry - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Re-tag image - env: - REGISTRY_NAME: 'ghcr.io' - REPOSITORY: ${{ github.repository_owner }}/immich-server - TAG_OLD: main${{ matrix.suffix }} - TAG_PR: ${{ github.event.number == 0 && github.ref_name || format('pr-{0}', github.event.number) }}${{ matrix.suffix }} - TAG_COMMIT: commit-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}${{ matrix.suffix }} - run: | - docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_PR}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}" - docker buildx imagetools create -t "${REGISTRY_NAME}/${REPOSITORY}:${TAG_COMMIT}" "${REGISTRY_NAME}/${REPOSITORY}:${TAG_OLD}" - - machine-learning: - name: Build and Push ML - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).machine-learning == true }} - strategy: - fail-fast: false - matrix: - include: - - device: cpu - - device: cuda - suffixes: '-cuda' - platforms: linux/amd64 - - device: openvino - suffixes: '-openvino' - platforms: linux/amd64 - - device: armnn - suffixes: '-armnn' - platforms: linux/arm64 - - device: rknn - suffixes: '-rknn' - platforms: linux/arm64 - - device: rocm - suffixes: '-rocm' - platforms: linux/amd64 - runner-mapping: '{"linux/amd64": "mich"}' - uses: immich-app/devtools/.github/workflows/multi-runner-build.yml@0477486d82313fba68f7c82c034120a4b8981297 # multi-runner-build-workflow-v2.1.0 - permissions: - contents: read - actions: read - packages: write - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - with: - image: immich-machine-learning - context: machine-learning - dockerfile: machine-learning/Dockerfile - platforms: ${{ matrix.platforms }} - runner-mapping: ${{ matrix.runner-mapping }} - suffixes: ${{ matrix.suffixes }} - dockerhub-push: ${{ github.event_name == 'release' }} - build-args: | - DEVICE=${{ matrix.device }} - - server: - name: Build and Push Server - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).server == true }} - uses: immich-app/devtools/.github/workflows/multi-runner-build.yml@0477486d82313fba68f7c82c034120a4b8981297 # multi-runner-build-workflow-v2.1.0 - permissions: - contents: read - actions: read - packages: write - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - with: - image: immich-server - context: . - dockerfile: server/Dockerfile - dockerhub-push: ${{ github.event_name == 'release' }} - build-args: | - DEVICE=cpu - - success-check-server: - name: Docker Build & Push Server Success - needs: [server, retag_server] - permissions: {} - runs-on: ubuntu-latest - if: always() - steps: - - uses: immich-app/devtools/actions/success-check@68f10eb389bb02a3cf9d1156111964c549eb421b # 0.0.4 - with: - needs: ${{ toJSON(needs) }} - - success-check-ml: - name: Docker Build & Push ML Success - needs: [machine-learning, retag_ml] - permissions: {} - runs-on: ubuntu-latest - if: always() - steps: - - uses: immich-app/devtools/actions/success-check@68f10eb389bb02a3cf9d1156111964c549eb421b # 0.0.4 - with: - needs: ${{ toJSON(needs) }} diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml deleted file mode 100644 index 91916e4ed2..0000000000 --- a/.github/workflows/docs-build.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Docs build -on: - push: - branches: [main] - pull_request: - release: - types: [published] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - docs: - - 'docs/**' - open-api: - - 'open-api/immich-openapi-specs.json' - force-filters: | - - '.github/workflows/docs-build.yml' - force-events: 'release' - force-branches: 'main' - - build: - name: Docs Build - needs: pre-job - permissions: - contents: read - if: ${{ fromJSON(needs.pre-job.outputs.should_run).docs == true }} - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./docs - - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - fetch-depth: 0 - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './docs/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - - name: Run install - run: pnpm install - - - name: Check formatting - run: pnpm format - - - name: Run build - run: pnpm build - - - name: Upload build output - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: docs-build-output - path: docs/build/ - include-hidden-files: true - retention-days: 1 diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml deleted file mode 100644 index 8c0bf76f30..0000000000 --- a/.github/workflows/docs-deploy.yml +++ /dev/null @@ -1,225 +0,0 @@ -name: Docs deploy -on: - workflow_run: # zizmor: ignore[dangerous-triggers] no attacker inputs are used here - workflows: ['Docs build'] - types: - - completed - -env: - TG_NON_INTERACTIVE: 'true' - -jobs: - checks: - name: Docs Deploy Checks - runs-on: ubuntu-latest - permissions: - actions: read - pull-requests: read - outputs: - parameters: ${{ steps.parameters.outputs.result }} - artifact: ${{ steps.get-artifact.outputs.result }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - if: ${{ github.event.workflow_run.conclusion != 'success' }} - run: echo 'The triggering workflow did not succeed' && exit 1 - - name: Get artifact - id: get-artifact - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "docs-build-output" - })[0]; - if (!matchArtifact) { - console.log("No artifact found with the name docs-build-output, build job was skipped") - return { found: false }; - } - return { found: true, id: matchArtifact.id }; - - name: Determine deploy parameters - id: parameters - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - HEAD_SHA: ${{ github.event.workflow_run.head_sha }} - with: - github-token: ${{ steps.token.outputs.token }} - script: | - const eventType = context.payload.workflow_run.event; - const isFork = context.payload.workflow_run.repository.fork; - - let parameters; - - console.log({eventType, isFork}); - - if (eventType == "push") { - const branch = context.payload.workflow_run.head_branch; - console.log({branch}); - const shouldDeploy = !isFork && branch == "main"; - parameters = { - event: "branch", - name: "main", - shouldDeploy - }; - } else if (eventType == "pull_request") { - let pull_number = context.payload.workflow_run.pull_requests[0]?.number; - if(!pull_number) { - const {HEAD_SHA} = process.env; - const response = await github.rest.search.issuesAndPullRequests({q: `repo:${{ github.repository }} is:pr sha:${HEAD_SHA}`,per_page: 1,}) - const items = response.data.items - if (items.length < 1) { - throw new Error("No pull request found for the commit") - } - const pullRequestNumber = items[0].number - console.info("Pull request number is", pullRequestNumber) - pull_number = pullRequestNumber - } - const {data: pr} = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number - }); - - console.log({pull_number}); - - parameters = { - event: "pr", - name: `pr-${pull_number}`, - pr_number: pull_number, - shouldDeploy: true - }; - } else if (eventType == "release") { - parameters = { - event: "release", - name: context.payload.workflow_run.head_branch, - shouldDeploy: !isFork - }; - } - - console.log(parameters); - return parameters; - - deploy: - name: Docs Deploy - runs-on: ubuntu-latest - needs: checks - permissions: - contents: read - actions: read - pull-requests: write - if: ${{ fromJson(needs.checks.outputs.artifact).found && fromJson(needs.checks.outputs.parameters).shouldDeploy }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup Mise - uses: immich-app/devtools/actions/use-mise@cd24790a7f5f6439ac32cc94f5523cb2de8bfa8c # use-mise-action-v1.1.0 - - - name: Load parameters - id: parameters - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - PARAM_JSON: ${{ needs.checks.outputs.parameters }} - with: - github-token: ${{ steps.token.outputs.token }} - script: | - const parameters = JSON.parse(process.env.PARAM_JSON); - core.setOutput("event", parameters.event); - core.setOutput("name", parameters.name); - core.setOutput("shouldDeploy", parameters.shouldDeploy); - - - name: Download artifact - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - ARTIFACT_JSON: ${{ needs.checks.outputs.artifact }} - with: - github-token: ${{ steps.token.outputs.token }} - script: | - let artifact = JSON.parse(process.env.ARTIFACT_JSON); - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/docs-build-output.zip`, Buffer.from(download.data)); - - - name: Unzip artifact - run: unzip "${{ github.workspace }}/docs-build-output.zip" -d "${{ github.workspace }}/docs/build" - - - name: Deploy Docs Subdomain - env: - TF_VAR_prefix_name: ${{ steps.parameters.outputs.name}} - TF_VAR_prefix_event_type: ${{ steps.parameters.outputs.event }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }} - working-directory: 'deployment/modules/cloudflare/docs' - run: 'mise run //deployment:tf apply' - - - name: Deploy Docs Subdomain Output - id: docs-output - env: - TF_VAR_prefix_name: ${{ steps.parameters.outputs.name}} - TF_VAR_prefix_event_type: ${{ steps.parameters.outputs.event }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }} - working-directory: 'deployment/modules/cloudflare/docs' - run: | - mise run //deployment:tf output -- -json | jq -r ' - "projectName=\(.pages_project_name.value)", - "subdomain=\(.immich_app_branch_subdomain.value)" - ' >> $GITHUB_OUTPUT - - - name: Publish to Cloudflare Pages - # TODO: Action is deprecated - uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_PAGES_UPLOAD }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: ${{ steps.docs-output.outputs.projectName }} - workingDirectory: 'docs' - directory: 'build' - branch: ${{ steps.parameters.outputs.name }} - wranglerVersion: '3' - - - name: Deploy Docs Release Domain - if: ${{ steps.parameters.outputs.event == 'release' }} - env: - TF_VAR_prefix_name: ${{ steps.parameters.outputs.name}} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }} - working-directory: 'deployment/modules/cloudflare/docs-release' - run: 'mise run //deployment:tf apply' - - - name: Comment - uses: actions-cool/maintain-one-comment@4b2dbf086015f892dcb5e8c1106f5fccd6c1476b # v3.2.0 - if: ${{ steps.parameters.outputs.event == 'pr' }} - with: - token: ${{ steps.token.outputs.token }} - number: ${{ fromJson(needs.checks.outputs.parameters).pr_number }} - body: | - 📖 Documentation deployed to [${{ steps.docs-output.outputs.subdomain }}](https://${{ steps.docs-output.outputs.subdomain }}) - emojis: 'rocket' - body-include: '' diff --git a/.github/workflows/docs-destroy.yml b/.github/workflows/docs-destroy.yml deleted file mode 100644 index a7d068cb43..0000000000 --- a/.github/workflows/docs-destroy.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Docs destroy -on: - pull_request_target: # zizmor: ignore[dangerous-triggers] no attacker inputs are used here - types: [closed] - -permissions: {} - -env: - TG_NON_INTERACTIVE: 'true' - -jobs: - deploy: - name: Docs Destroy - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup Mise - uses: immich-app/devtools/actions/use-mise@cd24790a7f5f6439ac32cc94f5523cb2de8bfa8c # use-mise-action-v1.1.0 - - - name: Destroy Docs Subdomain - env: - TF_VAR_prefix_name: 'pr-${{ github.event.number }}' - TF_VAR_prefix_event_type: 'pr' - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - TF_STATE_POSTGRES_CONN_STR: ${{ secrets.TF_STATE_POSTGRES_CONN_STR }} - working-directory: 'deployment/modules/cloudflare/docs' - run: 'mise run //deployment:tf destroy -- -refresh=false' - - - name: Comment - uses: actions-cool/maintain-one-comment@4b2dbf086015f892dcb5e8c1106f5fccd6c1476b # v3.2.0 - with: - token: ${{ steps.token.outputs.token }} - number: ${{ github.event.number }} - delete: true - body-include: '' diff --git a/.github/workflows/fix-format.yml b/.github/workflows/fix-format.yml deleted file mode 100644 index 11a9ef06e4..0000000000 --- a/.github/workflows/fix-format.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Fix formatting - -on: - pull_request: - types: [labeled] - -permissions: {} - -jobs: - fix-formatting: - runs-on: ubuntu-latest - if: ${{ github.event.label.name == 'fix:formatting' }} - permissions: - contents: write - pull-requests: write - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: 'Checkout' - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ steps.generate-token.outputs.token }} - persist-credentials: true - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - - name: Fix formatting - run: pnpm --recursive install && pnpm run --recursive --parallel fix:format - - - name: Commit and push - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 - with: - default_author: github_actions - message: 'chore: fix formatting' - - - name: Remove label - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - if: always() - with: - github-token: ${{ steps.generate-token.outputs.token }} - script: | - github.rest.issues.removeLabel({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: 'fix:formatting' - }) diff --git a/.github/workflows/merge-translations.yml b/.github/workflows/merge-translations.yml deleted file mode 100644 index 392dec5e37..0000000000 --- a/.github/workflows/merge-translations.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: Merge translations - -on: - workflow_dispatch: - workflow_call: - secrets: - PUSH_O_MATIC_APP_ID: - required: true - PUSH_O_MATIC_APP_KEY: - required: true - WEBLATE_TOKEN: - required: true - inputs: - skip: - description: 'Skip translations' - required: false - type: boolean - -permissions: {} - -env: - WEBLATE_HOST: 'https://hosted.weblate.org' - WEBLATE_COMPONENT: 'immich/immich' - -jobs: - merge: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Generate a token - id: generate_token - if: ${{ inputs.skip != true }} - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Find translation PR - id: find_pr - if: ${{ inputs.skip != true }} - env: - GH_TOKEN: ${{ steps.generate_token.outputs.token }} - run: | - set -euo pipefail - - PR=$(gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable) - echo "$PR" - - PR_NUMBER=$(echo "$PR" | jq ' - if length == 1 then - .[0].number - else - error("Expected exactly 1 entry, got \(length)") - end - ' 2>&1) || exit 1 - - echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT - echo "Selected PR $PR_NUMBER" - - if ! echo "$PR" | jq -e '.[0].mergeable == "MERGEABLE"'; then - echo "PR is not mergeable" - exit 1 - fi - - - name: Lock weblate - if: ${{ inputs.skip != true }} - env: - WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} - run: | - curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/lock/" -d lock=true - - - name: Commit translations - if: ${{ inputs.skip != true }} - env: - WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} - run: | - curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/repository/" -d operation=commit - curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/repository/" -d operation=push - - - name: Merge PR - id: merge_pr - if: ${{ inputs.skip != true }} - env: - GH_TOKEN: ${{ steps.generate_token.outputs.token }} - PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }} - run: | - set -euo pipefail - - REVIEW_ID=$(gh api -X POST "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews" --field event='APPROVE' --field body='Automatically merging translations PR' \ - | jq '.id') - echo "REVIEW_ID=$REVIEW_ID" >> $GITHUB_OUTPUT - gh pr merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --auto --squash - - - name: Wait for PR to merge - if: ${{ inputs.skip != true }} - env: - GH_TOKEN: ${{ steps.generate_token.outputs.token }} - PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }} - REVIEW_ID: ${{ steps.merge_pr.outputs.REVIEW_ID }} - run: | - # So we clean up no matter what - set +e - - for i in {1..100}; do - if gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json state | jq -e '.state == "MERGED"'; then - echo "PR merged" - exit 0 - else - echo "PR not merged yet, waiting..." - sleep 6 - fi - done - echo "PR did not merge in time" - gh api -X PUT "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews/$REVIEW_ID/dismissals" --field message='Merge attempt timed out' --field event='DISMISS' - gh pr merge "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --disable-auto - exit 1 - - - name: Unlock weblate - if: ${{ inputs.skip != true }} - env: - WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} - run: | - curl --fail-with-body -X POST -H "Authorization: Token $WEBLATE_TOKEN" "$WEBLATE_HOST/api/components/$WEBLATE_COMPONENT/lock/" -d lock=false - - - name: Report success - run: | - echo "Workflow completed successfully (or was skipped)" diff --git a/.github/workflows/org-pr-require-conventional-commit.yml b/.github/workflows/org-pr-require-conventional-commit.yml deleted file mode 100644 index 5e5f84ef39..0000000000 --- a/.github/workflows/org-pr-require-conventional-commit.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: PR Conventional Commit - -on: - pull_request: - types: [opened, synchronize, reopened, edited] - -jobs: - validate-pr-title: - name: Validate PR Title (conventional commit) - uses: immich-app/devtools/.github/workflows/shared-pr-require-conventional-commit.yml@main - permissions: - pull-requests: write diff --git a/.github/workflows/org-zizmor.yml b/.github/workflows/org-zizmor.yml deleted file mode 100644 index 8510fd85b4..0000000000 --- a/.github/workflows/org-zizmor.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Zizmor - -on: - pull_request: - push: - branches: [main] - -jobs: - zizmor: - name: Zizmor - uses: immich-app/devtools/.github/workflows/shared-zizmor.yml@main - permissions: - actions: read - contents: read - security-events: write diff --git a/.github/workflows/pr-label-validation.yml b/.github/workflows/pr-label-validation.yml deleted file mode 100644 index 0544de3dad..0000000000 --- a/.github/workflows/pr-label-validation.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PR Label Validation - -on: - pull_request_target: # zizmor: ignore[dangerous-triggers] no attacker inputs are used here - types: [opened, labeled, unlabeled, synchronize] - -permissions: {} - -jobs: - validate-release-label: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Require PR to have a changelog label - uses: mheap/github-action-required-labels@8afbe8ae6ab7647d0c9f0cfa7c2f939650d22509 # v5.5.1 - with: - token: ${{ steps.token.outputs.token }} - mode: exactly - count: 1 - use_regex: true - labels: 'changelog:.*' - add_comment: true - message: 'Label error. Requires {{errorString}} {{count}} of: {{ provided }}. Found: {{ applied }}. A maintainer will add the required label.' diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml deleted file mode 100644 index 263426e548..0000000000 --- a/.github/workflows/pr-labeler.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Pull Request Labeler' -on: - - pull_request_target # zizmor: ignore[dangerous-triggers] no attacker inputs are used here - -permissions: {} - -jobs: - labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 - with: - repo-token: ${{ steps.token.outputs.token }} diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 373fbaf6c1..0000000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,158 +0,0 @@ -name: Prepare new release - -on: - workflow_dispatch: - inputs: - serverBump: - description: 'Bump server version' - required: true - default: 'false' - type: choice - options: - - 'false' - - major - - minor - - patch - mobileBump: - description: 'Bump mobile build number' - required: false - type: boolean - skipTranslations: - description: 'Skip translations' - required: false - type: boolean - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-root - cancel-in-progress: true - -permissions: {} - -jobs: - merge_translations: - uses: ./.github/workflows/merge-translations.yml - with: - skip: ${{ inputs.skipTranslations }} - permissions: - pull-requests: write - secrets: - PUSH_O_MATIC_APP_ID: ${{ secrets.PUSH_O_MATIC_APP_ID }} - PUSH_O_MATIC_APP_KEY: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} - - bump_version: - runs-on: ubuntu-latest - needs: [merge_translations] - outputs: - ref: ${{ steps.push-tag.outputs.commit_long_sha }} - version: ${{ steps.output.outputs.version }} - permissions: {} # No job-level permissions are needed because it uses the app-token - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - token: ${{ steps.generate-token.outputs.token }} - persist-credentials: true - ref: main - - - name: Install uv - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - - name: Bump version - env: - SERVER_BUMP: ${{ inputs.serverBump }} - MOBILE_BUMP: ${{ inputs.mobileBump }} - run: misc/release/pump-version.sh -s "${SERVER_BUMP}" -m "${MOBILE_BUMP}" - - - id: output - run: echo "version=$IMMICH_VERSION" >> $GITHUB_OUTPUT - - - name: Commit and tag - id: push-tag - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 - with: - default_author: github_actions - message: 'chore: version ${{ steps.output.outputs.version }}' - tag: ${{ steps.output.outputs.version }} - push: true - - build_mobile: - uses: ./.github/workflows/build-mobile.yml - needs: bump_version - permissions: - contents: read - secrets: - KEY_JKS: ${{ secrets.KEY_JKS }} - ALIAS: ${{ secrets.ALIAS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} - ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} - # iOS secrets - APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - IOS_CERTIFICATE_P12: ${{ secrets.IOS_CERTIFICATE_P12 }} - IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - FASTLANE_TEAM_ID: ${{ secrets.FASTLANE_TEAM_ID }} - - with: - ref: ${{ needs.bump_version.outputs.ref }} - environment: production - - prepare_release: - runs-on: ubuntu-latest - needs: [build_mobile, bump_version] - permissions: - actions: read # To download the app artifact - # No content permissions are needed because it uses the app-token - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - token: ${{ steps.generate-token.outputs.token }} - persist-credentials: false - - - name: Download APK - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: release-apk-signed - github-token: ${{ steps.generate-token.outputs.token }} - - - name: Create draft release - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 - with: - draft: true - tag_name: ${{ needs.bump_version.outputs.version }} - token: ${{ steps.generate-token.outputs.token }} - generate_release_notes: true - body_path: misc/release/notes.tmpl - files: | - docker/docker-compose.yml - docker/example.env - docker/hwaccel.ml.yml - docker/hwaccel.transcoding.yml - docker/prometheus.yml - *.apk diff --git a/.github/workflows/preview-label.yaml b/.github/workflows/preview-label.yaml deleted file mode 100644 index 8760b67fc0..0000000000 --- a/.github/workflows/preview-label.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: Preview label - -on: - pull_request: - types: [labeled, closed] - -permissions: {} - -jobs: - comment-status: - runs-on: ubuntu-latest - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'preview' }} - permissions: - pull-requests: write - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2 - with: - github-token: ${{ steps.token.outputs.token }} - message-id: 'preview-status' - message: 'Deploying preview environment to https://pr-${{ github.event.pull_request.number }}.preview.internal.immich.build/' - - remove-label: - runs-on: ubuntu-latest - if: ${{ (github.event.action == 'closed' || github.event.pull_request.head.repo.fork) && contains(github.event.pull_request.labels.*.name, 'preview') }} - permissions: - pull-requests: write - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - script: | - github.rest.issues.removeLabel({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: 'preview' - }) - - - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2 - if: ${{ github.event.pull_request.head.repo.fork }} - with: - github-token: ${{ steps.token.outputs.token }} - message-id: 'preview-status' - message: 'PRs from forks cannot have preview environments.' - - - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2 - if: ${{ !github.event.pull_request.head.repo.fork }} - with: - github-token: ${{ steps.token.outputs.token }} - message-id: 'preview-status' - message: 'Preview environment has been removed.' diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml deleted file mode 100644 index 3ee96c45b7..0000000000 --- a/.github/workflows/release-pr.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: Manage release PR -on: - workflow_dispatch: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: true - -permissions: {} - -jobs: - bump: - runs-on: ubuntu-latest - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - token: ${{ steps.generate-token.outputs.token }} - persist-credentials: true - ref: main - - - name: Install uv - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - - name: Determine release type - id: bump-type - uses: ietf-tools/semver-action@c90370b2958652d71c06a3484129a4d423a6d8a8 # v1.11.0 - with: - token: ${{ steps.generate-token.outputs.token }} - - - name: Bump versions - env: - TYPE: ${{ steps.bump-type.outputs.bump }} - run: | - if [ "$TYPE" == "none" ]; then - exit 1 # TODO: Is there a cleaner way to abort the workflow? - fi - misc/release/pump-version.sh -s $TYPE -m true - - - name: Manage Outline release document - id: outline - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - env: - OUTLINE_API_KEY: ${{ secrets.OUTLINE_API_KEY }} - NEXT_VERSION: ${{ steps.bump-type.outputs.next }} - with: - github-token: ${{ steps.generate-token.outputs.token }} - script: | - const fs = require('fs'); - - const outlineKey = process.env.OUTLINE_API_KEY; - const parentDocumentId = 'da856355-0844-43df-bd71-f8edce5382d9' - const collectionId = 'e2910656-714c-4871-8721-447d9353bd73'; - const baseUrl = 'https://outline.immich.cloud'; - - const listResponse = await fetch(`${baseUrl}/api/documents.list`, { - method: 'POST', - headers: { - 'Authorization': `Bearer ${outlineKey}`, - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ parentDocumentId }) - }); - - if (!listResponse.ok) { - throw new Error(`Outline list failed: ${listResponse.statusText}`); - } - - const listData = await listResponse.json(); - const allDocuments = listData.data || []; - - const document = allDocuments.find(doc => doc.title === 'next'); - - let documentId; - let documentUrl; - let documentText; - - if (!document) { - // Create new document - console.log('No existing document found. Creating new one...'); - const notesTmpl = fs.readFileSync('misc/release/notes.tmpl', 'utf8'); - const createResponse = await fetch(`${baseUrl}/api/documents.create`, { - method: 'POST', - headers: { - 'Authorization': `Bearer ${outlineKey}`, - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - title: 'next', - text: notesTmpl, - collectionId: collectionId, - parentDocumentId: parentDocumentId, - publish: true - }) - }); - - if (!createResponse.ok) { - throw new Error(`Failed to create document: ${createResponse.statusText}`); - } - - const createData = await createResponse.json(); - documentId = createData.data.id; - const urlId = createData.data.urlId; - documentUrl = `${baseUrl}/doc/next-${urlId}`; - documentText = createData.data.text || ''; - console.log(`Created new document: ${documentUrl}`); - } else { - documentId = document.id; - const docPath = document.url; - documentUrl = `${baseUrl}${docPath}`; - documentText = document.text || ''; - console.log(`Found existing document: ${documentUrl}`); - } - - // Generate GitHub release notes - console.log('Generating GitHub release notes...'); - const releaseNotesResponse = await github.rest.repos.generateReleaseNotes({ - owner: context.repo.owner, - repo: context.repo.repo, - tag_name: `${process.env.NEXT_VERSION}`, - }); - - // Combine the content - const changelog = ` - # ${process.env.NEXT_VERSION} - - ${documentText} - - ${releaseNotesResponse.data.body} - - --- - - ` - - const existingChangelog = fs.existsSync('CHANGELOG.md') ? fs.readFileSync('CHANGELOG.md', 'utf8') : ''; - fs.writeFileSync('CHANGELOG.md', changelog + existingChangelog, 'utf8'); - - core.setOutput('document_url', documentUrl); - - - name: Create PR - id: create-pr - uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0 - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: 'chore: release ${{ steps.bump-type.outputs.next }}' - title: 'chore: release ${{ steps.bump-type.outputs.next }}' - body: 'Release notes: ${{ steps.outline.outputs.document_url }}' - labels: 'changelog:skip' - branch: 'release/next' - draft: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 30783f5e9b..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,148 +0,0 @@ -name: release.yml -on: - pull_request: - types: [closed] - paths: - - CHANGELOG.md - -jobs: - # Maybe double check PR source branch? - - merge_translations: - uses: ./.github/workflows/merge-translations.yml - permissions: - pull-requests: write - secrets: - PUSH_O_MATIC_APP_ID: ${{ secrets.PUSH_O_MATIC_APP_ID }} - PUSH_O_MATIC_APP_KEY: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - WEBLATE_TOKEN: ${{ secrets.WEBLATE_TOKEN }} - - build_mobile: - uses: ./.github/workflows/build-mobile.yml - needs: merge_translations - permissions: - contents: read - secrets: - KEY_JKS: ${{ secrets.KEY_JKS }} - ALIAS: ${{ secrets.ALIAS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} - ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }} - # iOS secrets - APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - IOS_CERTIFICATE_P12: ${{ secrets.IOS_CERTIFICATE_P12 }} - IOS_CERTIFICATE_PASSWORD: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - IOS_PROVISIONING_PROFILE: ${{ secrets.IOS_PROVISIONING_PROFILE }} - IOS_PROVISIONING_PROFILE_SHARE_EXTENSION: ${{ secrets.IOS_PROVISIONING_PROFILE_SHARE_EXTENSION }}misc/release/notes.tmpl - IOS_PROVISIONING_PROFILE_WIDGET_EXTENSION: ${{ secrets.IOS_PROVISIONING_PROFILE_WIDGET_EXTENSION }} - IOS_DEVELOPMENT_PROVISIONING_PROFILE: ${{ secrets.IOS_DEVELOPMENT_PROVISIONING_PROFILE }} - IOS_DEVELOPMENT_PROVISIONING_PROFILE_SHARE_EXTENSION: ${{ secrets.IOS_DEVELOPMENT_PROVISIONING_PROFILE_SHARE_EXTENSION }} - IOS_DEVELOPMENT_PROVISIONING_PROFILE_WIDGET_EXTENSION: ${{ secrets.IOS_DEVELOPMENT_PROVISIONING_PROFILE_WIDGET_EXTENSION }} - FASTLANE_TEAM_ID: ${{ secrets.FASTLANE_TEAM_ID }} - with: - ref: main - environment: production - - prepare_release: - runs-on: ubuntu-latest - needs: build_mobile - permissions: - actions: read # To download the app artifact - steps: - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - token: ${{ steps.generate-token.outputs.token }} - persist-credentials: false - ref: main - - - name: Extract changelog - id: changelog - run: | - CHANGELOG_PATH=$RUNNER_TEMP/changelog.md - sed -n '1,/^---$/p' CHANGELOG.md | head -n -1 > $CHANGELOG_PATH - echo "path=$CHANGELOG_PATH" >> $GITHUB_OUTPUT - VERSION=$(sed -n 's/^# //p' $CHANGELOG_PATH) - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Download APK - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: release-apk-signed - github-token: ${{ steps.generate-token.outputs.token }} - - - name: Create draft release - uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 - with: - tag_name: ${{ steps.version.outputs.result }} - token: ${{ steps.generate-token.outputs.token }} - body_path: ${{ steps.changelog.outputs.path }} - draft: true - files: | - docker/docker-compose.yml - docker/example.env - docker/hwaccel.ml.yml - docker/hwaccel.transcoding.yml - docker/prometheus.yml - *.apk - - - name: Rename Outline document - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - continue-on-error: true - env: - OUTLINE_API_KEY: ${{ secrets.OUTLINE_API_KEY }} - VERSION: ${{ steps.changelog.outputs.version }} - with: - github-token: ${{ steps.generate-token.outputs.token }} - script: | - const outlineKey = process.env.OUTLINE_API_KEY; - const version = process.env.VERSION; - const parentDocumentId = 'da856355-0844-43df-bd71-f8edce5382d9'; - const baseUrl = 'https://outline.immich.cloud'; - - const listResponse = await fetch(`${baseUrl}/api/documents.list`, { - method: 'POST', - headers: { - 'Authorization': `Bearer ${outlineKey}`, - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ parentDocumentId }) - }); - - if (!listResponse.ok) { - throw new Error(`Outline list failed: ${listResponse.statusText}`); - } - - const listData = await listResponse.json(); - const allDocuments = listData.data || []; - const document = allDocuments.find(doc => doc.title === 'next'); - - if (document) { - console.log(`Found document 'next', renaming to '${version}'...`); - - const updateResponse = await fetch(`${baseUrl}/api/documents.update`, { - method: 'POST', - headers: { - 'Authorization': `Bearer ${outlineKey}`, - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - id: document.id, - title: version - }) - }); - - if (!updateResponse.ok) { - throw new Error(`Failed to rename document: ${updateResponse.statusText}`); - } - } else { - console.log('No document titled "next" found to rename'); - } diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml deleted file mode 100644 index bd2c292ad5..0000000000 --- a/.github/workflows/sdk.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Update Immich SDK - -on: - release: - types: [published] - -permissions: {} - -jobs: - publish: - name: Publish `@immich/sdk` - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - packages: write - defaults: - run: - working-directory: ./open-api/typescript-sdk - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './open-api/typescript-sdk/.nvmrc' - registry-url: 'https://registry.npmjs.org' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Install deps - run: pnpm install --frozen-lockfile - - name: Build - run: pnpm build - - name: Publish - run: pnpm publish --provenance --no-git-checks diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml deleted file mode 100644 index c0d53388c6..0000000000 --- a/.github/workflows/static_analysis.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Static Code Analysis -on: - workflow_dispatch: - pull_request: - push: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: {} - -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - mobile: - - 'mobile/**' - force-filters: | - - '.github/workflows/static_analysis.yml' - force-events: 'workflow_dispatch,release' - - mobile-dart-analyze: - name: Run Dart Code Analysis - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).mobile == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./mobile - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup Flutter SDK - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 - with: - channel: 'stable' - flutter-version-file: ./mobile/pubspec.yaml - - - name: Install dependencies - run: dart pub get - - - name: Install DCM - uses: CQLabs/setup-dcm@8697ae0790c0852e964a6ef1d768d62a6675481a # v2.0.1 - with: - github-token: ${{ steps.token.outputs.token }} - version: auto - working-directory: ./mobile - - - name: Generate translation file - run: dart run easy_localization:generate -S ../i18n && dart run bin/generate_keys.dart - - - name: Run Build Runner - run: make build - - - name: Generate platform API - run: make pigeon - - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-files - with: - files: | - mobile/**/*.g.dart - mobile/**/*.gr.dart - mobile/**/*.drift.dart - - - name: Verify files have not changed - if: steps.verify-changed-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} - run: | - echo "ERROR: Generated files not up to date! Run 'make build' and 'make pigeon' inside the mobile directory" - echo "Changed files: ${CHANGED_FILES}" - exit 1 - - - name: Run dart analyze - run: dart analyze --fatal-infos - - - name: Run dart format - run: make format - - # TODO: Re-enable after upgrading custom_lint - # - name: Run dart custom_lint - # run: dart run custom_lint - - # TODO: Use https://github.com/CQLabs/dcm-action - - name: Run DCM - run: dcm analyze lib --fatal-style --fatal-warnings diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 28a74ff33f..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,865 +0,0 @@ -name: Test -on: - workflow_dispatch: - pull_request: - push: - branches: [main] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -permissions: {} -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - i18n: - - 'i18n/**' - web: - - 'web/**' - - 'i18n/**' - - 'open-api/typescript-sdk/**' - server: - - 'server/**' - cli: - - 'cli/**' - - 'open-api/typescript-sdk/**' - e2e: - - 'e2e/**' - mobile: - - 'mobile/**' - machine-learning: - - 'machine-learning/**' - .github: - - '.github/**' - force-filters: | - - '.github/workflows/test.yml' - force-events: 'workflow_dispatch' - - server-unit-tests: - name: Test & Lint Server - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).server == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./server - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run package manager install - run: pnpm install - - name: Run linter - run: pnpm lint - if: ${{ !cancelled() }} - - name: Run formatter - run: pnpm format - if: ${{ !cancelled() }} - - name: Run tsc - run: pnpm check - if: ${{ !cancelled() }} - - name: Run small tests & coverage - run: pnpm test - if: ${{ !cancelled() }} - cli-unit-tests: - name: Unit Test CLI - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).cli == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./cli - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './cli/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Setup typescript-sdk - run: pnpm install && pnpm run build - working-directory: ./open-api/typescript-sdk - - name: Install deps - run: pnpm install - - name: Run linter - run: pnpm lint - if: ${{ !cancelled() }} - - name: Run formatter - run: pnpm format - if: ${{ !cancelled() }} - - name: Run tsc - run: pnpm check - if: ${{ !cancelled() }} - - name: Run unit tests & coverage - run: pnpm test - if: ${{ !cancelled() }} - cli-unit-tests-win: - name: Unit Test CLI (Windows) - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).cli == true }} - runs-on: windows-latest - permissions: - contents: read - defaults: - run: - working-directory: ./cli - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './cli/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - - name: Install deps - run: pnpm install --frozen-lockfile - # Skip linter & formatter in Windows test. - - name: Run tsc - run: pnpm check - if: ${{ !cancelled() }} - - name: Run unit tests & coverage - run: pnpm test - if: ${{ !cancelled() }} - web-lint: - name: Lint Web - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).web == true }} - runs-on: mich - permissions: - contents: read - defaults: - run: - working-directory: ./web - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - - name: Run pnpm install - run: pnpm rebuild && pnpm install --frozen-lockfile - - name: Run linter - run: pnpm lint - if: ${{ !cancelled() }} - - name: Run formatter - run: pnpm format - if: ${{ !cancelled() }} - - name: Run svelte checks - run: pnpm check:svelte - if: ${{ !cancelled() }} - web-unit-tests: - name: Test Web - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).web == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./web - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - - name: Run npm install - run: pnpm install --frozen-lockfile - - name: Run tsc - run: pnpm check:typescript - if: ${{ !cancelled() }} - - name: Run unit tests & coverage - run: pnpm test - if: ${{ !cancelled() }} - i18n-tests: - name: Test i18n - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).i18n == true }} - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Install dependencies - run: pnpm --filter=immich-i18n install --frozen-lockfile - - name: Format - run: pnpm --filter=immich-i18n format:fix - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-files - with: - files: | - i18n/** - - name: Verify files have not changed - if: steps.verify-changed-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} - run: | - echo "ERROR: i18n files not up to date!" - echo "Changed files: ${CHANGED_FILES}" - exit 1 - e2e-tests-lint: - name: End-to-End Lint - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).e2e == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./e2e - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - if: ${{ !cancelled() }} - - name: Install dependencies - run: pnpm install --frozen-lockfile - if: ${{ !cancelled() }} - - name: Run linter - run: pnpm lint - if: ${{ !cancelled() }} - - name: Run formatter - run: pnpm format - if: ${{ !cancelled() }} - - name: Run tsc - run: pnpm check - if: ${{ !cancelled() }} - server-medium-tests: - name: Medium Tests (Server) - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).server == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./server - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - submodules: 'recursive' - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run pnpm install - run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile - - name: Run medium tests - run: pnpm test:medium - if: ${{ !cancelled() }} - e2e-tests-server-cli: - name: End-to-End Tests (Server & CLI) - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).e2e == true || fromJSON(needs.pre-job.outputs.should_run).server == true || fromJSON(needs.pre-job.outputs.should_run).cli == true }} - runs-on: ${{ matrix.runner }} - permissions: - contents: read - defaults: - run: - working-directory: ./e2e - strategy: - matrix: - runner: [ubuntu-latest, ubuntu-24.04-arm] - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - submodules: 'recursive' - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - if: ${{ !cancelled() }} - - name: Run setup web - run: pnpm install --frozen-lockfile && pnpm exec svelte-kit sync - working-directory: ./web - if: ${{ !cancelled() }} - - name: Run setup cli - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./cli - if: ${{ !cancelled() }} - - name: Install dependencies - run: pnpm install --frozen-lockfile - if: ${{ !cancelled() }} - - name: Docker build - run: docker compose build - if: ${{ !cancelled() }} - - name: Run e2e tests (api & cli) - run: pnpm test - if: ${{ !cancelled() }} - e2e-tests-web: - name: End-to-End Tests (Web) - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).e2e == true || fromJSON(needs.pre-job.outputs.should_run).web == true }} - runs-on: ${{ matrix.runner }} - permissions: - contents: read - defaults: - run: - working-directory: ./e2e - strategy: - matrix: - runner: [ubuntu-latest, ubuntu-24.04-arm] - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - submodules: 'recursive' - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - if: ${{ !cancelled() }} - - name: Install dependencies - run: pnpm install --frozen-lockfile - if: ${{ !cancelled() }} - - name: Install Playwright Browsers - run: npx playwright install chromium --only-shell - if: ${{ !cancelled() }} - - name: Docker build - run: docker compose build - if: ${{ !cancelled() }} - - name: Run e2e tests (web) - env: - CI: true - run: npx playwright test --project=chromium - if: ${{ !cancelled() }} - - name: Archive web results - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - if: success() || failure() - with: - name: e2e-web-test-results-${{ matrix.runner }} - path: e2e/playwright-report/ - - name: Run ui tests (web) - env: - CI: true - run: npx playwright test --project=ui - if: ${{ !cancelled() }} - - name: Archive ui results - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - if: success() || failure() - with: - name: e2e-ui-test-results-${{ matrix.runner }} - path: e2e/playwright-report/ - success-check-e2e: - name: End-to-End Tests Success - needs: [e2e-tests-server-cli, e2e-tests-web] - permissions: {} - runs-on: ubuntu-latest - if: always() - steps: - - uses: immich-app/devtools/actions/success-check@68f10eb389bb02a3cf9d1156111964c549eb421b # 0.0.4 - with: - needs: ${{ toJSON(needs) }} - mobile-unit-tests: - name: Unit Test Mobile - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).mobile == true }} - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup Flutter SDK - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0 - with: - channel: 'stable' - flutter-version-file: ./mobile/pubspec.yaml - - name: Generate translation file - run: dart run easy_localization:generate -S ../i18n && dart run bin/generate_keys.dart - working-directory: ./mobile - - name: Run tests - working-directory: ./mobile - run: flutter test -j 1 - ml-unit-tests: - name: Unit Test ML - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run).machine-learning == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./machine-learning - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Install uv - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 - with: - python-version: 3.11 - - name: Install dependencies - run: | - uv sync --extra cpu - - name: Lint with ruff - run: | - uv run ruff check --output-format=github immich_ml - - name: Format with ruff - run: | - uv run ruff format --check immich_ml - - name: Run mypy type checking - run: | - uv run mypy --strict immich_ml/ - - name: Run tests and coverage - run: | - uv run pytest --cov=immich_ml --cov-report term-missing - github-files-formatting: - name: .github Files Formatting - needs: pre-job - if: ${{ fromJSON(needs.pre-job.outputs.should_run)['.github'] == true }} - runs-on: ubuntu-latest - permissions: - contents: read - defaults: - run: - working-directory: ./.github - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './.github/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run pnpm install - run: pnpm install --frozen-lockfile - - name: Run formatter - run: pnpm format - if: ${{ !cancelled() }} - shellcheck: - name: ShellCheck - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0 - with: - ignore_paths: >- - **/open-api/** **/openapi** **/node_modules/** - generated-api-up-to-date: - name: OpenAPI Clients - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Install server dependencies - run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile - - name: Build the app - run: pnpm --filter immich build - - name: Run API generation - run: ./bin/generate-open-api.sh - working-directory: open-api - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-files - with: - files: | - mobile/openapi - open-api/typescript-sdk - open-api/immich-openapi-specs.json - - name: Verify files have not changed - if: steps.verify-changed-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} - run: | - echo "ERROR: Generated files not up to date!" - echo "Changed files: ${CHANGED_FILES}" - exit 1 - sql-schema-up-to-date: - name: SQL Schema Checks - runs-on: ubuntu-latest - permissions: - contents: read - services: - postgres: - image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3@sha256:dbf18b3ffea4a81434c65b71e20d27203baf903a0275f4341e4c16dfd901fd67 - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: immich - options: >- - --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - ports: - - 5432:5432 - defaults: - run: - working-directory: ./server - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - token: ${{ steps.token.outputs.token }} - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - - name: Setup Node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Install server dependencies - run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile - - name: Build the app - run: pnpm build - - name: Run existing migrations - run: pnpm migrations:run - - name: Test npm run schema:reset command works - run: pnpm schema:reset - - name: Generate new migrations - continue-on-error: true - run: pnpm migrations:generate src/TestMigration - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-files - with: - files: | - server/src - - name: Verify migration files have not changed - if: steps.verify-changed-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} - run: | - echo "ERROR: Generated migration files not up to date!" - echo "Changed files: ${CHANGED_FILES}" - cat ./src/*-TestMigration.ts - exit 1 - - name: Run SQL generation - run: pnpm sync:sql - env: - DB_URL: postgres://postgres:postgres@localhost:5432/immich - - name: Find file changes - uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 - id: verify-changed-sql-files - with: - files: | - server/src/queries - - name: Verify SQL files have not changed - if: steps.verify-changed-sql-files.outputs.files_changed == 'true' - env: - CHANGED_FILES: ${{ steps.verify-changed-sql-files.outputs.changed_files }} - run: | - echo "ERROR: Generated SQL files not up to date!" - echo "Changed files: ${CHANGED_FILES}" - git diff - exit 1 - -# mobile-integration-tests: -# name: Run mobile end-to-end integration tests -# runs-on: macos-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: '12.x' -# cache: 'gradle' -# - name: Cache android SDK -# uses: actions/cache@v3 -# id: android-sdk -# with: -# key: android-sdk -# path: | -# /usr/local/lib/android/ -# ~/.android -# - name: Cache Gradle -# uses: actions/cache@v3 -# with: -# path: | -# ./mobile/build/ -# ./mobile/android/.gradle/ -# key: ${{ runner.os }}-flutter-${{ hashFiles('**/*.gradle*', 'pubspec.lock') }} -# - name: Setup Android SDK -# if: steps.android-sdk.outputs.cache-hit != 'true' -# uses: android-actions/setup-android@v2 -# - name: AVD cache -# uses: actions/cache@v3 -# id: avd-cache -# with: -# path: | -# ~/.android/avd/* -# ~/.android/adb* -# key: avd-29 -# - name: create AVD and generate snapshot for caching -# if: steps.avd-cache.outputs.cache-hit != 'true' -# uses: reactivecircus/android-emulator-runner@v2.27.0 -# with: -# working-directory: ./mobile -# cores: 2 -# api-level: 29 -# arch: x86_64 -# profile: pixel -# target: default -# force-avd-creation: false -# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -# disable-animations: false -# script: echo "Generated AVD snapshot for caching." -# - name: Setup Flutter SDK -# uses: subosito/flutter-action@v2 -# with: -# channel: 'stable' -# flutter-version: '3.7.3' -# cache: true -# - name: Run integration tests -# uses: Wandalen/wretry.action@master -# with: -# action: reactivecircus/android-emulator-runner@v2.27.0 -# with: | -# working-directory: ./mobile -# cores: 2 -# api-level: 29 -# arch: x86_64 -# profile: pixel -# target: default -# force-avd-creation: false -# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -# disable-animations: true -# script: | -# flutter pub get -# flutter test integration_test -# attempt_limit: 3 diff --git a/.github/workflows/weblate-lock.yml b/.github/workflows/weblate-lock.yml deleted file mode 100644 index cb11a11be4..0000000000 --- a/.github/workflows/weblate-lock.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Weblate checks - -on: - pull_request: - branches: [main] - types: - - opened - - synchronize - - ready_for_review - - auto_merge_enabled - - auto_merge_disabled - -permissions: {} - -env: - BOT_NAME: immich-push-o-matic - -jobs: - pre-job: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - should_run: ${{ steps.check.outputs.should_run }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Check what should run - id: check - uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0 - with: - github-token: ${{ steps.token.outputs.token }} - filters: | - i18n: - - modified: 'i18n/!(en|package)**\.json' - skip-force-logic: 'true' - - enforce-lock: - name: Check Weblate Lock - needs: [pre-job] - runs-on: ubuntu-latest - permissions: {} - if: ${{ fromJSON(needs.pre-job.outputs.should_run).i18n == true }} - steps: - - id: token - uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0 - with: - app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} - private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} - - - name: Bot review status - env: - PR_NUMBER: ${{ github.event.pull_request.number || github.event.pull_request_review.pull_request.number }} - GH_TOKEN: ${{ steps.token.outputs.token }} - run: | - # Then check for APPROVED by the bot, if absent fail - gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json reviews | jq -e '.reviews | map(select(.author.login == env.BOT_NAME and .state == "APPROVED")) | length > 0' \ - || (echo "The push-o-matic bot has not approved this PR yet" && exit 1) - - success-check-lock: - name: Weblate Lock Check Success - needs: [enforce-lock] - runs-on: ubuntu-latest - permissions: {} - if: always() - steps: - - uses: immich-app/devtools/actions/success-check@68f10eb389bb02a3cf9d1156111964c549eb421b # 0.0.4 - with: - needs: ${{ toJSON(needs) }} diff --git a/.gitignore b/.gitignore index 3220701cc6..d3c48d0bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ vite.config.js.timestamp-* .pnpm-store .devcontainer/library .devcontainer/.env* + +docker/dev-data \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d417dc5ba8..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "mobile/.isar"] - path = mobile/.isar - url = https://github.com/isar/isar -[submodule "e2e/test-assets"] - path = e2e/test-assets - url = https://github.com/immich-app/test-assets diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs deleted file mode 100644 index 0e76dabe66..0000000000 --- a/.pnpmfile.cjs +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - hooks: { - readPackage: (pkg) => { - if (!pkg.name) { - return pkg; - } - if (pkg.name === "exiftool-vendored") { - if (pkg.optionalDependencies["exiftool-vendored.pl"]) { - // make exiftool-vendored.pl a regular dependency - pkg.dependencies["exiftool-vendored.pl"] = - pkg.optionalDependencies["exiftool-vendored.pl"]; - delete pkg.optionalDependencies["exiftool-vendored.pl"]; - } - } - return pkg; - }, - }, -}; diff --git a/Makefile b/Makefile index 0fc0bb0b4c..b53da6a56b 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ dev: docker compose -f $(DOCKER_COMPOSE_FILE) up -d @echo "Waiting for services to be healthy..." @sleep 3 - @echo "Starting web dev server (background)..." - pnpm --filter web dev & +# @echo "Starting web dev server (background)..." +# pnpm --filter web dev & @echo "Starting NestJS server with hot reload..." - pnpm --filter immich start:dev + DB_HOSTNAME=localhost DB_PORT=5435 DB_DATABASE_NAME=app REDIS_HOSTNAME=localhost pnpm --filter immich start:dev dev-down: docker compose -f $(DOCKER_COMPOSE_FILE) down --remove-orphans @@ -23,13 +23,13 @@ dev-down: # OpenAPI SDK generation open-api: - ./open-api/bin/generate-open-api.sh + cd open-api && ./bin/generate-open-api.sh open-api-dart: - cd open-api && npx --yes @openapitools/openapi-generator-cli generate -g dart -i ../server/immich-openapi-specs.json -o ../mobile/openapi + cd open-api && npx --yes @openapitools/openapi-generator-cli generate -g dart -i ../server/server-openapi-specs.json -o ../mobile/openapi open-api-typescript: - cd open-api && npx --yes oazapfts ../server/immich-openapi-specs.json --optimistic > typescript-sdk/src/fetch-client.ts + cd open-api && npx --yes oazapfts ../server/server-openapi-specs.json --optimistic > typescript-sdk/src/fetch-client.ts # Build targets build-server: diff --git a/README.md b/README.md index 7e06d9de4b..8d496449a7 100644 --- a/README.md +++ b/README.md @@ -1,133 +1,55 @@ -

-
- License: AGPLv3 - - Discord - -
-
-

+# Core Monorepo -

- -

-

High performance self-hosted photo and video management solution

-
- - - -
+A full-stack monorepo template with **NestJS** (server), **SvelteKit** (web), and **Flutter** (mobile), powered by **pnpm workspaces**. -

- Català - Español - Français - Italiano - 日本語 - 한국어 - Deutsch - Nederlands - Türkçe - 简体中文 - 正體中文 - Українська - Русский - Português Brasileiro - Svenska - العربية - Tiếng Việt - ภาษาไทย -

+## Architecture +``` +server/ NestJS REST API with PostgreSQL + Redis +web/ SvelteKit frontend (static adapter) +mobile/ Flutter mobile app +e2e/ End-to-end tests (Vitest + Playwright) +open-api/ OpenAPI spec generation & TypeScript SDK +i18n/ Internationalization strings +docker/ Docker Compose for local development +``` -> [!WARNING] -> ⚠️ Always follow [3-2-1](https://www.backblaze.com/blog/the-3-2-1-backup-strategy/) backup plan for your precious photos and videos! -> - +## Quick Start -> [!NOTE] -> You can find the main documentation, including installation guides, at https://immich.app/. +```bash +# Install dependencies +pnpm install -## Links +# Start Postgres + Redis +make dev -- [Documentation](https://docs.immich.app/) -- [About](https://docs.immich.app/overview/introduction) -- [Installation](https://docs.immich.app/install/requirements) -- [Roadmap](https://immich.app/roadmap) -- [Demo](#demo) -- [Features](#features) -- [Translations](https://docs.immich.app/developer/translations) -- [Contributing](https://docs.immich.app/overview/support-the-project) +# Or individually: +make dev-down # Stop services +make build-server # Build NestJS server +make build-web # Build SvelteKit app +make open-api # Regenerate OpenAPI spec & SDK +``` -## Demo +## Development -Access the demo [here](https://demo.immich.app). For the mobile app, you can use `https://demo.immich.app` for the `Server Endpoint URL`. +| Command | Description | +|---------|-------------| +| `make dev` | Start Docker services + web + server | +| `make dev-down` | Stop all services | +| `make build-server` | Build the NestJS server | +| `make build-web` | Build the SvelteKit web app | +| `make open-api` | Regenerate OpenAPI spec & SDKs | +| `make test-server` | Run server unit tests | +| `make test-e2e` | Run end-to-end tests | +| `make lint-server` | Lint the server | +| `make lint-web` | Lint the web app | +| `make clean` | Remove containers, volumes, node_modules | -### Login credentials +## Stack -| Email | Password | -| --------------- | -------- | -| demo@immich.app | demo | - -## Features - -| Features | Mobile | Web | -| :------------------------------------------- | ------ | --- | -| Upload and view videos and photos | Yes | Yes | -| Auto backup when the app is opened | Yes | N/A | -| Prevent duplication of assets | Yes | Yes | -| Selective album(s) for backup | Yes | N/A | -| Download photos and videos to local device | Yes | Yes | -| Multi-user support | Yes | Yes | -| Album and Shared albums | Yes | Yes | -| Scrubbable/draggable scrollbar | Yes | Yes | -| Support raw formats | Yes | Yes | -| Metadata view (EXIF, map) | Yes | Yes | -| Search by metadata, objects, faces, and CLIP | Yes | Yes | -| Administrative functions (user management) | No | Yes | -| Background backup | Yes | N/A | -| Virtual scroll | Yes | Yes | -| OAuth support | Yes | Yes | -| API Keys | N/A | Yes | -| LivePhoto/MotionPhoto backup and playback | Yes | Yes | -| Support 360 degree image display | No | Yes | -| User-defined storage structure | Yes | Yes | -| Public Sharing | Yes | Yes | -| Archive and Favorites | Yes | Yes | -| Global Map | Yes | Yes | -| Partner Sharing | Yes | Yes | -| Facial recognition and clustering | Yes | Yes | -| Memories (x years ago) | Yes | Yes | -| Offline support | Yes | No | -| Read-only gallery | Yes | Yes | -| Stacked Photos | Yes | Yes | -| Tags | No | Yes | -| Folder View | Yes | Yes | - -## Translations - -Read more about translations [here](https://docs.immich.app/developer/translations). - - -Translation status - - -## Repository activity - -![Activities](https://repobeats.axiom.co/api/embed/9e86d9dc3ddd137161f2f6d2e758d7863b1789cb.svg "Repobeats analytics image") - -## Star history - - - - - - Star History Chart - - - -## Contributors - - - - +- **Server**: NestJS, Kysely (query builder), PostgreSQL 18, Redis +- **Web**: SvelteKit 2, Svelte 5, TailwindCSS, @immich/ui +- **Mobile**: Flutter / Dart +- **API**: Auto-generated OpenAPI spec with TypeScript SDK via oazapfts +- **Auth**: JWT (access + refresh tokens), API keys, session management +- **i18n**: svelte-i18n with English base locale diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index fbba33c022..0ddf9c2fa9 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,9 +10,9 @@ services: POSTGRES_DB: ${DB_DATABASE_NAME:-app} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - - pgdata:/var/lib/postgresql/data + - ./dev-data/postgres:/var/lib/postgresql/data ports: - - '5432:5432' + - '5435:5432' shm_size: 128mb restart: always healthcheck: @@ -32,6 +32,3 @@ services: timeout: 5s retries: 5 restart: always - -volumes: - pgdata: diff --git a/e2e/package.json b/e2e/package.json index 7271a65ffa..8bddc8db65 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -1,14 +1,12 @@ { - "name": "immich-e2e", - "version": "2.5.5", + "name": "e2e", + "version": "0.1.0", "description": "", "main": "index.js", "type": "module", "scripts": { "test": "vitest --run", "test:watch": "vitest", - "test:web": "npx playwright test", - "start:web": "npx playwright test --ui", "format": "prettier --check .", "format:fix": "prettier --write .", "lint": "eslint \"src/**/*.ts\" --max-warnings 0", @@ -17,38 +15,30 @@ }, "keywords": [], "author": "", - "license": "GNU Affero General Public License version 3", + "license": "MIT", "devDependencies": { "@eslint/js": "^9.8.0", "@faker-js/faker": "^10.1.0", - "@immich/cli": "file:../cli", - "@immich/e2e-auth-server": "file:../e2e-auth-server", - "@immich/sdk": "file:../open-api/typescript-sdk", - "@playwright/test": "^1.44.1", + "@server/sdk": "file:../open-api/typescript-sdk", "@socket.io/component-emitter": "^3.1.2", "@types/luxon": "^3.4.2", "@types/node": "^24.10.9", "@types/pg": "^8.15.1", - "@types/pngjs": "^6.0.4", "@types/supertest": "^6.0.2", "dotenv": "^17.2.3", "eslint": "^9.14.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-unicorn": "^62.0.0", - "exiftool-vendored": "^34.3.0", "globals": "^16.0.0", "luxon": "^3.4.4", "pg": "^8.11.3", - "pngjs": "^7.0.0", "prettier": "^3.7.4", "prettier-plugin-organize-imports": "^4.0.0", - "sharp": "^0.34.5", "socket.io-client": "^4.7.4", "supertest": "^7.0.0", "typescript": "^5.3.3", "typescript-eslint": "^8.28.0", - "utimes": "^5.2.1", "vitest": "^3.0.0" }, "volta": { diff --git a/e2e/src/api/specs/activity.e2e-spec.ts b/e2e/src/api/specs/activity.e2e-spec.ts deleted file mode 100644 index 9ce9b4b916..0000000000 --- a/e2e/src/api/specs/activity.e2e-spec.ts +++ /dev/null @@ -1,378 +0,0 @@ -import { - ActivityCreateDto, - AlbumResponseDto, - AlbumUserRole, - AssetMediaResponseDto, - LoginResponseDto, - ReactionType, - createActivity as create, - createAlbum, - removeAssetFromAlbum, -} from '@immich/sdk'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -describe('/activities', () => { - let admin: LoginResponseDto; - let nonOwner: LoginResponseDto; - let asset: AssetMediaResponseDto; - let album: AlbumResponseDto; - - const createActivity = (dto: ActivityCreateDto, accessToken?: string) => - create({ activityCreateDto: dto }, { headers: asBearerAuth(accessToken || admin.accessToken) }); - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - nonOwner = await utils.userSetup(admin.accessToken, createUserDto.user1); - asset = await utils.createAsset(admin.accessToken); - album = await createAlbum( - { - createAlbumDto: { - albumName: 'Album 1', - assetIds: [asset.id], - albumUsers: [{ userId: nonOwner.userId, role: AlbumUserRole.Editor }], - }, - }, - { headers: asBearerAuth(admin.accessToken) }, - ); - }); - - beforeEach(async () => { - await utils.resetDatabase(['activity']); - }); - - describe('GET /activities', () => { - it('should start off empty', async () => { - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([]); - expect(status).toEqual(200); - }); - - it('should filter by album id', async () => { - const album2 = await createAlbum( - { - createAlbumDto: { - albumName: 'Album 2', - assetIds: [asset.id], - }, - }, - { headers: asBearerAuth(admin.accessToken) }, - ); - - const [reaction] = await Promise.all([ - createActivity({ albumId: album.id, type: ReactionType.Like }), - createActivity({ albumId: album2.id, type: ReactionType.Like }), - ]); - - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(200); - expect(body.length).toBe(1); - expect(body[0]).toEqual(reaction); - }); - - it('should filter by type=comment', async () => { - const [reaction] = await Promise.all([ - createActivity({ - albumId: album.id, - type: ReactionType.Comment, - comment: 'comment', - }), - createActivity({ albumId: album.id, type: ReactionType.Like }), - ]); - - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id, type: 'comment' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(200); - expect(body.length).toBe(1); - expect(body[0]).toEqual(reaction); - }); - - it('should filter by type=like', async () => { - const [reaction] = await Promise.all([ - createActivity({ albumId: album.id, type: ReactionType.Like }), - createActivity({ - albumId: album.id, - type: ReactionType.Comment, - comment: 'comment', - }), - ]); - - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id, type: 'like' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(200); - expect(body.length).toBe(1); - expect(body[0]).toEqual(reaction); - }); - - it('should filter by userId', async () => { - const reaction = await createActivity({ albumId: album.id, type: ReactionType.Like }); - - const response1 = await request(app) - .get('/activities') - .query({ albumId: album.id, userId: uuidDto.notFound }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(response1.status).toEqual(200); - expect(response1.body.length).toBe(0); - - const response2 = await request(app) - .get('/activities') - .query({ albumId: album.id, userId: admin.userId }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(response2.status).toEqual(200); - expect(response2.body.length).toBe(1); - expect(response2.body[0]).toEqual(reaction); - }); - - it('should filter by assetId', async () => { - const [reaction] = await Promise.all([ - createActivity({ - albumId: album.id, - assetId: asset.id, - type: ReactionType.Like, - }), - createActivity({ albumId: album.id, type: ReactionType.Like }), - ]); - - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id, assetId: asset.id }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(200); - expect(body.length).toBe(1); - expect(body[0]).toEqual(reaction); - }); - }); - - describe('POST /activities', () => { - it('should add a comment to an album', async () => { - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - albumId: album.id, - type: 'comment', - comment: 'This is my first comment', - }); - expect(status).toEqual(201); - expect(body).toEqual({ - id: expect.any(String), - assetId: null, - createdAt: expect.any(String), - type: 'comment', - comment: 'This is my first comment', - user: expect.objectContaining({ email: admin.userEmail }), - }); - }); - - it('should add a like to an album', async () => { - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ albumId: album.id, type: 'like' }); - expect(status).toEqual(201); - expect(body).toEqual({ - id: expect.any(String), - assetId: null, - createdAt: expect.any(String), - type: 'like', - comment: null, - user: expect.objectContaining({ email: admin.userEmail }), - }); - }); - - it('should return a 200 for a duplicate like on the album', async () => { - const reaction = await createActivity({ albumId: album.id, type: ReactionType.Like }); - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ albumId: album.id, type: 'like' }); - expect(status).toEqual(200); - expect(body).toEqual(reaction); - }); - - it('should not confuse an album like with an asset like', async () => { - const reaction = await createActivity({ - albumId: album.id, - assetId: asset.id, - type: ReactionType.Like, - }); - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ albumId: album.id, type: 'like' }); - expect(status).toEqual(201); - expect(body.id).not.toEqual(reaction.id); - }); - - it('should add a comment to an asset', async () => { - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - albumId: album.id, - assetId: asset.id, - type: 'comment', - comment: 'This is my first comment', - }); - expect(status).toEqual(201); - expect(body).toEqual({ - id: expect.any(String), - assetId: asset.id, - createdAt: expect.any(String), - type: 'comment', - comment: 'This is my first comment', - user: expect.objectContaining({ email: admin.userEmail }), - }); - }); - - it('should add a like to an asset', async () => { - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ albumId: album.id, assetId: asset.id, type: 'like' }); - expect(status).toEqual(201); - expect(body).toEqual({ - id: expect.any(String), - assetId: asset.id, - createdAt: expect.any(String), - type: 'like', - comment: null, - user: expect.objectContaining({ email: admin.userEmail }), - }); - }); - - it('should return a 200 for a duplicate like on an asset', async () => { - const reaction = await createActivity({ - albumId: album.id, - assetId: asset.id, - type: ReactionType.Like, - }); - - const { status, body } = await request(app) - .post('/activities') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ albumId: album.id, assetId: asset.id, type: 'like' }); - expect(status).toEqual(200); - expect(body).toEqual(reaction); - }); - }); - - describe('DELETE /activities/:id', () => { - it('should remove a comment from an album', async () => { - const reaction = await createActivity({ - albumId: album.id, - type: ReactionType.Comment, - comment: 'This is a test comment', - }); - const { status } = await request(app) - .delete(`/activities/${reaction.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(204); - }); - - it('should remove a like from an album', async () => { - const reaction = await createActivity({ - albumId: album.id, - type: ReactionType.Like, - }); - const { status } = await request(app) - .delete(`/activities/${reaction.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(204); - }); - - it('should let the owner remove a comment by another user', async () => { - const reaction = await createActivity({ - albumId: album.id, - type: ReactionType.Comment, - comment: 'This is a test comment', - }); - - const { status } = await request(app) - .delete(`/activities/${reaction.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toEqual(204); - }); - - it('should not let a user remove a comment by another user', async () => { - const reaction = await createActivity({ - albumId: album.id, - type: ReactionType.Comment, - comment: 'This is a test comment', - }); - - const { status, body } = await request(app) - .delete(`/activities/${reaction.id}`) - .set('Authorization', `Bearer ${nonOwner.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no activity.delete access')); - }); - - it('should let a non-owner remove their own comment', async () => { - const reaction = await createActivity( - { - albumId: album.id, - type: ReactionType.Comment, - comment: 'This is a test comment', - }, - nonOwner.accessToken, - ); - - const { status } = await request(app) - .delete(`/activities/${reaction.id}`) - .set('Authorization', `Bearer ${nonOwner.accessToken}`); - - expect(status).toBe(204); - }); - - it('should return empty list when asset is removed', async () => { - const album3 = await createAlbum( - { - createAlbumDto: { - albumName: 'Album 3', - assetIds: [asset.id], - }, - }, - { headers: asBearerAuth(admin.accessToken) }, - ); - - await createActivity({ albumId: album3.id, assetId: asset.id, type: ReactionType.Like }); - - await removeAssetFromAlbum( - { - id: album3.id, - bulkIdsDto: { - ids: [asset.id], - }, - }, - { headers: asBearerAuth(admin.accessToken) }, - ); - - const { status, body } = await request(app) - .get('/activities') - .query({ albumId: album.id }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toEqual(200); - expect(body).toEqual([]); - }); - }); -}); diff --git a/e2e/src/api/specs/album.e2e-spec.ts b/e2e/src/api/specs/album.e2e-spec.ts deleted file mode 100644 index c4f06edd93..0000000000 --- a/e2e/src/api/specs/album.e2e-spec.ts +++ /dev/null @@ -1,721 +0,0 @@ -import { - addAssetsToAlbum, - AlbumResponseDto, - AlbumUserRole, - AssetMediaResponseDto, - AssetOrder, - deleteUserAdmin, - getAlbumInfo, - LoginResponseDto, - SharedLinkType, -} from '@immich/sdk'; -import { createUserDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -const user1SharedEditorUser = 'user1SharedEditorUser'; -const user1SharedViewerUser = 'user1SharedViewerUser'; -const user1SharedLink = 'user1SharedLink'; -const user1NotShared = 'user1NotShared'; -const user2SharedUser = 'user2SharedUser'; -const user2SharedLink = 'user2SharedLink'; -const user2NotShared = 'user2NotShared'; -const user4DeletedAsset = 'user4DeletedAsset'; -const user4Empty = 'user4Empty'; - -describe('/albums', () => { - let admin: LoginResponseDto; - let user1: LoginResponseDto; - let user1Asset1: AssetMediaResponseDto; - let user1Asset2: AssetMediaResponseDto; - let user4Asset1: AssetMediaResponseDto; - let user1Albums: AlbumResponseDto[]; - let user2: LoginResponseDto; - let user2Albums: AlbumResponseDto[]; - let deletedAssetAlbum: AlbumResponseDto; - let user3: LoginResponseDto; // deleted - let user4: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - - [user1, user2, user3, user4] = await Promise.all([ - utils.userSetup(admin.accessToken, createUserDto.user1), - utils.userSetup(admin.accessToken, createUserDto.user2), - utils.userSetup(admin.accessToken, createUserDto.user3), - utils.userSetup(admin.accessToken, createUserDto.user4), - ]); - - [user1Asset1, user1Asset2, user4Asset1] = await Promise.all([ - utils.createAsset(user1.accessToken, { isFavorite: true }), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - [user1Albums, user2Albums, deletedAssetAlbum] = await Promise.all([ - Promise.all([ - utils.createAlbum(user1.accessToken, { - albumName: user1SharedEditorUser, - albumUsers: [ - { userId: admin.userId, role: AlbumUserRole.Editor }, - { userId: user2.userId, role: AlbumUserRole.Editor }, - ], - assetIds: [user1Asset1.id], - }), - utils.createAlbum(user1.accessToken, { - albumName: user1SharedLink, - assetIds: [user1Asset1.id], - }), - utils.createAlbum(user1.accessToken, { - albumName: user1NotShared, - assetIds: [user1Asset1.id, user1Asset2.id], - }), - utils.createAlbum(user1.accessToken, { - albumName: user1SharedViewerUser, - albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Viewer }], - assetIds: [user1Asset1.id], - }), - ]), - Promise.all([ - utils.createAlbum(user2.accessToken, { - albumName: user2SharedUser, - albumUsers: [ - { userId: user1.userId, role: AlbumUserRole.Editor }, - { userId: user3.userId, role: AlbumUserRole.Editor }, - ], - }), - utils.createAlbum(user2.accessToken, { albumName: user2SharedLink }), - utils.createAlbum(user2.accessToken, { albumName: user2NotShared }), - ]), - utils.createAlbum(user4.accessToken, { albumName: user4DeletedAsset }), - utils.createAlbum(user4.accessToken, { albumName: user4Empty }), - utils.createAlbum(user3.accessToken, { - albumName: 'Deleted', - albumUsers: [{ userId: user1.userId, role: AlbumUserRole.Editor }], - }), - ]); - - await Promise.all([ - addAssetsToAlbum( - { id: user2Albums[0].id, bulkIdsDto: { ids: [user1Asset1.id, user1Asset2.id] } }, - { headers: asBearerAuth(user1.accessToken) }, - ), - addAssetsToAlbum( - { id: deletedAssetAlbum.id, bulkIdsDto: { ids: [user4Asset1.id] } }, - { headers: asBearerAuth(user4.accessToken) }, - ), - // add shared link to user1SharedLink album - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Album, - albumId: user1Albums[1].id, - }), - // add shared link to user2SharedLink album - utils.createSharedLink(user2.accessToken, { - type: SharedLinkType.Album, - albumId: user2Albums[1].id, - }), - ]); - - [user2Albums[0]] = await Promise.all([ - getAlbumInfo({ id: user2Albums[0].id }, { headers: asBearerAuth(user2.accessToken) }), - deleteUserAdmin({ id: user3.userId, userAdminDeleteDto: {} }, { headers: asBearerAuth(admin.accessToken) }), - utils.deleteAssets(user1.accessToken, [user4Asset1.id]), - ]); - }); - - describe('GET /albums', () => { - it("should not show other users' favorites", async () => { - const { status, body } = await request(app) - .get(`/albums/${user1Albums[0].id}?withoutAssets=false`) - .set('Authorization', `Bearer ${user2.accessToken}`); - expect(status).toEqual(200); - expect(body).toEqual({ - ...user1Albums[0], - assets: [expect.objectContaining({ isFavorite: false })], - contributorCounts: [{ userId: user1.userId, assetCount: 1 }], - lastModifiedAssetTimestamp: expect.any(String), - startDate: expect.any(String), - endDate: expect.any(String), - shared: true, - albumUsers: expect.any(Array), - }); - }); - - it('should not return shared albums with a deleted owner', async () => { - const { status, body } = await request(app) - .get('/albums?shared=true') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(4); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedLink, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedEditorUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedViewerUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user2.userId, - albumName: user2SharedUser, - shared: true, - }), - ]), - ); - }); - - it('should return the album collection including owned and shared', async () => { - const { status, body } = await request(app).get('/albums').set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(4); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedEditorUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedViewerUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedLink, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1NotShared, - shared: false, - }), - ]), - ); - }); - - it('should return the album collection filtered by shared', async () => { - const { status, body } = await request(app) - .get('/albums?shared=true') - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(4); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedEditorUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedViewerUser, - shared: true, - }), - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1SharedLink, - shared: true, - }), - expect.objectContaining({ - ownerId: user2.userId, - albumName: user2SharedUser, - shared: true, - }), - ]), - ); - }); - - it('should return the album collection filtered by NOT shared', async () => { - const { status, body } = await request(app) - .get('/albums?shared=false') - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(1); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - ownerId: user1.userId, - albumName: user1NotShared, - shared: false, - }), - ]), - ); - }); - - it('should return the album collection filtered by assetId', async () => { - const { status, body } = await request(app) - .get(`/albums?assetId=${user1Asset2.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(2); - }); - - it('should return the album collection filtered by assetId and ignores shared=true', async () => { - const { status, body } = await request(app) - .get(`/albums?shared=true&assetId=${user1Asset1.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(5); - }); - - it('should return the album collection filtered by assetId and ignores shared=false', async () => { - const { status, body } = await request(app) - .get(`/albums?shared=false&assetId=${user1Asset1.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(5); - }); - - it('should return empty albums and albums where all assets are deleted', async () => { - const { status, body } = await request(app).get('/albums').set('Authorization', `Bearer ${user4.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - ownerId: user4.userId, - albumName: user4DeletedAsset, - shared: false, - }), - expect.objectContaining({ - ownerId: user4.userId, - albumName: user4Empty, - shared: false, - }), - ]), - ); - }); - }); - - describe('GET /albums/:id', () => { - it('should return album info for own album', async () => { - const { status, body } = await request(app) - .get(`/albums/${user1Albums[0].id}?withoutAssets=false`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - ...user1Albums[0], - assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })], - contributorCounts: [{ userId: user1.userId, assetCount: 1 }], - lastModifiedAssetTimestamp: expect.any(String), - startDate: expect.any(String), - endDate: expect.any(String), - albumUsers: expect.any(Array), - shared: true, - }); - }); - - it('should return album info for shared album (editor)', async () => { - const { status, body } = await request(app) - .get(`/albums/${user2Albums[0].id}?withoutAssets=false`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ id: user2Albums[0].id }); - }); - - it('should return album info for shared album (viewer)', async () => { - const { status, body } = await request(app) - .get(`/albums/${user1Albums[3].id}?withoutAssets=false`) - .set('Authorization', `Bearer ${user2.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ id: user1Albums[3].id }); - }); - - it('should return album info with assets when withoutAssets is undefined', async () => { - const { status, body } = await request(app) - .get(`/albums/${user1Albums[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - ...user1Albums[0], - assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })], - contributorCounts: [{ userId: user1.userId, assetCount: 1 }], - lastModifiedAssetTimestamp: expect.any(String), - startDate: expect.any(String), - endDate: expect.any(String), - albumUsers: expect.any(Array), - shared: true, - }); - }); - - it('should return album info without assets when withoutAssets is true', async () => { - const { status, body } = await request(app) - .get(`/albums/${user1Albums[0].id}?withoutAssets=true`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - ...user1Albums[0], - assets: [], - contributorCounts: [{ userId: user1.userId, assetCount: 1 }], - assetCount: 1, - lastModifiedAssetTimestamp: expect.any(String), - endDate: expect.any(String), - startDate: expect.any(String), - albumUsers: expect.any(Array), - shared: true, - }); - }); - - it('should not count trashed assets', async () => { - await utils.deleteAssets(user1.accessToken, [user1Asset2.id]); - - const { status, body } = await request(app) - .get(`/albums/${user2Albums[0].id}?withoutAssets=true`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - ...user2Albums[0], - assets: [], - contributorCounts: [{ userId: user1.userId, assetCount: 1 }], - assetCount: 1, - lastModifiedAssetTimestamp: expect.any(String), - endDate: expect.any(String), - startDate: expect.any(String), - albumUsers: expect.any(Array), - shared: true, - }); - }); - }); - - describe('GET /albums/statistics', () => { - it('should return total count of albums the user has access to', async () => { - const { status, body } = await request(app) - .get('/albums/statistics') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ owned: 4, shared: 4, notShared: 1 }); - }); - }); - - describe('POST /albums', () => { - it('should create an album', async () => { - const { status, body } = await request(app) - .post('/albums') - .send({ albumName: 'New album' }) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(201); - expect(body).toEqual({ - id: expect.any(String), - createdAt: expect.any(String), - updatedAt: expect.any(String), - ownerId: user1.userId, - albumName: 'New album', - description: '', - albumThumbnailAssetId: null, - shared: false, - albumUsers: [], - hasSharedLink: false, - assets: [], - assetCount: 0, - owner: expect.objectContaining({ email: user1.userEmail }), - isActivityEnabled: true, - order: AssetOrder.Desc, - }); - }); - - it('should not be able to share album with owner', async () => { - const { status, body } = await request(app) - .post('/albums') - .send({ albumName: 'New album', albumUsers: [{ role: AlbumUserRole.Editor, userId: user1.userId }] }) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Cannot share album with owner')); - }); - }); - - describe('PUT /albums/:id/assets', () => { - it('should be able to add own asset to own album', async () => { - const asset = await utils.createAsset(user1.accessToken); - const { status, body } = await request(app) - .put(`/albums/${user1Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [asset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: asset.id, success: true })]); - }); - - it('should be able to add own asset to shared album', async () => { - const asset = await utils.createAsset(user1.accessToken); - const { status, body } = await request(app) - .put(`/albums/${user2Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [asset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: asset.id, success: true })]); - }); - - it('should not be able to add assets to album as a viewer', async () => { - const asset = await utils.createAsset(user2.accessToken); - const { status, body } = await request(app) - .put(`/albums/${user1Albums[3].id}/assets`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ ids: [asset.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.create access')); - }); - - it('should add duplicate assets only once', async () => { - const asset = await utils.createAsset(user1.accessToken); - const { status, body } = await request(app) - .put(`/albums/${user1Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [asset.id, asset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ id: asset.id, success: true }), - expect.objectContaining({ id: asset.id, success: false, error: 'duplicate' }), - ]); - }); - }); - - describe('PATCH /albums/:id', () => { - it('should update an album', async () => { - const album = await utils.createAlbum(user1.accessToken, { - albumName: 'New album', - }); - const { status, body } = await request(app) - .patch(`/albums/${album.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ - albumName: 'New album name', - description: 'An album description', - }); - expect(status).toBe(200); - expect(body).toEqual({ - ...album, - updatedAt: expect.any(String), - albumName: 'New album name', - description: 'An album description', - }); - }); - - it('should not be able to update as a viewer', async () => { - const { status, body } = await request(app) - .patch(`/albums/${user1Albums[3].id}`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ albumName: 'New album name' }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no album.update access')); - }); - - it('should not be able to update as an editor', async () => { - const { status, body } = await request(app) - .patch(`/albums/${user1Albums[0].id}`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ albumName: 'New album name' }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no album.update access')); - }); - }); - - describe('DELETE /albums/:id/assets', () => { - it('should require authorization', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user1Albums[1].id}/assets`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ ids: [user1Asset1.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should be able to remove foreign asset from owned album', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user2Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ ids: [user1Asset1.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ - id: user1Asset1.id, - success: true, - }), - ]); - }); - - it('should not be able to remove foreign asset from foreign album', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user1Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ ids: [user1Asset1.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ - id: user1Asset1.id, - success: false, - error: 'no_permission', - }), - ]); - }); - - it('should be able to remove own asset from own album', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user1Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [user1Asset1.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: user1Asset1.id, success: true })]); - }); - - it('should be able to remove own asset from shared album', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user2Albums[0].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [user1Asset2.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: user1Asset2.id, success: true })]); - }); - - it('should not be able to remove assets from album as a viewer', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user1Albums[3].id}/assets`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ ids: [user1Asset1.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no albumAsset.delete access')); - }); - - it('should remove duplicate assets only once', async () => { - const { status, body } = await request(app) - .delete(`/albums/${user1Albums[1].id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [user1Asset1.id, user1Asset1.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ id: user1Asset1.id, success: true }), - expect.objectContaining({ id: user1Asset1.id, success: false, error: 'not_found' }), - ]); - }); - }); - - describe('PUT :id/users', () => { - let album: AlbumResponseDto; - - beforeEach(async () => { - album = await utils.createAlbum(user1.accessToken, { - albumName: 'testAlbum', - }); - }); - - it('should be able to add user to own album', async () => { - const { status, body } = await request(app) - .put(`/albums/${album.id}/users`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Editor }] }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - albumUsers: [ - expect.objectContaining({ - user: expect.objectContaining({ id: user2.userId }), - }), - ], - }), - ); - }); - - it('should not be able to share album with owner', async () => { - const { status, body } = await request(app) - .put(`/albums/${album.id}/users`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ albumUsers: [{ userId: user1.userId, role: AlbumUserRole.Editor }] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Cannot be shared with owner')); - }); - - it('should not be able to add existing user to shared album', async () => { - await request(app) - .put(`/albums/${album.id}/users`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Editor }] }); - - const { status, body } = await request(app) - .put(`/albums/${album.id}/users`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Editor }] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('User already added')); - }); - }); - - describe('PUT :id/user/:userId', () => { - it('should allow the album owner to change the role of a shared user', async () => { - const album = await utils.createAlbum(user1.accessToken, { - albumName: 'testAlbum', - albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Viewer }], - }); - - expect(album.albumUsers[0].role).toEqual(AlbumUserRole.Viewer); - - const { status } = await request(app) - .put(`/albums/${album.id}/user/${user2.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ role: AlbumUserRole.Editor }); - - expect(status).toBe(204); - - // Get album to verify the role change - const { body } = await request(app) - .get(`/albums/${album.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(body).toEqual( - expect.objectContaining({ - albumUsers: [expect.objectContaining({ role: AlbumUserRole.Editor })], - }), - ); - }); - - it('should not allow a shared user to change the role of another shared user', async () => { - const album = await utils.createAlbum(user1.accessToken, { - albumName: 'testAlbum', - albumUsers: [{ userId: user2.userId, role: AlbumUserRole.Viewer }], - }); - - expect(album.albumUsers[0].role).toEqual(AlbumUserRole.Viewer); - - const { status, body } = await request(app) - .put(`/albums/${album.id}/user/${user2.userId}`) - .set('Authorization', `Bearer ${user2.accessToken}`) - .send({ role: AlbumUserRole.Editor }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no album.share access')); - }); - }); -}); diff --git a/e2e/src/api/specs/api-key.e2e-spec.ts b/e2e/src/api/specs/api-key.e2e-spec.ts index 28d134a664..5b13c8906d 100644 --- a/e2e/src/api/specs/api-key.e2e-spec.ts +++ b/e2e/src/api/specs/api-key.e2e-spec.ts @@ -1,4 +1,4 @@ -import { LoginResponseDto, Permission, createApiKey } from '@immich/sdk'; +import { LoginResponseDto, Permission, createApiKey } from '@server/sdk'; import { createUserDto } from 'src/fixtures'; import { errorDto } from 'src/responses'; import { app, asBearerAuth, utils } from 'src/utils'; diff --git a/e2e/src/api/specs/asset.e2e-spec.ts b/e2e/src/api/specs/asset.e2e-spec.ts deleted file mode 100644 index d4eee16232..0000000000 --- a/e2e/src/api/specs/asset.e2e-spec.ts +++ /dev/null @@ -1,1242 +0,0 @@ -import { - AssetMediaResponseDto, - AssetMediaStatus, - AssetResponseDto, - AssetTypeEnum, - AssetVisibility, - getAssetInfo, - getMyUser, - LoginResponseDto, - SharedLinkType, - updateConfig, -} from '@immich/sdk'; -import { exiftool } from 'exiftool-vendored'; -import { DateTime } from 'luxon'; -import { randomBytes } from 'node:crypto'; -import { readFile, writeFile } from 'node:fs/promises'; -import { basename, join } from 'node:path'; -import { Socket } from 'socket.io-client'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { makeRandomImage } from 'src/generators'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, tempDir, TEN_TIMES, testAssetDir, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; - -const locationAssetFilepath = `${testAssetDir}/metadata/gps-position/thompson-springs.jpg`; -const ratingAssetFilepath = `${testAssetDir}/metadata/rating/mongolels.jpg`; -const facesAssetDir = `${testAssetDir}/metadata/faces`; - -const readTags = async (bytes: Buffer, filename: string) => { - const filepath = join(tempDir, filename); - await writeFile(filepath, bytes); - return exiftool.read(filepath); -}; - -const today = DateTime.fromObject({ - year: 2023, - month: 11, - day: 3, -}) as DateTime; -const yesterday = today.minus({ days: 1 }); - -describe('/asset', () => { - let admin: LoginResponseDto; - let websocket: Socket; - - let user1: LoginResponseDto; - let user2: LoginResponseDto; - let timeBucketUser: LoginResponseDto; - let quotaUser: LoginResponseDto; - let statsUser: LoginResponseDto; - - let user1Assets: AssetMediaResponseDto[]; - let user2Assets: AssetMediaResponseDto[]; - let locationAsset: AssetMediaResponseDto; - let ratingAsset: AssetMediaResponseDto; - - const setupTests = async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - - [websocket, user1, user2, statsUser, quotaUser, timeBucketUser] = await Promise.all([ - utils.connectWebsocket(admin.accessToken), - utils.userSetup(admin.accessToken, createUserDto.create('1')), - utils.userSetup(admin.accessToken, createUserDto.create('2')), - utils.userSetup(admin.accessToken, createUserDto.create('stats')), - utils.userSetup(admin.accessToken, createUserDto.userQuota), - utils.userSetup(admin.accessToken, createUserDto.create('time-bucket')), - ]); - - await utils.createPartner(user1.accessToken, user2.userId); - - // asset location - locationAsset = await utils.createAsset(admin.accessToken, { - assetData: { - filename: 'thompson-springs.jpg', - bytes: await readFile(locationAssetFilepath), - }, - }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: locationAsset.id }); - - // asset rating - ratingAsset = await utils.createAsset(admin.accessToken, { - assetData: { - filename: 'mongolels.jpg', - bytes: await readFile(ratingAssetFilepath), - }, - }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: ratingAsset.id }); - - user1Assets = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken, { - isFavorite: true, - fileCreatedAt: yesterday.toISO(), - fileModifiedAt: yesterday.toISO(), - assetData: { filename: 'example.mp4' }, - }), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - user2Assets = [await utils.createAsset(user2.accessToken)]; - - await Promise.all([ - utils.createAsset(timeBucketUser.accessToken, { fileCreatedAt: new Date('1970-01-01').toISOString() }), - utils.createAsset(timeBucketUser.accessToken, { fileCreatedAt: new Date('1970-02-10').toISOString() }), - utils.createAsset(timeBucketUser.accessToken, { fileCreatedAt: new Date('1970-02-11').toISOString() }), - utils.createAsset(timeBucketUser.accessToken, { fileCreatedAt: new Date('1970-02-11').toISOString() }), - ]); - - for (const asset of [...user1Assets, ...user2Assets]) { - expect(asset.status).toBe(AssetMediaStatus.Created); - } - - await Promise.all([ - // stats - utils.createAsset(statsUser.accessToken), - utils.createAsset(statsUser.accessToken, { isFavorite: true }), - utils.createAsset(statsUser.accessToken, { visibility: AssetVisibility.Archive }), - utils.createAsset(statsUser.accessToken, { - visibility: AssetVisibility.Archive, - isFavorite: true, - assetData: { filename: 'example.mp4' }, - }), - ]); - - const person1 = await utils.createPerson(user1.accessToken, { - name: 'Test Person', - }); - await utils.createFace({ - assetId: user1Assets[0].id, - personId: person1.id, - }); - }; - beforeAll(setupTests, 30_000); - - afterAll(() => { - utils.disconnectWebsocket(websocket); - }); - - describe('GET /assets/:id/original', () => { - it('should download the file', async () => { - const response = await request(app) - .get(`/assets/${user1Assets[0].id}/original`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(response.status).toBe(200); - expect(response.headers['content-type']).toEqual('image/png'); - }); - }); - - describe('GET /assets/:id', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .get(`/assets/${user2Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should get the asset info', async () => { - const { status, body } = await request(app) - .get(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: user1Assets[0].id }); - }); - - it('should get the asset rating', async () => { - await utils.waitForWebsocketEvent({ - event: 'assetUpload', - id: ratingAsset.id, - }); - - const { status, body } = await request(app) - .get(`/assets/${ratingAsset.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ - id: ratingAsset.id, - exifInfo: expect.objectContaining({ rating: 3 }), - }); - }); - - describe('faces', () => { - const metadataFaceTests = [ - { - description: 'without orientation', - filename: 'portrait.jpg', - }, - { - description: 'adjusting face regions to orientation', - filename: 'portrait-orientation-6.jpg', - }, - ]; - // should produce same resulting face region coordinates for any orientation - const expectedFaces = [ - { - name: 'Marie Curie', - birthDate: null, - isHidden: false, - faces: [ - { - imageHeight: 700, - imageWidth: 840, - boundingBoxX1: 261, - boundingBoxX2: 356, - boundingBoxY1: 146, - boundingBoxY2: 284, - sourceType: 'exif', - }, - ], - }, - { - name: 'Pierre Curie', - birthDate: null, - isHidden: false, - faces: [ - { - imageHeight: 700, - imageWidth: 840, - boundingBoxX1: 536, - boundingBoxX2: 618, - boundingBoxY1: 83, - boundingBoxY2: 252, - sourceType: 'exif', - }, - ], - }, - ]; - - it.each(metadataFaceTests)('should get the asset faces from $filename $description', async ({ filename }) => { - const config = await utils.getSystemConfig(admin.accessToken); - config.metadata.faces.import = true; - await updateConfig({ systemConfigDto: config }, { headers: asBearerAuth(admin.accessToken) }); - - const facesAsset = await utils.createAsset(admin.accessToken, { - assetData: { - filename, - bytes: await readFile(`${facesAssetDir}/${filename}`), - }, - }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: facesAsset.id }); - - const { status, body } = await request(app) - .get(`/assets/${facesAsset.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body.id).toEqual(facesAsset.id); - expect(body.people).toMatchObject(expectedFaces); - }); - }); - - it('should work with a shared link', async () => { - const sharedLink = await utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Individual, - assetIds: [user1Assets[0].id], - }); - - const { status, body } = await request(app).get(`/assets/${user1Assets[0].id}?key=${sharedLink.key}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: user1Assets[0].id }); - }); - - it('should not send people data for shared links for un-authenticated users', async () => { - const { status, body } = await request(app) - .get(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toEqual(200); - expect(body).toMatchObject({ - id: user1Assets[0].id, - isFavorite: false, - people: [ - { - birthDate: null, - id: expect.any(String), - isHidden: false, - name: 'Test Person', - thumbnailPath: '/my/awesome/thumbnail.jpg', - }, - ], - }); - - const sharedLink = await utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Individual, - assetIds: [user1Assets[0].id], - }); - - const data = await request(app).get(`/assets/${user1Assets[0].id}?key=${sharedLink.key}`); - expect(data.status).toBe(200); - expect(data.body).toMatchObject({ people: [] }); - }); - - describe('partner assets', () => { - it('should get the asset info', async () => { - const { status, body } = await request(app) - .get(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user2.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: user1Assets[0].id }); - }); - - it('disallows viewing archived assets', async () => { - const asset = await utils.createAsset(user1.accessToken, { visibility: AssetVisibility.Archive }); - - const { status } = await request(app) - .get(`/assets/${asset.id}`) - .set('Authorization', `Bearer ${user2.accessToken}`); - expect(status).toBe(400); - }); - - it('disallows viewing trashed assets', async () => { - const asset = await utils.createAsset(user1.accessToken); - await utils.deleteAssets(user1.accessToken, [asset.id]); - - const { status } = await request(app) - .get(`/assets/${asset.id}`) - .set('Authorization', `Bearer ${user2.accessToken}`); - expect(status).toBe(400); - }); - }); - }); - - describe('GET /assets/statistics', () => { - it('should return stats of all assets', async () => { - const { status, body } = await request(app) - .get('/assets/statistics') - .set('Authorization', `Bearer ${statsUser.accessToken}`); - - expect(body).toEqual({ images: 3, videos: 1, total: 4 }); - expect(status).toBe(200); - }); - - it('should return stats of all favored assets', async () => { - const { status, body } = await request(app) - .get('/assets/statistics') - .set('Authorization', `Bearer ${statsUser.accessToken}`) - .query({ isFavorite: true }); - - expect(status).toBe(200); - expect(body).toEqual({ images: 1, videos: 1, total: 2 }); - }); - - it('should return stats of all archived assets', async () => { - const { status, body } = await request(app) - .get('/assets/statistics') - .set('Authorization', `Bearer ${statsUser.accessToken}`) - .query({ visibility: AssetVisibility.Archive }); - - expect(status).toBe(200); - expect(body).toEqual({ images: 1, videos: 1, total: 2 }); - }); - - it('should return stats of all favored and archived assets', async () => { - const { status, body } = await request(app) - .get('/assets/statistics') - .set('Authorization', `Bearer ${statsUser.accessToken}`) - .query({ isFavorite: true, visibility: AssetVisibility.Archive }); - - expect(status).toBe(200); - expect(body).toEqual({ images: 0, videos: 1, total: 1 }); - }); - - it('should return stats of all assets neither favored nor archived', async () => { - const { status, body } = await request(app) - .get('/assets/statistics') - .set('Authorization', `Bearer ${statsUser.accessToken}`) - .query({ isFavorite: false, visibility: AssetVisibility.Timeline }); - - expect(status).toBe(200); - expect(body).toEqual({ images: 1, videos: 0, total: 1 }); - }); - }); - - describe('GET /assets/random', () => { - beforeAll(async () => { - await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - await utils.waitForQueueFinish(admin.accessToken, 'thumbnailGeneration'); - }); - - it.each(TEN_TIMES)('should return 1 random assets', async () => { - const { status, body } = await request(app) - .get('/assets/random') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - - const assets: AssetResponseDto[] = body; - expect(assets.length).toBe(1); - expect(assets[0].ownerId).toBe(user1.userId); - }); - - it.each(TEN_TIMES)('should return 2 random assets', async () => { - const { status, body } = await request(app) - .get('/assets/random?count=2') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - - const assets: AssetResponseDto[] = body; - expect(assets.length).toBe(2); - - for (const asset of assets) { - expect(asset.ownerId).toBe(user1.userId); - } - }); - - it.skip('should return 1 asset if there are 10 assets in the database but user 2 only has 1', async () => { - const { status, body } = await request(app) - .get('/assets/random') - .set('Authorization', `Bearer ${user2.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: user2Assets[0].id })]); - }); - }); - - describe('PUT /assets/:id', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .put(`/assets/${user2Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should favorite an asset', async () => { - const before = await utils.getAssetInfo(user1.accessToken, user1Assets[0].id); - expect(before.isFavorite).toBe(false); - - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ isFavorite: true }); - expect(body).toMatchObject({ id: user1Assets[0].id, isFavorite: true }); - expect(status).toEqual(200); - }); - - it('should archive an asset', async () => { - const before = await utils.getAssetInfo(user1.accessToken, user1Assets[0].id); - expect(before.isArchived).toBe(false); - - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ visibility: AssetVisibility.Archive }); - expect(body).toMatchObject({ id: user1Assets[0].id, isArchived: true }); - expect(status).toEqual(200); - }); - - it('should update date time original', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ dateTimeOriginal: '2023-11-19T18:11:00.000-07:00' }); - - expect(body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ - dateTimeOriginal: '2023-11-20T01:11:00+00:00', - timeZone: 'UTC-7', - }), - }); - expect(status).toEqual(200); - }); - - it('should not allow linking two photos', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ livePhotoVideoId: user1Assets[1].id }); - - expect(body).toEqual(errorDto.badRequest('Live photo video must be a video')); - expect(status).toEqual(400); - }); - - it('should not allow linking a video owned by another user', async () => { - const asset = await utils.createAsset(user2.accessToken, { assetData: { filename: 'example.mp4' } }); - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ livePhotoVideoId: asset.id }); - - expect(body).toEqual(errorDto.badRequest('Live photo video does not belong to the user')); - expect(status).toEqual(400); - }); - - it('should link a motion photo', async () => { - const asset = await utils.createAsset(user1.accessToken, { assetData: { filename: 'example.mp4' } }); - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ livePhotoVideoId: asset.id }); - - expect(status).toEqual(200); - expect(body).toMatchObject({ id: user1Assets[0].id, livePhotoVideoId: asset.id }); - }); - - it('should unlink a motion photo', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ livePhotoVideoId: null }); - - expect(status).toEqual(200); - expect(body).toMatchObject({ id: user1Assets[0].id, livePhotoVideoId: null }); - }); - - it.skip('should update date time original when sidecar file contains DateTimeOriginal', async () => { - const sidecarData = ` - - - - 0220 2024-07-11T10:32:52Z - 2.3.0.0 - - - -`; - - const { id } = await utils.createAsset(user1.accessToken, { - sidecarData: { - bytes: Buffer.from(sidecarData), - filename: 'example.xmp', - }, - }); - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - const assetInfo = await utils.getAssetInfo(user1.accessToken, id); - expect(assetInfo.exifInfo?.dateTimeOriginal).toBe('2024-07-11T10:32:52+00:00'); - - const { status, body } = await request(app) - .put(`/assets/${id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ dateTimeOriginal: '2023-11-19T18:11:00.000-07:00' }); - - expect(body).toMatchObject({ - id, - exifInfo: expect.objectContaining({ - dateTimeOriginal: '2023-11-20T01:11:00+00:00', - }), - }); - expect(status).toEqual(200); - }); - - it('should update gps data', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ latitude: 12, longitude: 12 }); - - expect(body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ latitude: 12, longitude: 12 }), - }); - expect(status).toEqual(200); - }); - - it.skip('should geocode country from gps data in the middle of nowhere', async () => { - const { status } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ latitude: 42, longitude: 69 }); - expect(status).toEqual(200); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - const asset = await getAssetInfo({ id: user1Assets[0].id }, { headers: asBearerAuth(user1.accessToken) }); - expect(asset).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ city: null, country: 'Kazakhstan' }), - }); - }); - - it('should set the description', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ description: 'Test asset description' }); - expect(body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ - description: 'Test asset description', - }), - }); - expect(status).toEqual(200); - }); - - it('should set the rating', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ rating: 2 }); - expect(body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ - rating: 2, - }), - }); - expect(status).toEqual(200); - }); - - it('should set the negative rating', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ rating: -1 }); - expect(body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ - rating: -1, - }), - }); - expect(status).toEqual(200); - }); - - it('should return tagged people', async () => { - const { status, body } = await request(app) - .put(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ isFavorite: true }); - expect(status).toEqual(200); - expect(body).toMatchObject({ - id: user1Assets[0].id, - isFavorite: true, - people: [ - { - birthDate: null, - id: expect.any(String), - isHidden: false, - name: 'Test Person', - thumbnailPath: '/my/awesome/thumbnail.jpg', - }, - ], - }); - }); - }); - - describe('DELETE /assets', () => { - it('should throw an error when the id is not found', async () => { - const { status, body } = await request(app) - .delete(`/assets`) - .send({ ids: [uuidDto.notFound] }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no asset.delete access')); - }); - - it('should move an asset to trash', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - - const before = await utils.getAssetInfo(admin.accessToken, assetId); - expect(before.isTrashed).toBe(false); - - const { status } = await request(app) - .delete('/assets') - .send({ ids: [assetId] }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(204); - - const after = await utils.getAssetInfo(admin.accessToken, assetId); - expect(after.isTrashed).toBe(true); - }); - - it('should permanently delete an asset from trash', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - - { - const { status } = await request(app) - .delete('/assets') - .send({ ids: [assetId] }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(204); - } - - const trashed = await utils.getAssetInfo(admin.accessToken, assetId); - expect(trashed.isTrashed).toBe(true); - - { - const { status } = await request(app) - .delete('/assets') - .send({ ids: [assetId], force: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(204); - } - - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: assetId }); - - { - const { status } = await request(app) - .get(`/assets/${assetId}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - } - }); - - it('should clean up live photos', async () => { - const { id: motionId } = await utils.createAsset(admin.accessToken, { - assetData: { filename: 'test.mp4', bytes: makeRandomImage() }, - }); - const { id: photoId } = await utils.createAsset(admin.accessToken, { livePhotoVideoId: motionId }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: photoId }); - await utils.waitForWebsocketEvent({ event: 'assetHidden', id: motionId }); - - const asset = await utils.getAssetInfo(admin.accessToken, photoId); - expect(asset.livePhotoVideoId).toBe(motionId); - - const { status } = await request(app) - .delete('/assets') - .send({ ids: [photoId], force: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(204); - - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: photoId }); - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: motionId }); - }); - - it('should not delete a shared motion asset', async () => { - const { id: motionId } = await utils.createAsset(admin.accessToken, { - assetData: { filename: 'test.mp4', bytes: makeRandomImage() }, - }); - const { id: asset1 } = await utils.createAsset(admin.accessToken, { livePhotoVideoId: motionId }); - const { id: asset2 } = await utils.createAsset(admin.accessToken, { livePhotoVideoId: motionId }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: asset1 }); - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: asset2 }); - await utils.waitForWebsocketEvent({ event: 'assetHidden', id: motionId }); - - const asset = await utils.getAssetInfo(admin.accessToken, asset1); - expect(asset.livePhotoVideoId).toBe(motionId); - - const { status } = await request(app) - .delete('/assets') - .send({ ids: [asset1], force: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(204); - - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: asset1 }); - await utils.waitForQueueFinish(admin.accessToken, 'backgroundTask'); - - await expect(utils.getAssetInfo(admin.accessToken, motionId)).resolves.toMatchObject({ id: motionId }); - await expect(utils.getAssetInfo(admin.accessToken, asset2)).resolves.toMatchObject({ - id: asset2, - livePhotoVideoId: motionId, - }); - }); - }); - - describe('GET /assets/:id/thumbnail', () => { - it('should not include gps data for webp thumbnails', async () => { - await utils.waitForWebsocketEvent({ - event: 'assetUpload', - id: locationAsset.id, - }); - - const { status, body, type } = await request(app) - .get(`/assets/${locationAsset.id}/thumbnail?format=WEBP`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toBeDefined(); - expect(type).toBe('image/webp'); - - const exifData = await readTags(body, 'thumbnail.webp'); - expect(exifData).not.toHaveProperty('GPSLongitude'); - expect(exifData).not.toHaveProperty('GPSLatitude'); - }); - - it('should not include gps data for jpeg previews', async () => { - const { status, body, type } = await request(app) - .get(`/assets/${locationAsset.id}/thumbnail?size=preview`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toBeDefined(); - expect(type).toBe('image/jpeg'); - - const exifData = await readTags(body, 'thumbnail.jpg'); - expect(exifData).not.toHaveProperty('GPSLongitude'); - expect(exifData).not.toHaveProperty('GPSLatitude'); - }); - }); - - describe('GET /assets/:id/original', () => { - it('should download the original', async () => { - const { status, body, type } = await request(app) - .get(`/assets/${locationAsset.id}/original`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toBeDefined(); - expect(type).toBe('image/jpeg'); - - const asset = await utils.getAssetInfo(admin.accessToken, locationAsset.id); - - const original = await readFile(locationAssetFilepath); - const originalChecksum = utils.sha1(original); - const downloadChecksum = utils.sha1(body); - - expect(originalChecksum).toBe(downloadChecksum); - expect(downloadChecksum).toBe(asset.checksum); - }); - }); - - describe('PUT /assets', () => { - it('should update date time original relatively', async () => { - const { status, body } = await request(app) - .put(`/assets/`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ ids: [user1Assets[0].id], dateTimeRelative: -1441 }); - - expect(body).toEqual({}); - expect(status).toEqual(204); - - const result = await request(app) - .get(`/assets/${user1Assets[0].id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send(); - - expect(result.body).toMatchObject({ - id: user1Assets[0].id, - exifInfo: expect.objectContaining({ - dateTimeOriginal: '2023-11-19T01:10:00+00:00', - }), - }); - }); - }); - - describe('POST /assets', () => { - beforeAll(setupTests, 30_000); - - const tests = [ - { - input: 'formats/avif/8bit-sRGB.avif', - expected: { - type: AssetTypeEnum.Image, - originalFileName: '8bit-sRGB.avif', - exifInfo: { - description: '', - exifImageHeight: 1080, - exifImageWidth: 1617, - fileSizeInByte: 862_424, - }, - }, - }, - { - input: 'formats/jpg/el_torcal_rocks.jpg', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'el_torcal_rocks.jpg', - exifInfo: { - dateTimeOriginal: '2012-08-05T11:39:59+00:00', - exifImageWidth: 512, - exifImageHeight: 341, - focalLength: 75, - iso: 200, - fNumber: 11, - exposureTime: '1/160', - fileSizeInByte: 53_493, - make: 'SONY', - model: 'DSLR-A550', - description: 'SONY DSC', - }, - }, - }, - { - input: 'formats/jxl/8bit-sRGB.jxl', - expected: { - type: AssetTypeEnum.Image, - originalFileName: '8bit-sRGB.jxl', - exifInfo: { - description: '', - exifImageHeight: 1080, - exifImageWidth: 1440, - fileSizeInByte: 1_780_777, - }, - }, - }, - { - input: 'formats/heic/IMG_2682.heic', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'IMG_2682.heic', - fileCreatedAt: '2019-03-21T16:04:22.348Z', - exifInfo: { - dateTimeOriginal: '2019-03-21T16:04:22.348+00:00', - exifImageWidth: 4032, - exifImageHeight: 3024, - latitude: 41.2203, - longitude: -96.071_625, - make: 'Apple', - model: 'iPhone 7', - lensModel: 'iPhone 7 back camera 3.99mm f/1.8', - fileSizeInByte: 880_703, - exposureTime: '1/887', - iso: 20, - focalLength: 3.99, - fNumber: 1.8, - timeZone: 'America/Chicago', - }, - }, - }, - { - input: 'formats/png/density_plot.png', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'density_plot.png', - exifInfo: { - exifImageWidth: 800, - exifImageHeight: 800, - fileSizeInByte: 25_408, - }, - }, - }, - { - input: 'formats/raw/Nikon/D80/glarus.nef', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'glarus.nef', - fileCreatedAt: '2010-07-20T17:27:12.000Z', - exifInfo: { - make: 'NIKON CORPORATION', - model: 'NIKON D80', - exposureTime: '1/200', - fNumber: 10, - focalLength: 18, - iso: 100, - fileSizeInByte: 9_057_784, - dateTimeOriginal: '2010-07-20T17:27:12+00:00', - orientation: '1', - }, - }, - }, - { - input: 'formats/raw/Nikon/D700/philadelphia.nef', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'philadelphia.nef', - fileCreatedAt: '2016-09-22T21:10:29.060Z', - exifInfo: { - make: 'NIKON CORPORATION', - model: 'NIKON D700', - exposureTime: '1/400', - fNumber: 11, - focalLength: 85, - iso: 200, - fileSizeInByte: 15_856_335, - dateTimeOriginal: '2016-09-22T21:10:29.06+00:00', - orientation: '1', - timeZone: 'UTC-4', - }, - }, - }, - { - input: 'formats/raw/Panasonic/DMC-GH4/4_3.rw2', - expected: { - type: AssetTypeEnum.Image, - originalFileName: '4_3.rw2', - fileCreatedAt: '2018-05-10T08:42:37.842Z', - exifInfo: { - make: 'Panasonic', - model: 'DMC-GH4', - exifImageHeight: 3456, - exifImageWidth: 4608, - exposureTime: '1/100', - fNumber: 3.2, - focalLength: 35, - iso: 400, - fileSizeInByte: 19_587_072, - dateTimeOriginal: '2018-05-10T08:42:37.842+00:00', - orientation: '1', - }, - }, - }, - { - input: 'formats/raw/Sony/ILCE-6300/12bit-compressed-(3_2).arw', - expected: { - type: AssetTypeEnum.Image, - originalFileName: '12bit-compressed-(3_2).arw', - fileCreatedAt: '2016-09-27T10:51:44.000Z', - exifInfo: { - make: 'SONY', - model: 'ILCE-6300', - exifImageHeight: 4024, - exifImageWidth: 6048, - exposureTime: '1/320', - fNumber: 8, - focalLength: 97, - iso: 100, - lensModel: 'Sony E PZ 18-105mm F4 G OSS', - fileSizeInByte: 25_001_984, - dateTimeOriginal: '2016-09-27T10:51:44+00:00', - orientation: '1', - }, - }, - }, - { - input: 'formats/raw/Sony/ILCE-7M2/14bit-uncompressed-(3_2).arw', - expected: { - type: AssetTypeEnum.Image, - originalFileName: '14bit-uncompressed-(3_2).arw', - fileCreatedAt: '2016-01-08T14:08:01.000Z', - exifInfo: { - make: 'SONY', - model: 'ILCE-7M2', - exifImageHeight: 4024, - exifImageWidth: 6048, - exposureTime: '1.3', - fNumber: 22, - focalLength: 25, - iso: 100, - lensModel: 'Zeiss Batis 25mm F2', - fileSizeInByte: 49_512_448, - dateTimeOriginal: '2016-01-08T14:08:01+00:00', - orientation: '1', - }, - }, - }, - { - input: 'formats/raw/Canon/PowerShot_G12.CR2', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'PowerShot_G12.CR2', - fileCreatedAt: '2015-12-27T09:55:40.000Z', - exifInfo: { - make: 'Canon', - model: 'Canon PowerShot G12', - exifImageHeight: 2736, - exifImageWidth: 3648, - exposureTime: '1/1000', - fNumber: 4, - focalLength: 18.098, - iso: 80, - lensModel: null, - fileSizeInByte: 11_113_617, - dateTimeOriginal: '2015-12-27T09:55:40+00:00', - latitude: null, - longitude: null, - orientation: '1', - }, - }, - }, - { - input: 'formats/raw/Fujifilm/X100V_compressed.RAF', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'X100V_compressed.RAF', - fileCreatedAt: '2024-10-12T21:01:01.000Z', - exifInfo: { - make: 'FUJIFILM', - model: 'X100V', - exifImageHeight: 4160, - exifImageWidth: 6240, - exposureTime: '1/4000', - fNumber: 16, - focalLength: 23, - iso: 160, - lensModel: null, - fileSizeInByte: 13_551_312, - dateTimeOriginal: '2024-10-12T21:01:01+00:00', - latitude: null, - longitude: null, - orientation: '6', - }, - }, - }, - { - input: 'formats/raw/Ricoh/GR3/Ricoh_GR3-450.DNG', - expected: { - type: AssetTypeEnum.Image, - originalFileName: 'Ricoh_GR3-450.DNG', - fileCreatedAt: '2024-06-08T13:48:39.000Z', - exifInfo: { - dateTimeOriginal: '2024-06-08T13:48:39+00:00', - exifImageHeight: 4064, - exifImageWidth: 6112, - exposureTime: '1/400', - fNumber: 5, - fileSizeInByte: 31_175_472, - focalLength: 18.3, - iso: 100, - latitude: 36.613_24, - lensModel: '18.3mm F2.8', - longitude: -121.897_85, - make: 'RICOH IMAGING COMPANY, LTD.', - model: 'RICOH GR III', - orientation: '1', - }, - }, - }, - ]; - - it.each(tests)(`should upload and generate a thumbnail for different file types`, async ({ input, expected }) => { - const filepath = join(testAssetDir, input); - const response = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(filepath), filename: basename(filepath) }, - }); - - expect(response.status).toBe(AssetMediaStatus.Created); - const id = response.id; - // longer timeout as the thumbnail generation from full-size raw files can take a while - await utils.waitForWebsocketEvent({ event: 'assetUpload', id }); - - const asset = await utils.getAssetInfo(admin.accessToken, id); - expect(asset.exifInfo).toBeDefined(); - expect(asset.exifInfo).toMatchObject(expected.exifInfo); - expect(asset).toMatchObject(expected); - }); - - it('should handle a duplicate', async () => { - const filepath = 'formats/jpeg/el_torcal_rocks.jpeg'; - const { status } = await utils.createAsset(admin.accessToken, { - assetData: { - bytes: await readFile(join(testAssetDir, filepath)), - filename: basename(filepath), - }, - }); - - expect(status).toBe(AssetMediaStatus.Duplicate); - }); - - it('should update the used quota', async () => { - const { body, status } = await request(app) - .post('/assets') - .set('Authorization', `Bearer ${quotaUser.accessToken}`) - .field('deviceAssetId', 'example-image') - .field('deviceId', 'e2e') - .field('fileCreatedAt', new Date().toISOString()) - .field('fileModifiedAt', new Date().toISOString()) - .attach('assetData', makeRandomImage(), 'example.jpg'); - - expect(body).toEqual({ id: expect.any(String), status: AssetMediaStatus.Created }); - expect(status).toBe(201); - - const user = await getMyUser({ headers: asBearerAuth(quotaUser.accessToken) }); - - expect(user).toEqual(expect.objectContaining({ quotaUsageInBytes: 70 })); - }); - - it('should not upload an asset if it would exceed the quota', async () => { - const { body, status } = await request(app) - .post('/assets') - .set('Authorization', `Bearer ${quotaUser.accessToken}`) - .field('deviceAssetId', 'example-image') - .field('deviceId', 'e2e') - .field('fileCreatedAt', new Date().toISOString()) - .field('fileModifiedAt', new Date().toISOString()) - .attach('assetData', randomBytes(2014), 'example.jpg'); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Quota has been exceeded!')); - }); - - // These hashes were created by copying the image files to a Samsung phone, - // exporting the video from Samsung's stock Gallery app, and hashing them locally. - // This ensures that immich+exiftool are extracting the videos the same way Samsung does. - // DO NOT assume immich+exiftool are doing things correctly and just copy whatever hash it gives - // into the test here. - it.each([ - { - filepath: 'formats/motionphoto/samsung-one-ui-5.jpg', - checksum: 'fr14niqCq6N20HB8rJYEvpsUVtI=', - }, - { - filepath: 'formats/motionphoto/samsung-one-ui-6.jpg', - checksum: 'lT9Uviw/FFJYCjfIxAGPTjzAmmw=', - }, - { - filepath: 'formats/motionphoto/samsung-one-ui-6.heic', - checksum: '/ejgzywvgvzvVhUYVfvkLzFBAF0=', - }, - { - filepath: 'formats/motionphoto/pixel-6-pro.jpg', - checksum: 'bFhLGbdK058PSk4FTfrSnoKWykc=', - }, - { - filepath: 'formats/motionphoto/pixel-8a.jpg', - checksum: '7YdY+WF0h+CXHbiXpi0HiCMTTjs=', - }, - ])(`should extract motionphoto video from $filepath`, async ({ filepath, checksum }) => { - const response = await utils.createAsset(admin.accessToken, { - assetData: { - bytes: await readFile(join(testAssetDir, filepath)), - filename: basename(filepath), - }, - }); - - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: response.id }); - - expect(response.status).toBe(AssetMediaStatus.Created); - - const asset = await utils.getAssetInfo(admin.accessToken, response.id); - expect(asset.livePhotoVideoId).toBeDefined(); - - const video = await utils.getAssetInfo(admin.accessToken, asset.livePhotoVideoId as string); - expect(video.checksum).toStrictEqual(checksum); - }); - }); - - describe('POST /assets/exist', () => { - it('ignores invalid deviceAssetIds', async () => { - const response = await utils.checkExistingAssets(user1.accessToken, { - deviceId: 'test-assets-exist', - deviceAssetIds: ['invalid', 'INVALID'], - }); - - expect(response.existingIds).toHaveLength(0); - }); - - it('returns the IDs of existing assets', async () => { - await utils.createAsset(user1.accessToken, { - deviceId: 'test-assets-exist', - deviceAssetId: 'test-asset-0', - }); - - const response = await utils.checkExistingAssets(user1.accessToken, { - deviceId: 'test-assets-exist', - deviceAssetIds: ['test-asset-0'], - }); - - expect(response.existingIds).toEqual(['test-asset-0']); - }); - }); -}); diff --git a/e2e/src/api/specs/database-backups.e2e-spec.ts b/e2e/src/api/specs/database-backups.e2e-spec.ts deleted file mode 100644 index 2b0f6ae61a..0000000000 --- a/e2e/src/api/specs/database-backups.e2e-spec.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { LoginResponseDto, ManualJobName } from '@immich/sdk'; -import { errorDto } from 'src/responses'; -import { app, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; - -describe('/admin/database-backups', () => { - let cookie: string | undefined; - let admin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - await utils.resetBackups(admin.accessToken); - }); - - describe('GET /', async () => { - it('should succeed and be empty', async () => { - const { status, body } = await request(app) - .get('/admin/database-backups') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ - backups: [], - }); - }); - - it('should contain a created backup', async () => { - await utils.createJob(admin.accessToken, { - name: ManualJobName.BackupDatabase, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'backupDatabase'); - - await expect - .poll( - async () => { - const { status, body } = await request(app) - .get('/admin/database-backups') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - return body; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toEqual( - expect.objectContaining({ - backups: [ - expect.objectContaining({ - filename: expect.stringMatching(/immich-db-backup-\d{8}T\d{6}-v.*-pg.*\.sql\.gz$/), - filesize: expect.any(Number), - }), - ], - }), - ); - }); - }); - - describe('DELETE /', async () => { - it('should delete backup', async () => { - const filename = await utils.createBackup(admin.accessToken); - - const { status } = await request(app) - .delete(`/admin/database-backups`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ backups: [filename] }); - - expect(status).toBe(200); - - const { status: listStatus, body } = await request(app) - .get('/admin/database-backups') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(listStatus).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - backups: [], - }), - ); - }); - }); - - // => action: restore database flow - - describe.sequential('POST /start-restore', () => { - afterAll(async () => { - await request(app).post('/admin/maintenance').set('cookie', cookie!).send({ action: 'end' }); - await utils.poll( - () => request(app).get('/server/config'), - ({ status, body }) => status === 200 && !body.maintenanceMode, - ); - - admin = await utils.adminSetup(); - }); - - it.sequential('should not work when the server is configured', async () => { - const { status, body } = await request(app).post('/admin/database-backups/start-restore').send(); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('The server already has an admin')); - }); - - it.sequential('should enter maintenance mode in "database restore mode"', async () => { - await utils.resetDatabase(); // reset database before running this test - - const { status, headers } = await request(app).post('/admin/database-backups/start-restore').send(); - - expect(status).toBe(201); - - cookie = headers['set-cookie'][0].split(';')[0]; - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeTruthy(); - - const { status: status2, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status2).toBe(200); - expect(body).toEqual({ - active: true, - action: 'select_database_restore', - }); - }); - }); - - // => action: restore database - - describe.sequential('POST /backups/restore', () => { - beforeAll(async () => { - await utils.disconnectDatabase(); - }); - - afterAll(async () => { - await utils.connectDatabase(); - }); - - it.sequential('should restore a backup', { timeout: 60_000 }, async () => { - let filename = await utils.createBackup(admin.accessToken); - - // work-around until test is running on released version - await utils.move( - `/data/backups/${filename}`, - '/data/backups/immich-db-backup-20260114T184016-v2.5.0-pg14.19.sql.gz', - ); - filename = 'immich-db-backup-20260114T184016-v2.5.0-pg14.19.sql.gz'; - - const { status } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - action: 'restore_database', - restoreBackupFilename: filename, - }); - - expect(status).toBe(201); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeTruthy(); - - const { status: status2, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status2).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - active: true, - action: 'restore_database', - }), - ); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 60_000, - }, - ) - .toBeFalsy(); - }); - - it.sequential('fail to restore a corrupted backup', { timeout: 60_000 }, async () => { - await utils.prepareTestBackup('corrupted'); - - const { status, headers } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - action: 'restore_database', - restoreBackupFilename: 'development-corrupted.sql.gz', - }); - - expect(status).toBe(201); - cookie = headers['set-cookie'][0].split(';')[0]; - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeTruthy(); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status).toBe(200); - return body; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toEqual( - expect.objectContaining({ - active: true, - action: 'restore_database', - error: 'Something went wrong, see logs!', - }), - ); - - const { status: status2, body: body2 } = await request(app) - .get('/admin/maintenance/status') - .set('cookie', cookie!) - .send({ token: 'token' }); - expect(status2).toBe(200); - expect(body2).toEqual( - expect.objectContaining({ - active: true, - action: 'restore_database', - error: expect.stringContaining('IM CORRUPTED'), - }), - ); - - await request(app).post('/admin/maintenance').set('cookie', cookie!).send({ - action: 'end', - }); - - await utils.poll( - () => request(app).get('/server/config'), - ({ status, body }) => status === 200 && !body.maintenanceMode, - ); - }); - - it.sequential('rollback to restore point if backup is missing admin', { timeout: 60_000 }, async () => { - await utils.prepareTestBackup('empty'); - - const { status, headers } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - action: 'restore_database', - restoreBackupFilename: 'development-empty.sql.gz', - }); - - expect(status).toBe(201); - cookie = headers['set-cookie'][0].split(';')[0]; - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeTruthy(); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status).toBe(200); - return body; - }, - { - interval: 500, - timeout: 30_000, - }, - ) - .toEqual( - expect.objectContaining({ - active: true, - action: 'restore_database', - error: 'Something went wrong, see logs!', - }), - ); - - const { status: status2, body: body2 } = await request(app) - .get('/admin/maintenance/status') - .set('cookie', cookie!) - .send({ token: 'token' }); - expect(status2).toBe(200); - expect(body2).toEqual( - expect.objectContaining({ - active: true, - action: 'restore_database', - error: expect.stringContaining('Server health check failed, no admin exists.'), - }), - ); - - await request(app).post('/admin/maintenance').set('cookie', cookie!).send({ - action: 'end', - }); - - await utils.poll( - () => request(app).get('/server/config'), - ({ status, body }) => status === 200 && !body.maintenanceMode, - ); - }); - }); -}); diff --git a/e2e/src/api/specs/download.e2e-spec.ts b/e2e/src/api/specs/download.e2e-spec.ts deleted file mode 100644 index 4dcb6934af..0000000000 --- a/e2e/src/api/specs/download.e2e-spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto } from '@immich/sdk'; -import { readFile, writeFile } from 'node:fs/promises'; -import { app, tempDir, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/download', () => { - let admin: LoginResponseDto; - let asset1: AssetMediaResponseDto; - let asset2: AssetMediaResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - [asset1, asset2] = await Promise.all([utils.createAsset(admin.accessToken), utils.createAsset(admin.accessToken)]); - }); - - describe('POST /download/info', () => { - it('should download info', async () => { - const { status, body } = await request(app) - .post('/download/info') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ assetIds: [asset1.id] }); - - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - archives: [expect.objectContaining({ assetIds: [asset1.id] })], - }), - ); - }); - }); - - describe('POST /download/archive', () => { - it('should download an archive', async () => { - const { status, body } = await request(app) - .post('/download/archive') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ assetIds: [asset1.id, asset2.id] }); - - expect(status).toBe(200); - expect(body instanceof Buffer).toBe(true); - - await writeFile(`${tempDir}/archive.zip`, body); - await utils.unzip(`${tempDir}/archive.zip`, `${tempDir}/archive`); - const files = [ - { filename: 'example.png', id: asset1.id }, - { filename: 'example+1.png', id: asset2.id }, - ]; - for (const { id, filename } of files) { - const bytes = await readFile(`${tempDir}/archive/${filename}`); - const asset = await utils.getAssetInfo(admin.accessToken, id); - expect(utils.sha1(bytes)).toBe(asset.checksum); - } - }); - }); -}); diff --git a/e2e/src/api/specs/jobs.e2e-spec.ts b/e2e/src/api/specs/jobs.e2e-spec.ts deleted file mode 100644 index be7984404b..0000000000 --- a/e2e/src/api/specs/jobs.e2e-spec.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { LoginResponseDto, QueueCommand, QueueName, updateConfig } from '@immich/sdk'; -import { cpSync, rmSync } from 'node:fs'; -import { readFile } from 'node:fs/promises'; -import { basename } from 'node:path'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, testAssetDir, utils } from 'src/utils'; -import request from 'supertest'; -import { afterEach, beforeAll, describe, expect, it } from 'vitest'; - -describe('/jobs', () => { - let admin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - }); - - describe('PUT /jobs', () => { - afterEach(async () => { - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.FaceDetection, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.SmartSearch, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.DuplicateDetection, { - command: QueueCommand.Resume, - force: false, - }); - - const config = await utils.getSystemConfig(admin.accessToken); - config.machineLearning.duplicateDetection.enabled = false; - config.machineLearning.enabled = false; - config.metadata.faces.import = false; - config.machineLearning.clip.enabled = false; - await updateConfig({ systemConfigDto: config }, { headers: asBearerAuth(admin.accessToken) }); - }); - - it('should require authentication', async () => { - const { status, body } = await request(app).put('/jobs/metadataExtraction'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should queue metadata extraction for missing assets', async () => { - const path = `${testAssetDir}/formats/raw/Nikon/D700/philadelphia.nef`; - - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Pause, - force: false, - }); - - const { id } = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(path), filename: basename(path) }, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - { - const asset = await utils.getAssetInfo(admin.accessToken, id); - - expect(asset.exifInfo).toBeDefined(); - expect(asset.exifInfo?.make).toBeNull(); - } - - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Empty, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Start, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - { - const asset = await utils.getAssetInfo(admin.accessToken, id); - - expect(asset.exifInfo).toBeDefined(); - expect(asset.exifInfo?.make).toBe('NIKON CORPORATION'); - } - }); - - it('should not re-extract metadata for existing assets', async () => { - const path = `${testAssetDir}/temp/metadata/asset.jpg`; - - cpSync(`${testAssetDir}/formats/raw/Nikon/D700/philadelphia.nef`, path); - - const { id } = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(path), filename: basename(path) }, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - { - const asset = await utils.getAssetInfo(admin.accessToken, id); - - expect(asset.exifInfo).toBeDefined(); - expect(asset.exifInfo?.model).toBe('NIKON D700'); - } - - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, path); - - await utils.queueCommand(admin.accessToken, QueueName.MetadataExtraction, { - command: QueueCommand.Start, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - { - const asset = await utils.getAssetInfo(admin.accessToken, id); - - expect(asset.exifInfo).toBeDefined(); - expect(asset.exifInfo?.model).toBe('NIKON D700'); - } - - rmSync(path); - }); - - it('should queue thumbnail extraction for assets missing thumbs', async () => { - const path = `${testAssetDir}/albums/nature/tanners_ridge.jpg`; - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Pause, - force: false, - }); - - const { id } = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(path), filename: basename(path) }, - }); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.MetadataExtraction); - await utils.waitForQueueFinish(admin.accessToken, QueueName.ThumbnailGeneration); - - const assetBefore = await utils.getAssetInfo(admin.accessToken, id); - expect(assetBefore.thumbhash).toBeNull(); - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Empty, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.MetadataExtraction); - await utils.waitForQueueFinish(admin.accessToken, QueueName.ThumbnailGeneration); - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Resume, - force: false, - }); - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Start, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.MetadataExtraction); - await utils.waitForQueueFinish(admin.accessToken, QueueName.ThumbnailGeneration); - - const assetAfter = await utils.getAssetInfo(admin.accessToken, id); - expect(assetAfter.thumbhash).not.toBeNull(); - }); - - it('should not reload existing thumbnail when running thumb job for missing assets', async () => { - const path = `${testAssetDir}/temp/thumbs/asset1.jpg`; - - cpSync(`${testAssetDir}/albums/nature/tanners_ridge.jpg`, path); - - const { id } = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(path), filename: basename(path) }, - }); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.MetadataExtraction); - await utils.waitForQueueFinish(admin.accessToken, QueueName.ThumbnailGeneration); - - const assetBefore = await utils.getAssetInfo(admin.accessToken, id); - - cpSync(`${testAssetDir}/albums/nature/notocactus_minimus.jpg`, path); - - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Resume, - force: false, - }); - - // This runs the missing thumbnail job - await utils.queueCommand(admin.accessToken, QueueName.ThumbnailGeneration, { - command: QueueCommand.Start, - force: false, - }); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.MetadataExtraction); - await utils.waitForQueueFinish(admin.accessToken, QueueName.ThumbnailGeneration); - - const assetAfter = await utils.getAssetInfo(admin.accessToken, id); - - // Asset 1 thumbnail should be untouched since its thumb should not have been reloaded, even though the file was changed - expect(assetAfter.thumbhash).toEqual(assetBefore.thumbhash); - - rmSync(path); - }); - }); -}); diff --git a/e2e/src/api/specs/library.e2e-spec.ts b/e2e/src/api/specs/library.e2e-spec.ts deleted file mode 100644 index 4d67a84647..0000000000 --- a/e2e/src/api/specs/library.e2e-spec.ts +++ /dev/null @@ -1,1448 +0,0 @@ -import { LibraryResponseDto, LoginResponseDto, getAllLibraries } from '@immich/sdk'; -import { cpSync, existsSync, rmSync, unlinkSync } from 'node:fs'; -import { Socket } from 'socket.io-client'; -import { userDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, testAssetDir, testAssetDirInternal, utils } from 'src/utils'; -import request from 'supertest'; -import { utimes } from 'utimes'; -import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -describe('/libraries', () => { - let admin: LoginResponseDto; - let user: LoginResponseDto; - let library: LibraryResponseDto; - let websocket: Socket; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - await utils.resetAdminConfig(admin.accessToken); - user = await utils.userSetup(admin.accessToken, userDto.user1); - library = await utils.createLibrary(admin.accessToken, { ownerId: admin.userId }); - websocket = await utils.connectWebsocket(admin.accessToken); - utils.createImageFile(`${testAssetDir}/temp/directoryA/assetA.png`); - utils.createImageFile(`${testAssetDir}/temp/directoryB/assetB.png`); - }); - - afterAll(() => { - utils.disconnectWebsocket(websocket); - utils.resetTempFolder(); - }); - - beforeEach(() => { - utils.resetEvents(); - }); - - describe('GET /libraries', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/libraries'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - }); - - describe('POST /libraries', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/libraries').send({}); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require admin authentication', async () => { - const { status, body } = await request(app) - .post('/libraries') - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ownerId: admin.userId }); - - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should create an external library with defaults', async () => { - const { status, body } = await request(app) - .post('/libraries') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ownerId: admin.userId }); - - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - ownerId: admin.userId, - name: 'New External Library', - refreshedAt: null, - assetCount: 0, - importPaths: [], - exclusionPatterns: expect.any(Array), - }), - ); - }); - - it('should create an external library with options', async () => { - const { status, body } = await request(app) - .post('/libraries') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - ownerId: admin.userId, - name: 'My Awesome Library', - importPaths: ['/path/to/import'], - exclusionPatterns: ['**/Raw/**'], - }); - - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - name: 'My Awesome Library', - importPaths: ['/path/to/import'], - }), - ); - }); - - it('should not create an external library with duplicate import paths', async () => { - const { status, body } = await request(app) - .post('/libraries') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - ownerId: admin.userId, - name: 'My Awesome Library', - importPaths: ['/path', '/path'], - exclusionPatterns: ['**/Raw/**'], - }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(["All importPaths's elements must be unique"])); - }); - - it('should not create an external library with duplicate exclusion patterns', async () => { - const { status, body } = await request(app) - .post('/libraries') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - ownerId: admin.userId, - name: 'My Awesome Library', - importPaths: ['/path/to/import'], - exclusionPatterns: ['**/Raw/**', '**/Raw/**'], - }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(["All exclusionPatterns's elements must be unique"])); - }); - }); - - describe('PUT /libraries/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/libraries/${uuidDto.notFound}`).send({}); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should change the library name', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ name: 'New Library Name' }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - name: 'New Library Name', - }), - ); - }); - - it('should not set an empty name', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ name: '' }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['name should not be empty'])); - }); - - it('should change the import paths', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ importPaths: [testAssetDirInternal] }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - importPaths: [testAssetDirInternal], - }), - ); - }); - - it('should reject an empty import path', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ importPaths: [''] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['each value in importPaths should not be empty'])); - }); - - it('should reject duplicate import paths', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ importPaths: ['/path', '/path'] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(["All importPaths's elements must be unique"])); - }); - - it('should change the exclusion pattern', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ exclusionPatterns: ['**/Raw/**'] }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - exclusionPatterns: ['**/Raw/**'], - }), - ); - }); - - it('should reject duplicate exclusion patterns', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ exclusionPatterns: ['**/*.jpg', '**/*.jpg'] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(["All exclusionPatterns's elements must be unique"])); - }); - - it('should reject an empty exclusion pattern', async () => { - const { status, body } = await request(app) - .put(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ exclusionPatterns: [''] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['each value in exclusionPatterns should not be empty'])); - }); - }); - - describe('GET /libraries/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get(`/libraries/${uuidDto.notFound}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require admin access', async () => { - const { status, body } = await request(app) - .get(`/libraries/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should get library by id', async () => { - const library = await utils.createLibrary(admin.accessToken, { ownerId: admin.userId }); - - const { status, body } = await request(app) - .get(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - ownerId: admin.userId, - name: 'New External Library', - refreshedAt: null, - assetCount: 0, - importPaths: [], - exclusionPatterns: expect.any(Array), - }), - ); - }); - }); - - describe('GET /libraries/:id/statistics', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get(`/libraries/${uuidDto.notFound}/statistics`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - }); - - describe('POST /libraries/:id/scan', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post(`/libraries/${uuidDto.notFound}/scan`).send({}); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should import new asset when scanning external library', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/directoryA`], - }); - - const { status } = await request(app) - .post(`/libraries/${library.id}/scan`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send(); - expect(status).toBe(204); - - await utils.waitForQueueFinish(admin.accessToken, 'library'); - await utils.waitForQueueFinish(admin.accessToken, 'sidecar'); - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - - const { assets } = await utils.searchAssets(admin.accessToken, { - originalPath: `${testAssetDirInternal}/temp/directoryA/assetA.png`, - libraryId: library.id, - }); - expect(assets.count).toBe(1); - }); - - it('should process metadata and thumbnails for external asset', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/directoryA`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { - originalPath: `${testAssetDirInternal}/temp/directoryA/assetA.png`, - libraryId: library.id, - }); - expect(assets.count).toBe(1); - const asset = assets.items[0]; - expect(asset.exifInfo).not.toBe(null); - expect(asset.exifInfo?.dateTimeOriginal).not.toBe(null); - expect(asset.thumbhash).not.toBe(null); - }); - - it('should scan external library with exclusion pattern', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - exclusionPatterns: ['**/directoryA/**'], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(1); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining('directoryB/assetB.png') }), - ]), - ); - }); - - it('should scan external library with multiple exclusion patterns', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - exclusionPatterns: ['**/directoryA/**', '**/directoryB/**'], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(0); - - expect(assets.items).toEqual([]); - }); - - it('should remove assets covered by a new exclusion pattern', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - }); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(2); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining('directoryA/assetA.png') }), - expect.objectContaining({ originalPath: expect.stringContaining('directoryB/assetB.png') }), - ]), - ); - } - - await utils.updateLibrary(admin.accessToken, library.id, { - exclusionPatterns: ['**/directoryA/**'], - }); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(1); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining('directoryB/assetB.png') }), - ]), - ); - } - - await utils.updateLibrary(admin.accessToken, library.id, { - exclusionPatterns: ['**/directoryA/**', '**/directoryB/**'], - }); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(0); - - expect(assets.items).toEqual([]); - } - }); - - it('should scan multiple import paths', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/directoryA`, `${testAssetDirInternal}/temp/directoryB`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(2); - expect(assets.items.find((asset) => asset.originalPath.includes('directoryA'))).toBeDefined(); - expect(assets.items.find((asset) => asset.originalPath.includes('directoryB'))).toBeDefined(); - }); - - it('should scan multiple import paths with commas', async () => { - // https://github.com/immich-app/immich/issues/10699 - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/folder, a`, `${testAssetDirInternal}/temp/folder, b`], - }); - - utils.createImageFile(`${testAssetDir}/temp/folder, a/assetA.png`); - utils.createImageFile(`${testAssetDir}/temp/folder, b/assetB.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(2); - expect(assets.items.find((asset) => asset.originalPath.includes('folder, a'))).toBeDefined(); - expect(assets.items.find((asset) => asset.originalPath.includes('folder, b'))).toBeDefined(); - - utils.removeImageFile(`${testAssetDir}/temp/folder, a/assetA.png`); - utils.removeImageFile(`${testAssetDir}/temp/folder, b/assetB.png`); - }); - - it('should scan multiple import paths with braces', async () => { - // https://github.com/immich-app/immich/issues/10699 - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/folder{ a`, `${testAssetDirInternal}/temp/folder} b`], - }); - - utils.createImageFile(`${testAssetDir}/temp/folder{ a/assetA.png`); - utils.createImageFile(`${testAssetDir}/temp/folder} b/assetB.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(2); - expect(assets.items.find((asset) => asset.originalPath.includes('folder{ a'))).toBeDefined(); - expect(assets.items.find((asset) => asset.originalPath.includes('folder} b'))).toBeDefined(); - - utils.removeImageFile(`${testAssetDir}/temp/folder{ a/assetA.png`); - utils.removeImageFile(`${testAssetDir}/temp/folder} b/assetB.png`); - }); - - const annoyingChars = [ - "'", - '"', - '`', - '*', - '{', - '}', - ',', - '(', - ')', - '[', - ']', - '?', - '!', - '@', - '#', - '$', - '%', - '^', - '&', - '=', - '+', - '~', - '|', - '<', - '>', - ';', - ':', - '/', // We never got backslashes to work - ]; - - it.each(annoyingChars)('should scan multiple import paths with %s', async (char) => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/folder${char}1`, `${testAssetDirInternal}/temp/folder${char}2`], - }); - - utils.createImageFile(`${testAssetDir}/temp/folder${char}1/asset1.png`); - utils.createImageFile(`${testAssetDir}/temp/folder${char}2/asset2.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining(`folder${char}1/asset1.png`) }), - expect.objectContaining({ originalPath: expect.stringContaining(`folder${char}2/asset2.png`) }), - ]), - ); - - utils.removeImageFile(`${testAssetDir}/temp/folder${char}1/asset1.png`); - utils.removeImageFile(`${testAssetDir}/temp/folder${char}2/asset2.png`); - }); - - it('should respect exclusion patterns when using multiple import paths', async () => { - // https://github.com/immich-app/immich/issues/17121 - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/exclusion/`, `${testAssetDirInternal}/temp/exclusion2/`], - }); - - const excludedFolder = `Raw`; - - utils.createImageFile(`${testAssetDir}/temp/exclusion/asset1.png`); - utils.createImageFile(`${testAssetDir}/temp/exclusion/${excludedFolder}/asset2.png`); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - expect.objectContaining({ originalPath: expect.stringContaining(`${excludedFolder}/asset2.png`) }), - ]), - ); - } - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - expect.objectContaining({ originalPath: expect.stringContaining(`${excludedFolder}/asset2.png`) }), - ]), - ); - } - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: [`**/${excludedFolder}/**`] }); - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - ]); - } - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - ]); - } - - utils.removeImageFile(`${testAssetDir}/temp/exclusion/asset1.png`); - utils.removeImageFile(`${testAssetDir}/temp/exclusion/${excludedFolder}/asset2.png`); - }); - - const annoyingExclusionPatterns = ['@', '#', '$', '%', '^', '&', '=']; - - it.each(annoyingExclusionPatterns)('should support exclusion patterns with %s', async (char) => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/exclusion/`], - }); - - const excludedFolder = `${char}folder`; - - utils.createImageFile(`${testAssetDir}/temp/exclusion/asset1.png`); - utils.createImageFile(`${testAssetDir}/temp/exclusion/${excludedFolder}/asset2.png`); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - expect.objectContaining({ originalPath: expect.stringContaining(`${excludedFolder}/asset2.png`) }), - ]), - ); - } - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual( - expect.arrayContaining([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - expect.objectContaining({ originalPath: expect.stringContaining(`${excludedFolder}/asset2.png`) }), - ]), - ); - } - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: [`**/${excludedFolder}/**`] }); - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - ]); - } - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.items).toEqual([ - expect.objectContaining({ originalPath: expect.stringContaining(`/asset1.png`) }), - ]); - } - - utils.removeImageFile(`${testAssetDir}/temp/exclusion/asset1.png`); - utils.removeImageFile(`${testAssetDir}/temp/exclusion/${excludedFolder}/asset2.png`); - }); - - it('should reimport a modified file', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/reimport`], - }); - - utils.createImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/albums/nature/tanners_ridge.jpg`, `${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { - libraryId: library.id, - }); - - expect(assets.count).toEqual(1); - - const asset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(asset).toEqual( - expect.objectContaining({ - originalFileName: 'asset.jpg', - exifInfo: expect.objectContaining({ - model: 'NIKON D750', - }), - }), - ); - - utils.removeImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - }); - - it('should not reimport a file with unchanged timestamp', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/reimport`], - }); - - utils.createImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/albums/nature/tanners_ridge.jpg`, `${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { - libraryId: library.id, - }); - - expect(assets.count).toEqual(1); - - const asset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(asset).toEqual( - expect.objectContaining({ - originalFileName: 'asset.jpg', - exifInfo: expect.not.objectContaining({ - model: 'NIKON D750', - }), - }), - ); - - utils.removeImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - }); - - it('should not reimport a modified file more than once', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/reimport`], - }); - - utils.createImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/albums/nature/tanners_ridge.jpg`, `${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/albums/nature/el_torcal_rocks.jpg`, `${testAssetDir}/temp/reimport/asset.jpg`); - await utimes(`${testAssetDir}/temp/reimport/asset.jpg`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { - libraryId: library.id, - }); - - expect(assets.count).toEqual(1); - - const asset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(asset).toEqual( - expect.objectContaining({ - originalFileName: 'asset.jpg', - exifInfo: expect.objectContaining({ - model: 'NIKON D750', - }), - }), - ); - - utils.removeImageFile(`${testAssetDir}/temp/reimport/asset.jpg`); - }); - - it('should set an asset offline if its file is missing', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.count).toBe(1); - - utils.removeImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const trashedAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - expect(trashedAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(trashedAsset.isOffline).toEqual(true); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(newAssets.items).toEqual([]); - }); - - it('should set an asset offline if its file is not in any import path', async () => { - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.count).toBe(1); - - utils.createDirectory(`${testAssetDir}/temp/another-path/`); - - await utils.updateLibrary(admin.accessToken, library.id, { - importPaths: [`${testAssetDirInternal}/temp/another-path/`], - }); - - await utils.scan(admin.accessToken, library.id); - - const trashedAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - expect(trashedAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(trashedAsset.isOffline).toBe(true); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([]); - - utils.removeImageFile(`${testAssetDir}/temp/offline/offline.png`); - utils.removeDirectory(`${testAssetDir}/temp/another-path/`); - }); - - it('should set an asset offline if its file is covered by an exclusion pattern', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { - libraryId: library.id, - originalFileName: 'assetB.png', - }); - expect(assets.count).toBe(1); - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/directoryB/**'] }); - - await utils.scan(admin.accessToken, library.id); - - const trashedAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - expect(trashedAsset.isTrashed).toBe(true); - expect(trashedAsset.originalPath).toBe(`${testAssetDirInternal}/temp/directoryB/assetB.png`); - expect(trashedAsset.isOffline).toBe(true); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'assetA.png', - }), - ]); - }); - - it('should not set an asset offline if its file exists, is in an import path, and not covered by an exclusion pattern', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets: assetsBefore } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assetsBefore.count).toBeGreaterThan(1); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets).toEqual(assetsBefore); - }); - - describe('xmp metadata', async () => { - it('should import metadata from file.xmp', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2000-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should import metadata from file.ext.xmp', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2000-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should import metadata in file.ext.xmp before file.xmp if both exist', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - cpSync(`${testAssetDir}/metadata/xmp/dates/2010.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2000-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file.xmp to file.ext.xmp when asset refreshes', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2010.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - unlinkSync(`${testAssetDir}/temp/xmp/glarus.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2010-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file metadata to file.xmp metadata when asset refreshes', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2000-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file metadata to file.ext.xmp metadata when asset refreshes', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2000-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file.ext.xmp to file.xmp when asset refreshes', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2010.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - unlinkSync(`${testAssetDir}/temp/xmp/glarus.nef.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2010-09-27T12:35:33.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file.ext.xmp to file metadata', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.nef.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - unlinkSync(`${testAssetDir}/temp/xmp/glarus.nef.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2010-07-20T17:27:12.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - - it('should switch from using file.xmp to file metadata', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/xmp`], - }); - - cpSync(`${testAssetDir}/metadata/xmp/dates/2000.xmp`, `${testAssetDir}/temp/xmp/glarus.xmp`); - cpSync(`${testAssetDir}/formats/raw/Nikon/D80/glarus.nef`, `${testAssetDir}/temp/xmp/glarus.nef`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_000); - - await utils.scan(admin.accessToken, library.id); - - unlinkSync(`${testAssetDir}/temp/xmp/glarus.xmp`); - await utimes(`${testAssetDir}/temp/xmp/glarus.nef`, 447_775_200_001); - - await utils.scan(admin.accessToken, library.id); - - const { assets: newAssets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(newAssets.items).toEqual([ - expect.objectContaining({ - originalFileName: 'glarus.nef', - fileCreatedAt: '2010-07-20T17:27:12.000Z', - }), - ]); - - rmSync(`${testAssetDir}/temp/xmp`, { recursive: true, force: true }); - }); - }); - - it('should set an offline asset to online if its file exists, is in an import path, and not covered by an exclusion pattern', async () => { - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(1); - - utils.renameImageFile(`${testAssetDir}/temp/offline/offline.png`, `${testAssetDir}/temp/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const offlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - expect(offlineAsset.isTrashed).toBe(true); - expect(offlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(offlineAsset.isOffline).toBe(true); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - - utils.renameImageFile(`${testAssetDir}/temp/offline.png`, `${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const backOnlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(backOnlineAsset.isTrashed).toBe(false); - expect(backOnlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(backOnlineAsset.isOffline).toBe(false); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.count).toBe(1); - } - }); - - it('should set a trashed offline asset to online but keep it in trash', async () => { - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - expect(assets.count).toBe(1); - - await utils.deleteAssets(admin.accessToken, [assets.items[0].id]); - - { - const trashedAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(trashedAsset.isTrashed).toBe(true); - } - - utils.renameImageFile(`${testAssetDir}/temp/offline/offline.png`, `${testAssetDir}/temp/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const offlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - expect(offlineAsset.isTrashed).toBe(true); - expect(offlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(offlineAsset.isOffline).toBe(true); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - - utils.renameImageFile(`${testAssetDir}/temp/offline.png`, `${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const backOnlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(backOnlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(backOnlineAsset.isOffline).toBe(false); - expect(backOnlineAsset.isTrashed).toBe(true); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - }); - - it('should not set an offline asset to online if its file exists, is not covered by an exclusion pattern, but is outside of all import paths', async () => { - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - - utils.renameImageFile(`${testAssetDir}/temp/offline/offline.png`, `${testAssetDir}/temp/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - - const offlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(offlineAsset.isTrashed).toBe(true); - expect(offlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(offlineAsset.isOffline).toBe(true); - - utils.renameImageFile(`${testAssetDir}/temp/offline.png`, `${testAssetDir}/temp/offline/offline.png`); - - utils.createDirectory(`${testAssetDir}/temp/another-path/`); - - await utils.updateLibrary(admin.accessToken, library.id, { - importPaths: [`${testAssetDirInternal}/temp/another-path`], - }); - - await utils.scan(admin.accessToken, library.id); - - const stillOfflineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(stillOfflineAsset.isTrashed).toBe(true); - expect(stillOfflineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(stillOfflineAsset.isOffline).toBe(true); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - - utils.removeDirectory(`${testAssetDir}/temp/another-path/`); - }); - - it('should not set an offline asset to online if its file exists, is in an import path, but is covered by an exclusion pattern', async () => { - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - await utils.scan(admin.accessToken, library.id); - - { - const { assets: assetsBefore } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assetsBefore.count).toBe(1); - } - - utils.renameImageFile(`${testAssetDir}/temp/offline/offline.png`, `${testAssetDir}/temp/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - - const offlineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(offlineAsset.isTrashed).toBe(true); - expect(offlineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(offlineAsset.isOffline).toBe(true); - - utils.renameImageFile(`${testAssetDir}/temp/offline.png`, `${testAssetDir}/temp/offline/offline.png`); - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/offline/**'] }); - - await utils.scan(admin.accessToken, library.id); - - const stillOfflineAsset = await utils.getAssetInfo(admin.accessToken, assets.items[0].id); - - expect(stillOfflineAsset.isTrashed).toBe(true); - expect(stillOfflineAsset.originalPath).toBe(`${testAssetDirInternal}/temp/offline/offline.png`); - expect(stillOfflineAsset.isOffline).toBe(true); - - { - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id, withDeleted: true }); - expect(assets.count).toBe(1); - } - }); - }); - - describe('POST /libraries/:id/validate', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post(`/libraries/${uuidDto.notFound}/validate`).send({}); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should pass with no import paths', async () => { - const response = await utils.validateLibrary(admin.accessToken, library.id, { importPaths: [] }); - expect(response.importPaths).toEqual([]); - }); - - it('should fail if path does not exist', async () => { - const pathToTest = `${testAssetDirInternal}/does/not/exist`; - - const response = await utils.validateLibrary(admin.accessToken, library.id, { - importPaths: [pathToTest], - }); - - expect(response.importPaths?.length).toEqual(1); - const pathResponse = response?.importPaths?.at(0); - - expect(pathResponse).toEqual({ - importPath: pathToTest, - isValid: false, - message: `Path does not exist (ENOENT)`, - }); - }); - - it("should fail if path isn't absolute", async () => { - const pathToTest = `relative/path`; - - const cwd = process.cwd(); - // Create directory in cwd - utils.createDirectory(`${cwd}/${pathToTest}`); - - const response = await utils.validateLibrary(admin.accessToken, library.id, { - importPaths: [pathToTest], - }); - - utils.removeDirectory(`${cwd}/${pathToTest}`); - - expect(response.importPaths?.length).toEqual(1); - const pathResponse = response?.importPaths?.at(0); - - expect(pathResponse).toEqual({ - importPath: pathToTest, - isValid: false, - message: expect.stringMatching('Import path must be absolute, try /usr/src/app/relative/path'), - }); - }); - - it('should fail if path is a file', async () => { - const pathToTest = `${testAssetDirInternal}/albums/nature/el_torcal_rocks.jpg`; - - const response = await utils.validateLibrary(admin.accessToken, library.id, { - importPaths: [pathToTest], - }); - - expect(response.importPaths?.length).toEqual(1); - const pathResponse = response?.importPaths?.at(0); - - expect(pathResponse).toEqual({ - importPath: pathToTest, - isValid: false, - message: `Not a directory`, - }); - }); - }); - - describe('DELETE /libraries/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).delete(`/libraries/${uuidDto.notFound}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should delete an external library', async () => { - const library = await utils.createLibrary(admin.accessToken, { ownerId: admin.userId }); - - const { status, body } = await request(app) - .delete(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(204); - expect(body).toEqual({}); - - const libraries = await getAllLibraries({ headers: asBearerAuth(admin.accessToken) }); - expect(libraries).not.toEqual( - expect.arrayContaining([ - expect.objectContaining({ - id: library.id, - }), - ]), - ); - }); - - it('should delete an external library with assets', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp`], - }); - - await utils.scan(admin.accessToken, library.id); - - const { status, body } = await request(app) - .delete(`/libraries/${library.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(204); - expect(body).toEqual({}); - - const libraries = await getAllLibraries({ headers: asBearerAuth(admin.accessToken) }); - expect(libraries).not.toEqual( - expect.arrayContaining([ - expect.objectContaining({ - id: library.id, - }), - ]), - ); - - // ensure no files get deleted - expect(existsSync(`${testAssetDir}/temp/directoryA/assetA.png`)).toBe(true); - expect(existsSync(`${testAssetDir}/temp/directoryB/assetB.png`)).toBe(true); - }); - }); -}); diff --git a/e2e/src/api/specs/maintenance.e2e-spec.ts b/e2e/src/api/specs/maintenance.e2e-spec.ts deleted file mode 100644 index 8e4e154328..0000000000 --- a/e2e/src/api/specs/maintenance.e2e-spec.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { LoginResponseDto } from '@immich/sdk'; -import { createUserDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/admin/maintenance', () => { - let cookie: string | undefined; - let admin: LoginResponseDto; - let nonAdmin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - nonAdmin = await utils.userSetup(admin.accessToken, createUserDto.user1); - await utils.resetBackups(admin.accessToken); - }); - - // => outside of maintenance mode - - describe('GET ~/server/config', async () => { - it('should indicate we are out of maintenance mode', async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - expect(body.maintenanceMode).toBeFalsy(); - }); - }); - - describe('GET /status', async () => { - it('to always indicate we are not in maintenance mode', async () => { - const { status, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status).toBe(200); - expect(body).toEqual({ - active: false, - action: 'end', - }); - }); - }); - - describe('POST /login', async () => { - it('should not work out of maintenance mode', async () => { - const { status, body } = await request(app).post('/admin/maintenance/login').send({ token: 'token' }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not in maintenance mode')); - }); - }); - - // => enter maintenance mode - - describe.sequential('POST /', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/admin/maintenance').send({ - active: false, - action: 'end', - }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should only work for admins', async () => { - const { status, body } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${nonAdmin.accessToken}`) - .send({ action: 'end' }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should be a no-op if try to exit maintenance mode', async () => { - const { status } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ action: 'end' }); - expect(status).toBe(201); - }); - - it('should enter maintenance mode', async () => { - const { status, headers } = await request(app) - .post('/admin/maintenance') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - action: 'start', - }); - - expect(status).toBe(201); - - cookie = headers['set-cookie'][0].split(';')[0]; - expect(cookie).toEqual( - expect.stringMatching(/^immich_maintenance_token=[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*$/), - ); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeTruthy(); - }); - }); - - // => in maintenance mode - - describe.sequential('in maintenance mode', () => { - describe('GET ~/server/config', async () => { - it('should indicate we are in maintenance mode', async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - expect(body.maintenanceMode).toBeTruthy(); - }); - }); - - describe('GET /status', async () => { - it('to indicate we are in maintenance mode', async () => { - const { status, body } = await request(app).get('/admin/maintenance/status').send({ token: 'token' }); - expect(status).toBe(200); - expect(body).toEqual({ - active: true, - action: 'start', - }); - }); - }); - - describe('POST /login', async () => { - it('should fail without cookie or token in body', async () => { - const { status, body } = await request(app).post('/admin/maintenance/login').send({}); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorizedWithMessage('Missing JWT Token')); - }); - - it('should succeed with cookie', async () => { - const { status, body } = await request(app).post('/admin/maintenance/login').set('cookie', cookie!).send({}); - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - username: 'Immich Admin', - }), - ); - }); - - it('should succeed with token', async () => { - const { status, body } = await request(app) - .post('/admin/maintenance/login') - .send({ - token: cookie!.split('=')[1].trim(), - }); - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - username: 'Immich Admin', - }), - ); - }); - }); - - describe('POST /', async () => { - it('should be a no-op if try to enter maintenance mode', async () => { - const { status } = await request(app) - .post('/admin/maintenance') - .set('cookie', cookie!) - .send({ action: 'start' }); - expect(status).toBe(201); - }); - }); - }); - - // => exit maintenance mode - - describe.sequential('POST /', () => { - it('should exit maintenance mode', async () => { - const { status } = await request(app).post('/admin/maintenance').set('cookie', cookie!).send({ - action: 'end', - }); - - expect(status).toBe(201); - - await expect - .poll( - async () => { - const { status, body } = await request(app).get('/server/config'); - expect(status).toBe(200); - return body.maintenanceMode; - }, - { - interval: 500, - timeout: 10_000, - }, - ) - .toBeFalsy(); - }); - }); -}); diff --git a/e2e/src/api/specs/map.e2e-spec.ts b/e2e/src/api/specs/map.e2e-spec.ts deleted file mode 100644 index 977638aa24..0000000000 --- a/e2e/src/api/specs/map.e2e-spec.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { AssetVisibility, LoginResponseDto } from '@immich/sdk'; -import { readFile } from 'node:fs/promises'; -import { basename, join } from 'node:path'; -import { Socket } from 'socket.io-client'; -import { errorDto } from 'src/responses'; -import { app, testAssetDir, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; - -describe('/map', () => { - let websocket: Socket; - let admin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - - websocket = await utils.connectWebsocket(admin.accessToken); - - const files = ['formats/heic/IMG_2682.heic', 'metadata/gps-position/thompson-springs.jpg']; - utils.resetEvents(); - const uploadFile = async (input: string) => { - const filepath = join(testAssetDir, input); - const { id } = await utils.createAsset(admin.accessToken, { - assetData: { bytes: await readFile(filepath), filename: basename(filepath) }, - }); - await utils.waitForWebsocketEvent({ event: 'assetUpload', id }); - }; - await Promise.all(files.map((f) => uploadFile(f))); - }); - - afterAll(() => { - utils.disconnectWebsocket(websocket); - }); - - describe('GET /map/markers', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/map/markers'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - // TODO archive one of these assets - it('should get map markers for all non-archived assets', async () => { - const { status, body } = await request(app) - .get('/map/markers') - .query({ visibility: AssetVisibility.Timeline }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(2); - expect(body).toEqual([ - { - city: 'Palisade', - country: 'United States of America', - id: expect.any(String), - lat: expect.closeTo(39.115), - lon: expect.closeTo(-108.400_968), - state: 'Colorado', - }, - { - city: 'Ralston', - country: 'United States of America', - id: expect.any(String), - lat: expect.closeTo(41.2203), - lon: expect.closeTo(-96.071_625), - state: 'Nebraska', - }, - ]); - }); - - // TODO archive one of these assets - it('should get all map markers', async () => { - const { status, body } = await request(app) - .get('/map/markers') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual([ - { - city: 'Palisade', - country: 'United States of America', - id: expect.any(String), - lat: expect.closeTo(39.115), - lon: expect.closeTo(-108.400_968), - state: 'Colorado', - }, - { - city: 'Ralston', - country: 'United States of America', - id: expect.any(String), - lat: expect.closeTo(41.2203), - lon: expect.closeTo(-96.071_625), - state: 'Nebraska', - }, - ]); - }); - }); - - describe('GET /map/reverse-geocode', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/map/reverse-geocode'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should throw an error if a lat is not provided', async () => { - const { status, body } = await request(app) - .get('/map/reverse-geocode?lon=123') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['lat must be a number between -90 and 90'])); - }); - - it('should throw an error if a lat is not a number', async () => { - const { status, body } = await request(app) - .get('/map/reverse-geocode?lat=abc&lon=123.456') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['lat must be a number between -90 and 90'])); - }); - - it('should throw an error if a lat is out of range', async () => { - const { status, body } = await request(app) - .get('/map/reverse-geocode?lat=91&lon=123.456') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['lat must be a number between -90 and 90'])); - }); - - it('should throw an error if a lon is not provided', async () => { - const { status, body } = await request(app) - .get('/map/reverse-geocode?lat=75') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['lon must be a number between -180 and 180'])); - }); - - const reverseGeocodeTestCases = [ - { - name: 'Vaucluse', - lat: -33.858_977_058_663_13, - lon: 151.278_490_730_270_48, - results: [{ city: 'Vaucluse', state: 'New South Wales', country: 'Australia' }], - }, - { - name: 'Ravenhall', - lat: -37.765_732_399_174_75, - lon: 144.752_453_164_883_3, - results: [{ city: 'Ravenhall', state: 'Victoria', country: 'Australia' }], - }, - { - name: 'Scarborough', - lat: -31.894_346_156_789_997, - lon: 115.757_617_103_904_64, - results: [{ city: 'Scarborough', state: 'Western Australia', country: 'Australia' }], - }, - ]; - - it.each(reverseGeocodeTestCases)(`should resolve to $name`, async ({ lat, lon, results }) => { - const { status, body } = await request(app) - .get(`/map/reverse-geocode?lat=${lat}&lon=${lon}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(Array.isArray(body)).toBe(true); - expect(body.length).toBe(results.length); - expect(body).toEqual(results); - }); - }); -}); diff --git a/e2e/src/api/specs/memory.e2e-spec.ts b/e2e/src/api/specs/memory.e2e-spec.ts deleted file mode 100644 index e5e2351738..0000000000 --- a/e2e/src/api/specs/memory.e2e-spec.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { - AssetMediaResponseDto, - LoginResponseDto, - MemoryResponseDto, - MemoryType, - createMemory, - getMemory, -} from '@immich/sdk'; -import { createUserDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/memories', () => { - let admin: LoginResponseDto; - let user: LoginResponseDto; - let adminAsset: AssetMediaResponseDto; - let userAsset1: AssetMediaResponseDto; - let userMemory: MemoryResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - user = await utils.userSetup(admin.accessToken, createUserDto.user1); - [adminAsset, userAsset1] = await Promise.all([ - utils.createAsset(admin.accessToken), - utils.createAsset(user.accessToken), - ]); - userMemory = await createMemory( - { - memoryCreateDto: { - type: MemoryType.OnThisDay, - memoryAt: new Date(2021).toISOString(), - data: { year: 2021 }, - assetIds: [], - }, - }, - { headers: asBearerAuth(user.accessToken) }, - ); - }); - - describe('GET /memories/:id', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .get(`/memories/${userMemory.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should get the memory', async () => { - const { status, body } = await request(app) - .get(`/memories/${userMemory.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ id: userMemory.id }); - }); - }); - - describe('PUT /memories/:id', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .put(`/memories/${userMemory.id}`) - .send({ isSaved: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should update the memory', async () => { - const before = await getMemory({ id: userMemory.id }, { headers: asBearerAuth(user.accessToken) }); - expect(before.isSaved).toBe(false); - - const { status, body } = await request(app) - .put(`/memories/${userMemory.id}`) - .send({ isSaved: true }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toMatchObject({ - id: userMemory.id, - isSaved: true, - }); - }); - }); - - describe('PUT /memories/:id/assets', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .put(`/memories/${userMemory.id}/assets`) - .send({ ids: [userAsset1.id] }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require asset access', async () => { - const { status, body } = await request(app) - .put(`/memories/${userMemory.id}/assets`) - .send({ ids: [adminAsset.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(1); - expect(body[0]).toEqual({ - id: adminAsset.id, - success: false, - error: 'no_permission', - }); - }); - - it('should add assets to the memory', async () => { - const { status, body } = await request(app) - .put(`/memories/${userMemory.id}/assets`) - .send({ ids: [userAsset1.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(1); - expect(body[0]).toEqual({ id: userAsset1.id, success: true }); - }); - }); - - describe('DELETE /memories/:id/assets', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .delete(`/memories/${userMemory.id}/assets`) - .send({ ids: [userAsset1.id] }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should only remove assets in the memory', async () => { - const { status, body } = await request(app) - .delete(`/memories/${userMemory.id}/assets`) - .send({ ids: [adminAsset.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(1); - expect(body[0]).toEqual({ - id: adminAsset.id, - success: false, - error: 'not_found', - }); - }); - - it('should remove assets from the memory', async () => { - const { status, body } = await request(app) - .delete(`/memories/${userMemory.id}/assets`) - .send({ ids: [userAsset1.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(1); - expect(body[0]).toEqual({ id: userAsset1.id, success: true }); - }); - }); - - describe('DELETE /memories/:id', () => { - it('should require access', async () => { - const { status, body } = await request(app) - .delete(`/memories/${userMemory.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should delete the memory', async () => { - const { status } = await request(app) - .delete(`/memories/${userMemory.id}`) - .send({ isSaved: true }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(204); - }); - }); -}); diff --git a/e2e/src/api/specs/oauth.e2e-spec.ts b/e2e/src/api/specs/oauth.e2e-spec.ts deleted file mode 100644 index cbd68c003a..0000000000 --- a/e2e/src/api/specs/oauth.e2e-spec.ts +++ /dev/null @@ -1,383 +0,0 @@ -import { OAuthClient, OAuthUser } from '@immich/e2e-auth-server'; -import { - LoginResponseDto, - SystemConfigOAuthDto, - getConfigDefaults, - getMyUser, - startOAuth, - updateConfig, -} from '@immich/sdk'; -import { createHash, randomBytes } from 'node:crypto'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, baseUrl, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -const authServer = { - internal: 'http://e2e-auth-server:2286', - external: 'http://127.0.0.1:2286', -}; - -const mobileOverrideRedirectUri = 'https://photos.immich.app/oauth/mobile-redirect'; - -const redirect = async (url: string, cookies?: string[]) => { - const { headers } = await request(url) - .get('') - .set('Cookie', cookies || []); - return { cookies: (headers['set-cookie'] as unknown as string[]) || [], location: headers.location }; -}; - -// Function to generate a code challenge from the verifier -const generateCodeChallenge = async (codeVerifier: string): Promise => { - const hashed = createHash('sha256').update(codeVerifier).digest(); - return hashed.toString('base64url'); -}; - -const loginWithOAuth = async (sub: OAuthUser | string, redirectUri?: string) => { - const state = randomBytes(16).toString('base64url'); - const codeVerifier = randomBytes(64).toString('base64url'); - const codeChallenge = await generateCodeChallenge(codeVerifier); - - const { url } = await startOAuth({ - oAuthConfigDto: { redirectUri: redirectUri ?? `${baseUrl}/auth/login`, state, codeChallenge }, - }); - - // login - const response1 = await redirect(url.replace(authServer.internal, authServer.external)); - const response2 = await request(authServer.external + response1.location) - .post('') - .set('Cookie', response1.cookies) - .type('form') - .send({ prompt: 'login', login: sub, password: 'password' }); - - // approve - const response3 = await redirect(response2.header.location, response1.cookies); - const response4 = await request(authServer.external + response3.location) - .post('') - .type('form') - .set('Cookie', response3.cookies) - .send({ prompt: 'consent' }); - - const response5 = await redirect(response4.header.location, response3.cookies.slice(1)); - const redirectUrl = response5.location; - - expect(redirectUrl).toBeDefined(); - const params = new URL(redirectUrl).searchParams; - expect(params.get('code')).toBeDefined(); - expect(params.get('state')).toBe(state); - - return { url: redirectUrl, state, codeVerifier }; -}; - -const setupOAuth = async (token: string, dto: Partial) => { - const options = { headers: asBearerAuth(token) }; - const defaults = await getConfigDefaults(options); - const merged = { - ...defaults.oauth, - buttonText: 'Login with Immich', - issuerUrl: `${authServer.internal}/.well-known/openid-configuration`, - ...dto, - }; - await updateConfig({ systemConfigDto: { ...defaults, oauth: merged } }, options); -}; - -describe(`/oauth`, () => { - let admin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.DEFAULT, - clientSecret: OAuthClient.DEFAULT, - buttonText: 'Login with Immich', - storageLabelClaim: 'immich_username', - }); - }); - - describe('POST /oauth/authorize', () => { - it(`should throw an error if a redirect uri is not provided`, async () => { - const { status, body } = await request(app).post('/oauth/authorize').send({}); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['redirectUri must be a string', 'redirectUri should not be empty'])); - }); - - it('should return a redirect uri', async () => { - const { status, body } = await request(app) - .post('/oauth/authorize') - .send({ redirectUri: 'http://127.0.0.1:2285/auth/login' }); - expect(status).toBe(201); - expect(body).toEqual({ url: expect.stringContaining(`${authServer.internal}/auth?`) }); - - const params = new URL(body.url).searchParams; - expect(params.get('client_id')).toBe('client-default'); - expect(params.get('response_type')).toBe('code'); - expect(params.get('redirect_uri')).toBe('http://127.0.0.1:2285/auth/login'); - expect(params.get('state')).toBeDefined(); - }); - }); - - describe('POST /oauth/callback', () => { - it(`should throw an error if a url is not provided`, async () => { - const { status, body } = await request(app).post('/oauth/callback').send({}); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['url must be a string', 'url should not be empty'])); - }); - - it(`should throw an error if the url is empty`, async () => { - const { status, body } = await request(app).post('/oauth/callback').send({ url: '' }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['url should not be empty'])); - }); - - it(`should throw an error if the state is not provided`, async () => { - const { url } = await loginWithOAuth('oauth-auto-register'); - const { status, body } = await request(app).post('/oauth/callback').send({ url }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('OAuth state is missing')); - }); - - it(`should throw an error if the state mismatches`, async () => { - const callbackParams = await loginWithOAuth('oauth-auto-register'); - const { state } = await loginWithOAuth('oauth-auto-register'); - const { status } = await request(app) - .post('/oauth/callback') - .send({ ...callbackParams, state }); - expect(status).toBeGreaterThanOrEqual(400); - }); - - it(`should throw an error if the codeVerifier is not provided`, async () => { - const { url, state } = await loginWithOAuth('oauth-auto-register'); - const { status, body } = await request(app).post('/oauth/callback').send({ url, state }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('OAuth code verifier is missing')); - }); - - it(`should throw an error if the codeVerifier doesn't match the challenge`, async () => { - const callbackParams = await loginWithOAuth('oauth-auto-register'); - const { codeVerifier } = await loginWithOAuth('oauth-auto-register'); - const { status, body } = await request(app) - .post('/oauth/callback') - .send({ ...callbackParams, codeVerifier }); - console.log(body); - expect(status).toBeGreaterThanOrEqual(400); - }); - - it('should auto register the user by default', async () => { - const callbackParams = await loginWithOAuth('oauth-auto-register'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - isAdmin: false, - name: 'OAuth User', - userEmail: 'oauth-auto-register@immich.app', - userId: expect.any(String), - }); - }); - - it('should allow passing state and codeVerifier via cookies', async () => { - const { url, state, codeVerifier } = await loginWithOAuth('oauth-auto-register'); - const { status, body } = await request(app) - .post('/oauth/callback') - .set('Cookie', [`immich_oauth_state=${state}`, `immich_oauth_code_verifier=${codeVerifier}`]) - .send({ url }); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - userId: expect.any(String), - userEmail: 'oauth-auto-register@immich.app', - }); - }); - - it('should handle a user without an email', async () => { - const callbackParams = await loginWithOAuth(OAuthUser.NO_EMAIL); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('OAuth profile does not have an email address')); - }); - - it('should set the quota from a claim', async () => { - const callbackParams = await loginWithOAuth(OAuthUser.WITH_QUOTA); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - userId: expect.any(String), - userEmail: 'oauth-with-quota@immich.app', - }); - - const user = await getMyUser({ headers: asBearerAuth(body.accessToken) }); - expect(user.quotaSizeInBytes).toBe(25 * 2 ** 30); // 25 GiB; - }); - - it('should set the storage label from a claim', async () => { - const callbackParams = await loginWithOAuth(OAuthUser.WITH_USERNAME); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - userId: expect.any(String), - userEmail: 'oauth-with-username@immich.app', - }); - - const user = await getMyUser({ headers: asBearerAuth(body.accessToken) }); - expect(user.storageLabel).toBe('user-username'); - }); - - it('should set the admin status from a role claim', async () => { - const callbackParams = await loginWithOAuth(OAuthUser.WITH_ROLE); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - userId: expect.any(String), - userEmail: 'oauth-with-role@immich.app', - isAdmin: true, - }); - - const user = await getMyUser({ headers: asBearerAuth(body.accessToken) }); - expect(user.isAdmin).toBe(true); - }); - - it('should work with RS256 signed tokens', async () => { - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.RS256_TOKENS, - clientSecret: OAuthClient.RS256_TOKENS, - autoRegister: true, - buttonText: 'Login with Immich', - signingAlgorithm: 'RS256', - }); - const callbackParams = await loginWithOAuth('oauth-RS256-token'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - isAdmin: false, - name: 'OAuth User', - userEmail: 'oauth-RS256-token@immich.app', - userId: expect.any(String), - }); - }); - - it('should work with RS256 signed user profiles', async () => { - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.RS256_PROFILE, - clientSecret: OAuthClient.RS256_PROFILE, - buttonText: 'Login with Immich', - profileSigningAlgorithm: 'RS256', - }); - const callbackParams = await loginWithOAuth('oauth-signed-profile'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - userId: expect.any(String), - userEmail: 'oauth-signed-profile@immich.app', - }); - }); - - it('should throw an error for an invalid token algorithm', async () => { - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.DEFAULT, - clientSecret: OAuthClient.DEFAULT, - buttonText: 'Login with Immich', - signingAlgorithm: 'something-that-does-not-work', - }); - const callbackParams = await loginWithOAuth('oauth-signed-bad'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(500); - expect(body).toMatchObject({ - error: 'Internal Server Error', - message: 'Failed to finish oauth', - statusCode: 500, - }); - }); - - describe('autoRegister: false', () => { - beforeAll(async () => { - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.DEFAULT, - clientSecret: OAuthClient.DEFAULT, - autoRegister: false, - buttonText: 'Login with Immich', - }); - }); - - it('should not auto register the user', async () => { - const callbackParams = await loginWithOAuth('oauth-no-auto-register'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('User does not exist and auto registering is disabled.')); - }); - - it('should link to an existing user by email', async () => { - const { userId } = await utils.userSetup(admin.accessToken, { - name: 'OAuth User 3', - email: 'oauth-user3@immich.app', - password: 'password', - }); - const callbackParams = await loginWithOAuth('oauth-user3'); - const { status, body } = await request(app).post('/oauth/callback').send(callbackParams); - expect(status).toBe(201); - expect(body).toMatchObject({ - userId, - userEmail: 'oauth-user3@immich.app', - }); - }); - }); - }); - - describe('mobile redirect override', () => { - beforeAll(async () => { - await setupOAuth(admin.accessToken, { - enabled: true, - clientId: OAuthClient.DEFAULT, - clientSecret: OAuthClient.DEFAULT, - buttonText: 'Login with Immich', - storageLabelClaim: 'immich_username', - mobileOverrideEnabled: true, - mobileRedirectUri: mobileOverrideRedirectUri, - }); - }); - - it('should return the mobile redirect uri', async () => { - const { status, body } = await request(app) - .post('/oauth/authorize') - .send({ redirectUri: 'app.immich:///oauth-callback' }); - expect(status).toBe(201); - expect(body).toEqual({ url: expect.stringContaining(`${authServer.internal}/auth?`) }); - - const params = new URL(body.url).searchParams; - expect(params.get('client_id')).toBe('client-default'); - expect(params.get('response_type')).toBe('code'); - expect(params.get('redirect_uri')).toBe(mobileOverrideRedirectUri); - expect(params.get('state')).toBeDefined(); - }); - - it('should auto register the user by default', async () => { - const callbackParams = await loginWithOAuth('oauth-mobile-override', 'app.immich:///oauth-callback'); - expect(callbackParams.url).toEqual(expect.stringContaining(mobileOverrideRedirectUri)); - - // simulate redirecting back to mobile app - const url = callbackParams.url.replace(mobileOverrideRedirectUri, 'app.immich:///oauth-callback'); - - const { status, body } = await request(app) - .post('/oauth/callback') - .send({ ...callbackParams, url }); - expect(status).toBe(201); - expect(body).toMatchObject({ - accessToken: expect.any(String), - isAdmin: false, - name: 'OAuth User', - userEmail: 'oauth-mobile-override@immich.app', - userId: expect.any(String), - }); - }); - }); -}); diff --git a/e2e/src/api/specs/partner.e2e-spec.ts b/e2e/src/api/specs/partner.e2e-spec.ts deleted file mode 100644 index 9047a97055..0000000000 --- a/e2e/src/api/specs/partner.e2e-spec.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { LoginResponseDto, createPartner } from '@immich/sdk'; -import { createUserDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/partners', () => { - let admin: LoginResponseDto; - let user1: LoginResponseDto; - let user2: LoginResponseDto; - let user3: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - - [user1, user2, user3] = await Promise.all([ - utils.userSetup(admin.accessToken, createUserDto.user1), - utils.userSetup(admin.accessToken, createUserDto.user2), - utils.userSetup(admin.accessToken, createUserDto.user3), - ]); - - await Promise.all([ - createPartner({ partnerCreateDto: { sharedWithId: user2.userId } }, { headers: asBearerAuth(user1.accessToken) }), - createPartner({ partnerCreateDto: { sharedWithId: user1.userId } }, { headers: asBearerAuth(user2.accessToken) }), - ]); - }); - - describe('GET /partners', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/partners'); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should get all partners shared by user', async () => { - const { status, body } = await request(app) - .get('/partners') - .set('Authorization', `Bearer ${user1.accessToken}`) - .query({ direction: 'shared-by' }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: user2.userId })]); - }); - - it('should get all partners that share with user', async () => { - const { status, body } = await request(app) - .get('/partners') - .set('Authorization', `Bearer ${user1.accessToken}`) - .query({ direction: 'shared-with' }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: user2.userId })]); - }); - }); - - describe('POST /partners/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post(`/partners/${user3.userId}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should share with new partner', async () => { - const { status, body } = await request(app) - .post(`/partners/${user3.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(201); - expect(body).toEqual(expect.objectContaining({ id: user3.userId })); - }); - - it('should not share with new partner if already sharing with this partner', async () => { - const { status, body } = await request(app) - .post(`/partners/${user2.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(expect.objectContaining({ message: 'Partner already exists' })); - }); - }); - - describe('PUT /partners/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/partners/${user2.userId}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should update partner', async () => { - const { status, body } = await request(app) - .put(`/partners/${user2.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ inTimeline: false }); - - expect(status).toBe(200); - expect(body).toEqual(expect.objectContaining({ id: user2.userId, inTimeline: false })); - }); - }); - - describe('DELETE /partners/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).delete(`/partners/${user3.userId}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should delete partner', async () => { - const { status } = await request(app) - .delete(`/partners/${user3.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(204); - }); - - it('should throw a bad request if partner not found', async () => { - const { status, body } = await request(app) - .delete(`/partners/${user3.userId}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(expect.objectContaining({ message: 'Partner not found' })); - }); - }); -}); diff --git a/e2e/src/api/specs/person.e2e-spec.ts b/e2e/src/api/specs/person.e2e-spec.ts deleted file mode 100644 index 20290cd941..0000000000 --- a/e2e/src/api/specs/person.e2e-spec.ts +++ /dev/null @@ -1,346 +0,0 @@ -import { getPerson, LoginResponseDto, PersonResponseDto } from '@immich/sdk'; -import { uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -describe('/people', () => { - let admin: LoginResponseDto; - let visiblePerson: PersonResponseDto; - let hiddenPerson: PersonResponseDto; - let multipleAssetsPerson: PersonResponseDto; - - let nameAlicePerson: PersonResponseDto; - let nameBobPerson: PersonResponseDto; - let nameCharliePerson: PersonResponseDto; - let nameNullPerson4Assets: PersonResponseDto; - let nameNullPerson3Assets: PersonResponseDto; - let nameNullPerson1Asset: PersonResponseDto; - let nameBillPersonFavourite: PersonResponseDto; - let nameFreddyPersonFavourite: PersonResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - - [ - visiblePerson, - hiddenPerson, - multipleAssetsPerson, - nameCharliePerson, - nameBobPerson, - nameAlicePerson, - nameNullPerson4Assets, - nameNullPerson3Assets, - nameNullPerson1Asset, - nameBillPersonFavourite, - nameFreddyPersonFavourite, - ] = await Promise.all([ - utils.createPerson(admin.accessToken, { - name: 'visible_person', - }), - utils.createPerson(admin.accessToken, { - name: 'hidden_person', - isHidden: true, - }), - utils.createPerson(admin.accessToken, { - name: 'multiple_assets_person', - }), - // --- Setup for the specific sorting test --- - utils.createPerson(admin.accessToken, { - name: 'Charlie', - }), - utils.createPerson(admin.accessToken, { - name: 'Bob', - }), - utils.createPerson(admin.accessToken, { - name: 'Alice', - }), - utils.createPerson(admin.accessToken, { - name: '', - }), - utils.createPerson(admin.accessToken, { - name: '', - }), - utils.createPerson(admin.accessToken, { - name: '', - }), - utils.createPerson(admin.accessToken, { - name: 'Bill', - isFavorite: true, - }), - utils.createPerson(admin.accessToken, { - name: 'Freddy', - isFavorite: true, - }), - ]); - - const asset1 = await utils.createAsset(admin.accessToken); - const asset2 = await utils.createAsset(admin.accessToken); - const asset3 = await utils.createAsset(admin.accessToken); - const asset4 = await utils.createAsset(admin.accessToken); - - await Promise.all([ - utils.createFace({ assetId: asset1.id, personId: visiblePerson.id }), - utils.createFace({ assetId: asset1.id, personId: hiddenPerson.id }), - utils.createFace({ assetId: asset1.id, personId: multipleAssetsPerson.id }), - utils.createFace({ assetId: asset1.id, personId: multipleAssetsPerson.id }), - utils.createFace({ assetId: asset2.id, personId: multipleAssetsPerson.id }), - utils.createFace({ assetId: asset3.id, personId: multipleAssetsPerson.id }), // 4 assets - // Named persons - utils.createFace({ assetId: asset1.id, personId: nameCharliePerson.id }), // 1 asset - utils.createFace({ assetId: asset1.id, personId: nameBobPerson.id }), - utils.createFace({ assetId: asset2.id, personId: nameBobPerson.id }), // 2 assets - utils.createFace({ assetId: asset1.id, personId: nameAlicePerson.id }), // 1 asset - // Null-named person 4 assets - utils.createFace({ assetId: asset1.id, personId: nameNullPerson4Assets.id }), - utils.createFace({ assetId: asset2.id, personId: nameNullPerson4Assets.id }), - utils.createFace({ assetId: asset3.id, personId: nameNullPerson4Assets.id }), - utils.createFace({ assetId: asset4.id, personId: nameNullPerson4Assets.id }), // 4 assets - // Null-named person 3 assets - utils.createFace({ assetId: asset1.id, personId: nameNullPerson3Assets.id }), - utils.createFace({ assetId: asset2.id, personId: nameNullPerson3Assets.id }), - utils.createFace({ assetId: asset3.id, personId: nameNullPerson3Assets.id }), // 3 assets - // Null-named person 1 asset - utils.createFace({ assetId: asset3.id, personId: nameNullPerson1Asset.id }), - // Favourite People - utils.createFace({ assetId: asset1.id, personId: nameFreddyPersonFavourite.id }), - utils.createFace({ assetId: asset2.id, personId: nameFreddyPersonFavourite.id }), - utils.createFace({ assetId: asset1.id, personId: nameBillPersonFavourite.id }), - ]); - }); - - describe('GET /people', () => { - beforeEach(async () => {}); - it('should return all people (including hidden)', async () => { - const { status, body } = await request(app) - .get('/people') - .set('Authorization', `Bearer ${admin.accessToken}`) - .query({ withHidden: true }); - - expect(status).toBe(200); - expect(body).toEqual({ - hasNextPage: false, - total: 11, - hidden: 1, - people: [ - expect.objectContaining({ name: 'Freddy' }), - expect.objectContaining({ name: 'Bill' }), - expect.objectContaining({ name: 'multiple_assets_person' }), - expect.objectContaining({ name: 'Bob' }), - expect.objectContaining({ name: 'Alice' }), - expect.objectContaining({ name: 'Charlie' }), - expect.objectContaining({ name: 'visible_person' }), - expect.objectContaining({ id: nameNullPerson4Assets.id, name: '' }), - expect.objectContaining({ id: nameNullPerson3Assets.id, name: '' }), - expect.objectContaining({ name: 'hidden_person' }), // Should really be before the null names - ], - }); - }); - - it('should sort visible people by asset count (desc), then by name (asc, nulls last)', async () => { - const { status, body } = await request(app).get('/people').set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body.hasNextPage).toBe(false); - expect(body.total).toBe(11); // All persons - expect(body.hidden).toBe(1); // 'hidden_person' - - const people = body.people as PersonResponseDto[]; - - expect(people.map((p) => p.id)).toEqual([ - nameFreddyPersonFavourite.id, // name: 'Freddy', count: 2 - nameBillPersonFavourite.id, // name: 'Bill', count: 1 - multipleAssetsPerson.id, // name: 'multiple_assets_person', count: 3 - nameBobPerson.id, // name: 'Bob', count: 2 - nameAlicePerson.id, // name: 'Alice', count: 1 - nameCharliePerson.id, // name: 'Charlie', count: 1 - visiblePerson.id, // name: 'visible_person', count: 1 - nameNullPerson4Assets.id, // name: '', count: 4 - nameNullPerson3Assets.id, // name: '', count: 3 - ]); - - expect(people.some((p) => p.id === hiddenPerson.id)).toBe(false); - }); - - it('should return only visible people', async () => { - const { status, body } = await request(app).get('/people').set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - hasNextPage: false, - total: 11, - hidden: 1, - people: [ - expect.objectContaining({ name: 'Freddy' }), - expect.objectContaining({ name: 'Bill' }), - expect.objectContaining({ name: 'multiple_assets_person' }), - expect.objectContaining({ name: 'Bob' }), - expect.objectContaining({ name: 'Alice' }), - expect.objectContaining({ name: 'Charlie' }), - expect.objectContaining({ name: 'visible_person' }), - expect.objectContaining({ id: nameNullPerson4Assets.id, name: '' }), - expect.objectContaining({ id: nameNullPerson3Assets.id, name: '' }), - ], - }); - }); - - it('should support pagination', async () => { - const { status, body } = await request(app) - .get('/people') - .set('Authorization', `Bearer ${admin.accessToken}`) - .query({ withHidden: true, page: 5, size: 1 }); - - expect(status).toBe(200); - expect(body).toEqual({ - hasNextPage: true, - total: 11, - hidden: 1, - people: [expect.objectContaining({ name: 'Alice' })], - }); - }); - }); - - describe('GET /people/:id', () => { - it('should throw error if person with id does not exist', async () => { - const { status, body } = await request(app) - .get(`/people/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should return person information', async () => { - const { status, body } = await request(app) - .get(`/people/${visiblePerson.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual(expect.objectContaining({ id: visiblePerson.id })); - }); - }); - - describe('GET /people/:id/statistics', () => { - it('should throw error if person with id does not exist', async () => { - const { status, body } = await request(app) - .get(`/people/${uuidDto.notFound}/statistics`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should return the correct number of assets', async () => { - const { status, body } = await request(app) - .get(`/people/${multipleAssetsPerson.id}/statistics`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual(expect.objectContaining({ assets: 3 })); - }); - }); - - describe('POST /people', () => { - it('should create a person', async () => { - const { status, body } = await request(app) - .post(`/people`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - name: 'New Person', - birthDate: '1990-01-01', - color: '#333', - }); - expect(status).toBe(201); - expect(body).toMatchObject({ - id: expect.any(String), - name: 'New Person', - birthDate: '1990-01-01', - }); - }); - - it('should create a favorite person', async () => { - const { status, body } = await request(app) - .post(`/people`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - name: 'New Favorite Person', - isFavorite: true, - }); - expect(status).toBe(201); - expect(body).toMatchObject({ - id: expect.any(String), - name: 'New Favorite Person', - isFavorite: true, - }); - }); - }); - - describe('PUT /people/:id', () => { - it('should update a date of birth', async () => { - const { status, body } = await request(app) - .put(`/people/${visiblePerson.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ birthDate: '1990-01-01' }); - expect(status).toBe(200); - expect(body).toMatchObject({ birthDate: '1990-01-01' }); - }); - - it('should clear a date of birth', async () => { - const { status, body } = await request(app) - .put(`/people/${visiblePerson.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ birthDate: null }); - expect(status).toBe(200); - expect(body).toMatchObject({ birthDate: null }); - }); - - it('should set a color', async () => { - const { status, body } = await request(app) - .put(`/people/${visiblePerson.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ color: '#555' }); - expect(status).toBe(200); - expect(body).toMatchObject({ color: '#555' }); - }); - - it('should clear a color', async () => { - const { status, body } = await request(app) - .put(`/people/${visiblePerson.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ color: null }); - expect(status).toBe(200); - expect(body.color).toBeUndefined(); - }); - - it('should mark a person as favorite', async () => { - const person = await utils.createPerson(admin.accessToken, { - name: 'visible_person', - }); - - expect(person.isFavorite).toBe(false); - - const { status, body } = await request(app) - .put(`/people/${person.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ isFavorite: true }); - expect(status).toBe(200); - expect(body).toMatchObject({ isFavorite: true }); - - const person2 = await getPerson({ id: person.id }, { headers: asBearerAuth(admin.accessToken) }); - expect(person2).toMatchObject({ id: person.id, isFavorite: true }); - }); - }); - - describe('POST /people/:id/merge', () => { - it('should not supporting merging a person into themselves', async () => { - const { status, body } = await request(app) - .post(`/people/${visiblePerson.id}/merge`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ids: [visiblePerson.id] }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Cannot merge a person into themselves')); - }); - }); -}); diff --git a/e2e/src/api/specs/search.e2e-spec.ts b/e2e/src/api/specs/search.e2e-spec.ts deleted file mode 100644 index 2f6ea75f77..0000000000 --- a/e2e/src/api/specs/search.e2e-spec.ts +++ /dev/null @@ -1,703 +0,0 @@ -import { - AssetMediaResponseDto, - AssetResponseDto, - AssetVisibility, - deleteAssets, - LoginResponseDto, - updateAsset, -} from '@immich/sdk'; -import { DateTime } from 'luxon'; -import { readFile } from 'node:fs/promises'; -import { join } from 'node:path'; -import { Socket } from 'socket.io-client'; -import { app, asBearerAuth, TEN_TIMES, testAssetDir, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; -const today = DateTime.now(); - -describe('/search', () => { - let admin: LoginResponseDto; - let websocket: Socket; - - let assetFalcon: AssetMediaResponseDto; - let assetDenali: AssetMediaResponseDto; - let assetCyclamen: AssetMediaResponseDto; - let assetNotocactus: AssetMediaResponseDto; - let assetSilver: AssetMediaResponseDto; - let assetDensity: AssetMediaResponseDto; - // let assetPhiladelphia: AssetMediaResponseDto; - // let assetOrychophragmus: AssetMediaResponseDto; - // let assetRidge: AssetMediaResponseDto; - // let assetPolemonium: AssetMediaResponseDto; - // let assetWood: AssetMediaResponseDto; - // let assetGlarus: AssetMediaResponseDto; - let assetHeic: AssetMediaResponseDto; - let assetRocks: AssetMediaResponseDto; - let assetOneJpg6: AssetMediaResponseDto; - let assetOneHeic6: AssetMediaResponseDto; - let assetOneJpg5: AssetMediaResponseDto; - let assetSprings: AssetMediaResponseDto; - let assetLast: AssetMediaResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - websocket = await utils.connectWebsocket(admin.accessToken); - - const files = [ - { filename: '/albums/nature/prairie_falcon.jpg' }, - { filename: '/formats/webp/denali.webp' }, - { filename: '/albums/nature/cyclamen_persicum.jpg', dto: { isFavorite: true } }, - { filename: '/albums/nature/notocactus_minimus.jpg' }, - { filename: '/albums/nature/silver_fir.jpg' }, - { filename: '/formats/heic/IMG_2682.heic' }, - { filename: '/formats/jpg/el_torcal_rocks.jpg' }, - { filename: '/formats/motionphoto/samsung-one-ui-6.jpg' }, - { filename: '/formats/motionphoto/samsung-one-ui-6.heic' }, - { filename: '/formats/motionphoto/samsung-one-ui-5.jpg' }, - - { filename: '/metadata/gps-position/thompson-springs.jpg', dto: { visibility: AssetVisibility.Archive } }, - - // used for search suggestions - { filename: '/formats/png/density_plot.png' }, - { filename: '/formats/raw/Nikon/D80/glarus.nef' }, - { filename: '/formats/raw/Nikon/D700/philadelphia.nef' }, - { filename: '/albums/nature/orychophragmus_violaceus.jpg' }, - { filename: '/albums/nature/tanners_ridge.jpg' }, - { filename: '/albums/nature/polemonium_reptans.jpg' }, - - // last asset - { filename: '/albums/nature/wood_anemones.jpg' }, - ]; - const assets: AssetMediaResponseDto[] = []; - for (const { filename, dto } of files) { - const bytes = await readFile(join(testAssetDir, filename)); - assets.push( - await utils.createAsset(admin.accessToken, { - deviceAssetId: `test-${filename}`, - assetData: { bytes, filename }, - ...dto, - }), - ); - } - - for (const asset of assets) { - await utils.waitForWebsocketEvent({ event: 'assetUpload', id: asset.id }); - } - - // note: the coordinates here are not the actual coordinates of the images and are random for most of them - const coordinates = [ - { latitude: 48.853_41, longitude: 2.3488 }, // paris - { latitude: 35.6895, longitude: 139.691_71 }, // tokyo - { latitude: 52.524_37, longitude: 13.410_53 }, // berlin - { latitude: 1.314_663_1, longitude: 103.845_409_3 }, // singapore - { latitude: 41.013_84, longitude: 28.949_66 }, // istanbul - { latitude: 5.556_02, longitude: -0.1969 }, // accra - { latitude: 37.544_270_6, longitude: -4.727_752_8 }, // andalusia - { latitude: 23.133_02, longitude: -82.383_04 }, // havana - { latitude: 41.694_11, longitude: 44.833_68 }, // tbilisi - { latitude: 31.222_22, longitude: 121.458_06 }, // shanghai - { latitude: 38.9711, longitude: -109.7137 }, // thompson springs - { latitude: 40.714_27, longitude: -74.005_97 }, // new york - { latitude: 47.040_57, longitude: 9.068_04 }, // glarus - { latitude: 32.771_52, longitude: -89.116_73 }, // philadelphia - { latitude: 31.634_16, longitude: -7.999_94 }, // marrakesh - { latitude: 38.523_735_4, longitude: -78.488_619_4 }, // tanners ridge - { latitude: 59.938_63, longitude: 30.314_13 }, // st. petersburg - { latitude: 0, longitude: 0 }, // null island - ]; - - const updates = coordinates.map((dto, i) => - updateAsset({ id: assets[i].id, updateAssetDto: dto }, { headers: asBearerAuth(admin.accessToken) }), - ); - - await Promise.all(updates); - for (const [i] of coordinates.entries()) { - await utils.waitForWebsocketEvent({ event: 'assetUpdate', id: assets[i].id }); - } - - [ - assetFalcon, - assetDenali, - assetCyclamen, - assetNotocactus, - assetSilver, - assetHeic, - assetRocks, - assetOneJpg6, - assetOneHeic6, - assetOneJpg5, - assetSprings, - assetDensity, - // assetGlarus, - // assetPhiladelphia, - // assetOrychophragmus, - // assetRidge, - // assetPolemonium, - // assetWood, - ] = assets; - - assetLast = assets.at(-1) as AssetMediaResponseDto; - - await deleteAssets({ assetBulkDeleteDto: { ids: [assetSilver.id] } }, { headers: asBearerAuth(admin.accessToken) }); - }, 30_000); - - afterAll(async () => { - utils.disconnectWebsocket(websocket); - }); - - describe('POST /search/metadata', () => { - const searchTests = [ - { - should: 'should get my assets', - deferred: () => ({ dto: { size: 1 }, assets: [assetLast] }), - }, - { - should: 'should sort my assets in reverse', - deferred: () => ({ dto: { order: 'asc', size: 2 }, assets: [assetCyclamen, assetNotocactus] }), - }, - { - should: 'should support pagination', - deferred: () => ({ dto: { order: 'asc', size: 1, page: 2 }, assets: [assetNotocactus] }), - }, - { - should: 'should search by checksum (base64)', - deferred: () => ({ dto: { checksum: '9IXBDMjj9OrQb+1YMHprZJgZ/UQ=' }, assets: [assetCyclamen] }), - }, - { - should: 'should search by checksum (hex)', - deferred: () => ({ dto: { checksum: 'f485c10cc8e3f4ead06fed58307a6b649819fd44' }, assets: [assetCyclamen] }), - }, - { should: 'should search by id', deferred: () => ({ dto: { id: assetCyclamen.id }, assets: [assetCyclamen] }) }, - { - should: 'should search by isFavorite (true)', - deferred: () => ({ dto: { isFavorite: true }, assets: [assetCyclamen] }), - }, - { - should: 'should search by isFavorite (false)', - deferred: () => ({ dto: { size: 1, isFavorite: false }, assets: [assetLast] }), - }, - { - should: 'should search by visibility (AssetVisibility.Archive)', - deferred: () => ({ dto: { visibility: AssetVisibility.Archive }, assets: [assetSprings] }), - }, - { - should: 'should search by visibility (AssetVisibility.Timeline)', - deferred: () => ({ dto: { size: 1, visibility: AssetVisibility.Timeline }, assets: [assetLast] }), - }, - { - should: 'should search by type (image)', - deferred: () => ({ dto: { size: 1, type: 'IMAGE' }, assets: [assetLast] }), - }, - { - should: 'should search by type (video)', - deferred: () => ({ - dto: { type: 'VIDEO', visibility: AssetVisibility.Hidden }, - assets: [ - // the three live motion photos - { id: expect.any(String) }, - { id: expect.any(String) }, - { id: expect.any(String) }, - ], - }), - }, - { - should: 'should search by trashedBefore', - deferred: () => ({ dto: { trashedBefore: today.plus({ hour: 1 }).toJSDate() }, assets: [assetSilver] }), - }, - { - should: 'should search by trashedBefore (no results)', - deferred: () => ({ dto: { trashedBefore: today.minus({ days: 1 }).toJSDate() }, assets: [] }), - }, - { - should: 'should search by trashedAfter', - deferred: () => ({ dto: { trashedAfter: today.minus({ hour: 1 }).toJSDate() }, assets: [assetSilver] }), - }, - { - should: 'should search by trashedAfter (no results)', - deferred: () => ({ dto: { trashedAfter: today.plus({ hour: 1 }).toJSDate() }, assets: [] }), - }, - { - should: 'should search by takenBefore', - deferred: () => ({ dto: { size: 1, takenBefore: today.plus({ hour: 1 }).toJSDate() }, assets: [assetLast] }), - }, - { - should: 'should search by takenBefore (no results)', - deferred: () => ({ dto: { takenBefore: DateTime.fromObject({ year: 1234 }).toJSDate() }, assets: [] }), - }, - { - should: 'should search by takenAfter', - deferred: () => ({ - dto: { size: 1, takenAfter: DateTime.fromObject({ year: 1234 }).toJSDate() }, - assets: [assetLast], - }), - }, - { - should: 'should search by takenAfter (no results)', - deferred: () => ({ dto: { takenAfter: today.plus({ hour: 1 }).toJSDate() }, assets: [] }), - }, - { - should: 'should search by originalFilename', - deferred: () => ({ - dto: { originalFileName: 'rocks' }, - assets: [assetRocks], - }), - }, - { - should: 'should search by originalFilename with spaces', - deferred: () => ({ - dto: { originalFileName: 'samsung-one', type: 'IMAGE' }, - assets: [assetOneJpg5, assetOneJpg6, assetOneHeic6], - }), - }, - { - should: 'should search by city', - deferred: () => ({ - dto: { - city: 'Accra', - includeNull: true, - }, - assets: [assetHeic], - }), - }, - { - should: "should search city ('')", - deferred: () => ({ - dto: { - city: '', - visibility: AssetVisibility.Timeline, - includeNull: true, - }, - assets: [assetLast], - }), - }, - { - should: 'should search city (null)', - deferred: () => ({ - dto: { - city: null, - visibility: AssetVisibility.Timeline, - includeNull: true, - }, - assets: [assetLast], - }), - }, - { - should: 'should search by state', - deferred: () => ({ - dto: { - state: 'New York', - includeNull: true, - }, - assets: [assetDensity], - }), - }, - { - should: "should search state ('')", - deferred: () => ({ - dto: { - state: '', - visibility: AssetVisibility.Timeline, - withExif: true, - includeNull: true, - }, - assets: [assetLast, assetNotocactus], - }), - }, - { - should: 'should search state (null)', - deferred: () => ({ - dto: { - state: null, - visibility: AssetVisibility.Timeline, - includeNull: true, - }, - assets: [assetLast, assetNotocactus], - }), - }, - { - should: 'should search by country', - deferred: () => ({ - dto: { - country: 'France', - includeNull: true, - }, - assets: [assetFalcon], - }), - }, - { - should: "should search country ('')", - deferred: () => ({ - dto: { - country: '', - visibility: AssetVisibility.Timeline, - includeNull: true, - }, - assets: [assetLast], - }), - }, - { - should: 'should search country (null)', - deferred: () => ({ - dto: { - country: null, - visibility: AssetVisibility.Timeline, - includeNull: true, - }, - assets: [assetLast], - }), - }, - { - should: 'should search by make', - deferred: () => ({ - dto: { - make: 'Canon', - includeNull: true, - }, - assets: [assetFalcon, assetDenali], - }), - }, - { - should: 'should search by model', - deferred: () => ({ - dto: { - model: 'Canon EOS 7D', - includeNull: true, - }, - assets: [assetDenali], - }), - }, - { - should: 'should allow searching the upload library (libraryId: null)', - deferred: () => ({ - dto: { libraryId: null, size: 1 }, - assets: [assetLast], - }), - }, - ]; - - for (const { should, deferred } of searchTests) { - it(should, async () => { - const { assets, dto } = deferred(); - const { status, body } = await request(app) - .post('/search/metadata') - .send(dto) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body.assets).toBeDefined(); - expect(Array.isArray(body.assets.items)).toBe(true); - for (const [i, asset] of assets.entries()) { - expect(body.assets.items[i]).toEqual(expect.objectContaining({ id: asset.id })); - } - expect(body.assets.items).toHaveLength(assets.length); - }); - } - }); - - describe('POST /search/random', () => { - beforeAll(async () => { - await Promise.all([ - utils.createAsset(admin.accessToken), - utils.createAsset(admin.accessToken), - utils.createAsset(admin.accessToken), - utils.createAsset(admin.accessToken), - utils.createAsset(admin.accessToken), - utils.createAsset(admin.accessToken), - ]); - - await utils.waitForQueueFinish(admin.accessToken, 'thumbnailGeneration'); - }); - - it.each(TEN_TIMES)('should return 1 random assets', async () => { - const { status, body } = await request(app) - .post('/search/random') - .send({ size: 1 }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - - const assets: AssetResponseDto[] = body; - expect(assets.length).toBe(1); - expect(assets[0].ownerId).toBe(admin.userId); - }); - - it.each(TEN_TIMES)('should return 2 random assets', async () => { - const { status, body } = await request(app) - .post('/search/random') - .send({ size: 2 }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - - const assets: AssetResponseDto[] = body; - expect(assets.length).toBe(2); - expect(assets[0].ownerId).toBe(admin.userId); - expect(assets[1].ownerId).toBe(admin.userId); - }); - }); - - describe('GET /search/explore', () => { - it('should get explore data', async () => { - const { status, body } = await request(app) - .get('/search/explore') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual([{ fieldName: 'exifInfo.city', items: [] }]); - }); - }); - - describe('GET /search/places', () => { - it('should get relevant places', async () => { - const name = 'Paris'; - - const { status, body } = await request(app) - .get(`/search/places?name=${name}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(Array.isArray(body)).toBe(true); - if (Array.isArray(body)) { - expect(body.length).toBeGreaterThan(10); - expect(body[0].name).toEqual(name); - expect(body[0].admin2name).toEqual(name); - } - }); - }); - - describe('GET /search/cities', () => { - it('should get all cities', async () => { - const { status, body } = await request(app) - .get('/search/cities') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(Array.isArray(body)).toBe(true); - if (Array.isArray(body)) { - expect(body.length).toBeGreaterThan(10); - const assetsWithCity = body.filter((asset) => !!asset.exifInfo?.city); - expect(assetsWithCity.length).toEqual(body.length); - const cities = new Set(assetsWithCity.map((asset) => asset.exifInfo.city)); - expect(cities.size).toEqual(body.length); - } - }); - }); - - describe('GET /search/suggestions', () => { - it('should get suggestions for country (including null)', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=country&includeNull=true') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Cuba', - 'France', - 'Georgia', - 'Germany', - 'Ghana', - 'Japan', - 'Morocco', - "People's Republic of China", - 'Russian Federation', - 'Singapore', - 'Spain', - 'Switzerland', - 'United States of America', - null, - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for country', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=country') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Cuba', - 'France', - 'Georgia', - 'Germany', - 'Ghana', - 'Japan', - 'Morocco', - "People's Republic of China", - 'Russian Federation', - 'Singapore', - 'Spain', - 'Switzerland', - 'United States of America', - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for state (including null)', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=state&includeNull=true') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Andalusia', - 'Glarus', - 'Greater Accra', - 'Havana', - 'Île-de-France', - 'Marrakesh-Safi', - 'Mississippi', - 'New York', - 'Shanghai', - 'State of Berlin', - 'St.-Petersburg', - 'Tbilisi', - 'Tokyo', - 'Virginia', - null, - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for state', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=state') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Andalusia', - 'Glarus', - 'Greater Accra', - 'Havana', - 'Île-de-France', - 'Marrakesh-Safi', - 'Mississippi', - 'New York', - 'Shanghai', - 'State of Berlin', - 'St.-Petersburg', - 'Tbilisi', - 'Tokyo', - 'Virginia', - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for city (including null)', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=city&includeNull=true') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Accra', - 'Berlin', - 'Glarus', - 'Havana', - 'Marrakesh', - 'Montalbán de Córdoba', - 'New York City', - 'Novena', - 'Paris', - 'Philadelphia', - 'Saint Petersburg', - 'Shanghai', - 'Stanley', - 'Tbilisi', - 'Tokyo', - null, - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for city', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=city') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Accra', - 'Berlin', - 'Glarus', - 'Havana', - 'Marrakesh', - 'Montalbán de Córdoba', - 'New York City', - 'Novena', - 'Paris', - 'Philadelphia', - 'Saint Petersburg', - 'Shanghai', - 'Stanley', - 'Tbilisi', - 'Tokyo', - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for camera make (including null)', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=camera-make&includeNull=true') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Apple', - 'Canon', - 'FUJIFILM', - 'NIKON CORPORATION', - 'PENTAX Corporation', - 'samsung', - 'SONY', - null, - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for camera make', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=camera-make') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Apple', - 'Canon', - 'FUJIFILM', - 'NIKON CORPORATION', - 'PENTAX Corporation', - 'samsung', - 'SONY', - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for camera model (including null)', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=camera-model&includeNull=true') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Canon EOS 7D', - 'Canon EOS R5', - 'DSLR-A550', - 'FinePix S3Pro', - 'iPhone 7', - 'NIKON D700', - 'NIKON D750', - 'NIKON D80', - 'PENTAX K10D', - 'SM-F711N', - 'SM-S906U', - 'SM-T970', - null, - ]); - expect(status).toBe(200); - }); - - it('should get suggestions for camera model', async () => { - const { status, body } = await request(app) - .get('/search/suggestions?type=camera-model') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([ - 'Canon EOS 7D', - 'Canon EOS R5', - 'DSLR-A550', - 'FinePix S3Pro', - 'iPhone 7', - 'NIKON D700', - 'NIKON D750', - 'NIKON D80', - 'PENTAX K10D', - 'SM-F711N', - 'SM-S906U', - 'SM-T970', - ]); - expect(status).toBe(200); - }); - }); -}); diff --git a/e2e/src/api/specs/server.e2e-spec.ts b/e2e/src/api/specs/server.e2e-spec.ts index 3dd6f15e71..4ec892c42a 100644 --- a/e2e/src/api/specs/server.e2e-spec.ts +++ b/e2e/src/api/specs/server.e2e-spec.ts @@ -1,4 +1,4 @@ -import { LoginResponseDto } from '@immich/sdk'; +import { LoginResponseDto } from '@server/sdk'; import { createUserDto } from 'src/fixtures'; import { errorDto } from 'src/responses'; import { app, utils } from 'src/utils'; diff --git a/e2e/src/api/specs/session.e2e-spec.ts b/e2e/src/api/specs/session.e2e-spec.ts index 0b632f78ba..e6441a7071 100644 --- a/e2e/src/api/specs/session.e2e-spec.ts +++ b/e2e/src/api/specs/session.e2e-spec.ts @@ -1,4 +1,4 @@ -import { LoginResponseDto, getSessions, login, signUpAdmin } from '@immich/sdk'; +import { LoginResponseDto, getSessions, login, signUpAdmin } from '@server/sdk'; import { loginDto, signupDto, uuidDto } from 'src/fixtures'; import { deviceDto, errorDto } from 'src/responses'; import { app, asBearerAuth, utils } from 'src/utils'; diff --git a/e2e/src/api/specs/shared-link.e2e-spec.ts b/e2e/src/api/specs/shared-link.e2e-spec.ts deleted file mode 100644 index 8c15a14da5..0000000000 --- a/e2e/src/api/specs/shared-link.e2e-spec.ts +++ /dev/null @@ -1,477 +0,0 @@ -import { - AlbumResponseDto, - AssetMediaResponseDto, - LoginResponseDto, - SharedLinkResponseDto, - SharedLinkType, - createAlbum, - deleteUserAdmin, -} from '@immich/sdk'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, baseUrl, shareUrl, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/shared-links', () => { - let admin: LoginResponseDto; - let asset1: AssetMediaResponseDto; - let asset2: AssetMediaResponseDto; - let user1: LoginResponseDto; - let user2: LoginResponseDto; - let album: AlbumResponseDto; - let deletedAlbum: AlbumResponseDto; - let linkWithDeletedAlbum: SharedLinkResponseDto; - let linkWithPassword: SharedLinkResponseDto; - let linkWithAlbum: SharedLinkResponseDto; - let linkWithAssets: SharedLinkResponseDto; - let linkWithMetadata: SharedLinkResponseDto; - let linkWithoutMetadata: SharedLinkResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - - [user1, user2] = await Promise.all([ - utils.userSetup(admin.accessToken, createUserDto.user1), - utils.userSetup(admin.accessToken, createUserDto.user2), - ]); - - [asset1, asset2] = await Promise.all([utils.createAsset(user1.accessToken), utils.createAsset(user1.accessToken)]); - - [album, deletedAlbum] = await Promise.all([ - createAlbum({ createAlbumDto: { albumName: 'album' } }, { headers: asBearerAuth(user1.accessToken) }), - createAlbum({ createAlbumDto: { albumName: 'deleted album' } }, { headers: asBearerAuth(user2.accessToken) }), - ]); - - [linkWithDeletedAlbum, linkWithAlbum, linkWithAssets, linkWithPassword, linkWithMetadata, linkWithoutMetadata] = - await Promise.all([ - utils.createSharedLink(user2.accessToken, { - type: SharedLinkType.Album, - albumId: deletedAlbum.id, - }), - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Album, - albumId: album.id, - }), - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset1.id], - }), - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Album, - albumId: album.id, - password: 'foo', - }), - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset1.id], - showMetadata: true, - slug: 'metadata-slug', - }), - utils.createSharedLink(user1.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset1.id], - showMetadata: false, - }), - ]); - - await deleteUserAdmin({ id: user2.userId, userAdminDeleteDto: {} }, { headers: asBearerAuth(admin.accessToken) }); - }); - - describe('GET /share/:key', () => { - it('should have correct asset count in meta tag for non-empty album', async () => { - const resp = await request(shareUrl).get(`/${linkWithMetadata.key}`); - expect(resp.status).toBe(200); - expect(resp.header['content-type']).toContain('text/html'); - expect(resp.text).toContain(``); - }); - - it('should have correct asset count in meta tag for empty album', async () => { - const resp = await request(shareUrl).get(`/${linkWithAlbum.key}`); - expect(resp.status).toBe(200); - expect(resp.header['content-type']).toContain('text/html'); - expect(resp.text).toContain(``); - }); - - it('should have correct asset count in meta tag for shared asset', async () => { - const resp = await request(shareUrl).get(`/${linkWithAssets.key}`); - expect(resp.status).toBe(200); - expect(resp.header['content-type']).toContain('text/html'); - expect(resp.text).toContain(``); - }); - - it('should have fqdn og:image meta tag for shared asset', async () => { - const resp = await request(shareUrl).get(`/${linkWithAssets.key}`); - expect(resp.status).toBe(200); - expect(resp.header['content-type']).toContain('text/html'); - expect(resp.text).toContain(``); - }); - }); - - describe('GET /shared-links', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/shared-links'); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should get all shared links created by user', async () => { - const { status, body } = await request(app) - .get('/shared-links') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(5); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ id: linkWithAlbum.id }), - expect.objectContaining({ - id: linkWithAssets.id, - assets: expect.arrayContaining([expect.objectContaining({ id: asset1.id })]), - }), - expect.objectContaining({ id: linkWithPassword.id }), - expect.objectContaining({ id: linkWithMetadata.id }), - expect.objectContaining({ id: linkWithoutMetadata.id }), - ]), - ); - }); - - it('should filter on albumId', async () => { - const { status, body } = await request(app) - .get(`/shared-links?albumId=${album.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(2); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ id: linkWithAlbum.id }), - expect.objectContaining({ id: linkWithPassword.id }), - ]), - ); - }); - - it('should find 0 albums', async () => { - const { status, body } = await request(app) - .get(`/shared-links?albumId=${uuidDto.notFound}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(0); - }); - - it('should not get shared links created by other users', async () => { - const { status, body } = await request(app) - .get('/shared-links') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual([]); - }); - }); - - describe('GET /shared-links/me', () => { - it('should not require admin authentication', async () => { - const { status } = await request(app).get('/shared-links/me').set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(403); - }); - - it('should get data for correct shared link', async () => { - const { status, body } = await request(app).get('/shared-links/me').query({ key: linkWithAlbum.key }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - album: expect.objectContaining({ id: album.id }), - userId: user1.userId, - type: SharedLinkType.Album, - }), - ); - }); - - it('should return unauthorized for incorrect shared link', async () => { - const { status, body } = await request(app) - .get('/shared-links/me') - .query({ key: linkWithAlbum.key + 'foo' }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.invalidShareKey); - }); - - it('should return unauthorized if target has been soft deleted', async () => { - const { status, body } = await request(app).get('/shared-links/me').query({ key: linkWithDeletedAlbum.key }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.invalidShareKey); - }); - - it('should return unauthorized for password protected link', async () => { - const { status, body } = await request(app).get('/shared-links/me').query({ key: linkWithPassword.key }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.invalidSharePassword); - }); - - it('should get data for correct password protected link', async () => { - const { status, body } = await request(app) - .get('/shared-links/me') - .query({ key: linkWithPassword.key, password: 'foo' }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - album: expect.objectContaining({ id: album.id }), - userId: user1.userId, - type: SharedLinkType.Album, - }), - ); - }); - - it('should return metadata for individual shared link', async () => { - const { status, body } = await request(app).get('/shared-links/me').query({ key: linkWithMetadata.key }); - - expect(status).toBe(200); - expect(body.assets).toHaveLength(1); - expect(body.album).not.toBeDefined(); - }); - - it('should not return metadata for album shared link without metadata', async () => { - const { status, body } = await request(app).get('/shared-links/me').query({ key: linkWithoutMetadata.key }); - - expect(status).toBe(200); - expect(body.assets).toHaveLength(1); - expect(body.album).not.toBeDefined(); - - const asset = body.assets[0]; - expect(asset).not.toHaveProperty('exifInfo'); - expect(asset).not.toHaveProperty('fileCreatedAt'); - expect(asset).not.toHaveProperty('originalFilename'); - expect(asset).not.toHaveProperty('originalPath'); - }); - }); - - describe('GET /shared-links/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get(`/shared-links/${linkWithAlbum.id}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should get shared link by id', async () => { - const { status, body } = await request(app) - .get(`/shared-links/${linkWithAlbum.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - album: expect.objectContaining({ id: album.id }), - userId: user1.userId, - type: SharedLinkType.Album, - }), - ); - }); - - it('should not get shared link by id if user has not created the link or it does not exist', async () => { - const { status, body } = await request(app) - .get(`/shared-links/${linkWithAlbum.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(expect.objectContaining({ message: 'Shared link not found' })); - }); - }); - - describe('POST /shared-links', () => { - it('should require authentication', async () => { - const { status, body } = await request(app) - .post('/shared-links') - .send({ type: SharedLinkType.Album, albumId: uuidDto.notFound }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require a type and the correspondent asset/album id', async () => { - const { status, body } = await request(app) - .post('/shared-links') - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should require an asset/album id', async () => { - const { status, body } = await request(app) - .post('/shared-links') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ type: SharedLinkType.Album }); - - expect(status).toBe(400); - expect(body).toEqual(expect.objectContaining({ message: 'Invalid albumId' })); - }); - - it('should require a valid asset id', async () => { - const { status, body } = await request(app) - .post('/shared-links') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ type: SharedLinkType.Individual, assetId: uuidDto.notFound }); - - expect(status).toBe(400); - expect(body).toEqual(expect.objectContaining({ message: 'Invalid assetIds' })); - }); - - it('should create a shared link', async () => { - const { status, body } = await request(app) - .post('/shared-links') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ type: SharedLinkType.Album, albumId: album.id }); - - expect(status).toBe(201); - expect(body).toEqual( - expect.objectContaining({ - type: SharedLinkType.Album, - userId: user1.userId, - }), - ); - }); - }); - - describe('PATCH /shared-links/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app) - .patch(`/shared-links/${linkWithAlbum.id}`) - .send({ description: 'foo' }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should fail if invalid link', async () => { - const { status, body } = await request(app) - .patch(`/shared-links/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ description: 'foo' }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should update shared link', async () => { - const { status, body } = await request(app) - .patch(`/shared-links/${linkWithAlbum.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ description: 'foo' }); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - type: SharedLinkType.Album, - userId: user1.userId, - description: 'foo', - }), - ); - }); - }); - - describe('PUT /shared-links/:id/assets', () => { - it('should not add assets to shared link (album)', async () => { - const { status, body } = await request(app) - .put(`/shared-links/${linkWithAlbum.id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset2.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Invalid shared link type')); - }); - - it('should add an assets to a shared link (individual)', async () => { - const { status, body } = await request(app) - .put(`/shared-links/${linkWithAssets.id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset2.id] }); - - expect(body).toEqual([{ assetId: asset2.id, success: true }]); - expect(status).toBe(200); - }); - }); - - describe('DELETE /shared-links/:id/assets', () => { - it('should not remove assets from a shared link (album)', async () => { - const { status, body } = await request(app) - .delete(`/shared-links/${linkWithAlbum.id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset2.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Invalid shared link type')); - }); - - it('should remove assets from a shared link (individual)', async () => { - const { status, body } = await request(app) - .delete(`/shared-links/${linkWithAssets.id}/assets`) - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset2.id] }); - - expect(body).toEqual([{ assetId: asset2.id, success: true }]); - expect(status).toBe(200); - }); - }); - - describe('DELETE /shared-links/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).delete(`/shared-links/${linkWithAlbum.id}`); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should fail if invalid link', async () => { - const { status, body } = await request(app) - .delete(`/shared-links/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should delete a shared link', async () => { - const { status } = await request(app) - .delete(`/shared-links/${linkWithAlbum.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(204); - }); - }); -}); diff --git a/e2e/src/api/specs/stack.e2e-spec.ts b/e2e/src/api/specs/stack.e2e-spec.ts deleted file mode 100644 index 91dd0d2a8e..0000000000 --- a/e2e/src/api/specs/stack.e2e-spec.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto, searchStacks } from '@immich/sdk'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/stacks', () => { - let admin: LoginResponseDto; - let user1: LoginResponseDto; - let user2: LoginResponseDto; - let asset: AssetMediaResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - - [user1, user2] = await Promise.all([ - utils.userSetup(admin.accessToken, createUserDto.user1), - utils.userSetup(admin.accessToken, createUserDto.user2), - ]); - - asset = await utils.createAsset(user1.accessToken); - }); - - describe('POST /stacks', () => { - it('should require authentication', async () => { - const { status, body } = await request(app) - .post('/stacks') - .send({ assetIds: [asset.id] }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require at least two assets', async () => { - const { status, body } = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should require a valid id', async () => { - const { status, body } = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [uuidDto.invalid, uuidDto.invalid] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - - it('should require access', async () => { - const user2Asset = await utils.createAsset(user2.accessToken); - const { status, body } = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset.id, user2Asset.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should create a stack', async () => { - const [asset1, asset2] = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - const { status, body } = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset1.id, asset2.id] }); - - expect(status).toBe(201); - expect(body).toEqual({ - id: expect.any(String), - primaryAssetId: asset1.id, - assets: [expect.objectContaining({ id: asset1.id }), expect.objectContaining({ id: asset2.id })], - }); - }); - - it('should merge an existing stack', async () => { - const [asset1, asset2, asset3] = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - const response1 = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset1.id, asset2.id] }); - - expect(response1.status).toBe(201); - - const stacksBefore = await searchStacks({}, { headers: asBearerAuth(user1.accessToken) }); - - const { status, body } = await request(app) - .post('/stacks') - .set('Authorization', `Bearer ${user1.accessToken}`) - .send({ assetIds: [asset1.id, asset3.id] }); - - expect(status).toBe(201); - expect(body).toEqual({ - id: expect.any(String), - primaryAssetId: asset1.id, - assets: expect.arrayContaining([ - expect.objectContaining({ id: asset1.id }), - expect.objectContaining({ id: asset2.id }), - expect.objectContaining({ id: asset3.id }), - ]), - }); - - const stacksAfter = await searchStacks({}, { headers: asBearerAuth(user1.accessToken) }); - expect(stacksAfter.length).toBe(stacksBefore.length); - }); - }); - - describe('GET /assets/:id', () => { - it('should include stack details for the primary asset', async () => { - const [asset1, asset2] = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - await utils.createStack(user1.accessToken, [asset1.id, asset2.id]); - - const { status, body } = await request(app) - .get(`/assets/${asset1.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - id: asset1.id, - stack: { - id: expect.any(String), - assetCount: 2, - primaryAssetId: asset1.id, - }, - }), - ); - }); - - it('should include stack details for a non-primary asset', async () => { - const [asset1, asset2] = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - await utils.createStack(user1.accessToken, [asset1.id, asset2.id]); - - const { status, body } = await request(app) - .get(`/assets/${asset2.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - id: asset2.id, - stack: { - id: expect.any(String), - assetCount: 2, - primaryAssetId: asset1.id, - }, - }), - ); - }); - }); - - describe('GET /stacks/:id', () => { - it('should include exifInfo in stack assets', async () => { - const [asset1, asset2] = await Promise.all([ - utils.createAsset(user1.accessToken), - utils.createAsset(user1.accessToken), - ]); - - const stack = await utils.createStack(user1.accessToken, [asset1.id, asset2.id]); - - const { status, body } = await request(app) - .get(`/stacks/${stack.id}`) - .set('Authorization', `Bearer ${user1.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - id: stack.id, - primaryAssetId: asset1.id, - assets: expect.arrayContaining([ - expect.objectContaining({ id: asset1.id, exifInfo: expect.any(Object) }), - expect.objectContaining({ id: asset2.id, exifInfo: expect.any(Object) }), - ]), - }), - ); - }); - }); -}); diff --git a/e2e/src/api/specs/system-config.e2e-spec.ts b/e2e/src/api/specs/system-config.e2e-spec.ts deleted file mode 100644 index 1bd7bdc489..0000000000 --- a/e2e/src/api/specs/system-config.e2e-spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { LoginResponseDto, getConfig } from '@immich/sdk'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -const getSystemConfig = (accessToken: string) => getConfig({ headers: asBearerAuth(accessToken) }); - -describe('/system-config', () => { - let admin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - describe('PUT /system-config', () => { - it('should always return the new config', async () => { - const config = await getSystemConfig(admin.accessToken); - - const response1 = await request(app) - .put('/system-config') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ...config, newVersionCheck: { enabled: false } }); - - expect(response1.status).toBe(200); - expect(response1.body).toEqual({ ...config, newVersionCheck: { enabled: false } }); - - const response2 = await request(app) - .put('/system-config') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ...config, newVersionCheck: { enabled: true } }); - - expect(response2.status).toBe(200); - expect(response2.body).toEqual({ ...config, newVersionCheck: { enabled: true } }); - }); - - it('should reject an invalid config entry', async () => { - const { status, body } = await request(app) - .put('/system-config') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ - ...(await getSystemConfig(admin.accessToken)), - storageTemplate: { enabled: true, hashVerificationEnabled: true, template: '{{foo}}' }, - }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(expect.stringContaining('Invalid storage template'))); - }); - }); -}); diff --git a/e2e/src/api/specs/system-metadata.e2e-spec.ts b/e2e/src/api/specs/system-metadata.e2e-spec.ts deleted file mode 100644 index bd17bf2524..0000000000 --- a/e2e/src/api/specs/system-metadata.e2e-spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { LoginResponseDto, getServerConfig } from '@immich/sdk'; -import { createUserDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe('/server-info', () => { - let admin: LoginResponseDto; - let nonAdmin: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - nonAdmin = await utils.userSetup(admin.accessToken, createUserDto.user1); - }); - - describe('POST /system-metadata/admin-onboarding', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/system-metadata/admin-onboarding').send({ isOnboarded: true }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should only work for admins', async () => { - const { status, body } = await request(app) - .post('/system-metadata/admin-onboarding') - .set('Authorization', `Bearer ${nonAdmin.accessToken}`) - .send({ isOnboarded: true }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should set admin onboarding', async () => { - const config = await getServerConfig({}); - expect(config.isOnboarded).toBe(false); - - const { status } = await request(app) - .post('/system-metadata/admin-onboarding') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ isOnboarded: true }); - expect(status).toBe(204); - - const newConfig = await getServerConfig({}); - expect(newConfig.isOnboarded).toBe(true); - }); - }); - - describe('GET /system-metadata/reverse-geocoding-state', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/system-metadata/reverse-geocoding-state'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should only work for admins', async () => { - const { status, body } = await request(app) - .get('/system-metadata/reverse-geocoding-state') - .set('Authorization', `Bearer ${nonAdmin.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should get the reverse geocoding state', async () => { - const { status, body } = await request(app) - .get('/system-metadata/reverse-geocoding-state') - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - lastUpdate: expect.any(String), - lastImportFileName: 'cities500.txt', - }); - }); - }); -}); diff --git a/e2e/src/api/specs/tag.e2e-spec.ts b/e2e/src/api/specs/tag.e2e-spec.ts deleted file mode 100644 index d69536f3a3..0000000000 --- a/e2e/src/api/specs/tag.e2e-spec.ts +++ /dev/null @@ -1,603 +0,0 @@ -import { - AssetMediaResponseDto, - LoginResponseDto, - Permission, - TagCreateDto, - TagResponseDto, - createTag, - getAllTags, - tagAssets, - upsertTags, -} from '@immich/sdk'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -const create = (accessToken: string, dto: TagCreateDto) => - createTag({ tagCreateDto: dto }, { headers: asBearerAuth(accessToken) }); - -const upsert = (accessToken: string, tags: string[]) => - upsertTags({ tagUpsertDto: { tags } }, { headers: asBearerAuth(accessToken) }); - -describe('/tags', () => { - let admin: LoginResponseDto; - let user: LoginResponseDto; - let userAsset: AssetMediaResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - user = await utils.userSetup(admin.accessToken, createUserDto.user1); - userAsset = await utils.createAsset(user.accessToken); - }); - - beforeEach(async () => { - // tagging assets eventually triggers metadata extraction which can impact other tests - await utils.waitForQueueFinish(admin.accessToken, 'metadataExtraction'); - await utils.resetDatabase(['tag']); - }); - - describe('POST /tags', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/tags').send({ name: 'TagA' }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization (api key)', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app).post('/tags').set('x-api-key', secret).send({ name: 'TagA' }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.create')); - }); - - it('should work with tag.create', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.TagCreate]); - const { status, body } = await request(app).post('/tags').set('x-api-key', secret).send({ name: 'TagA' }); - expect(body).toEqual({ - id: expect.any(String), - name: 'TagA', - value: 'TagA', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - expect(status).toBe(201); - }); - - it('should create a tag', async () => { - const { status, body } = await request(app) - .post('/tags') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ name: 'TagA' }); - expect(body).toEqual({ - id: expect.any(String), - name: 'TagA', - value: 'TagA', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - expect(status).toBe(201); - }); - - it('should allow multiple users to create tags with the same value', async () => { - await create(admin.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .post('/tags') - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ name: 'TagA' }); - expect(body).toEqual({ - id: expect.any(String), - name: 'TagA', - value: 'TagA', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - expect(status).toBe(201); - }); - - it('should create a nested tag', async () => { - const parent = await create(admin.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .post('/tags') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ name: 'TagB', parentId: parent.id }); - expect(body).toEqual({ - id: expect.any(String), - parentId: parent.id, - name: 'TagB', - value: 'TagA/TagB', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - expect(status).toBe(201); - }); - }); - - describe('GET /tags', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get('/tags'); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization (api key)', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app).get('/tags').set('x-api-key', secret); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.read')); - }); - - it('should start off empty', async () => { - const { status, body } = await request(app).get('/tags').set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toEqual([]); - expect(status).toEqual(200); - }); - - it('should return a list of tags', async () => { - const [tagA, tagB, tagC] = await Promise.all([ - create(admin.accessToken, { name: 'TagA' }), - create(admin.accessToken, { name: 'TagB' }), - create(admin.accessToken, { name: 'TagC' }), - ]); - const { status, body } = await request(app).get('/tags').set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toHaveLength(3); - expect(body).toEqual([tagA, tagB, tagC]); - expect(status).toEqual(200); - }); - - it('should return a nested tags', async () => { - await upsert(admin.accessToken, ['TagA/TagB/TagC', 'TagD']); - const { status, body } = await request(app).get('/tags').set('Authorization', `Bearer ${admin.accessToken}`); - - expect(body).toHaveLength(4); - expect(status).toEqual(200); - - const tags = body as TagResponseDto[]; - const tagA = tags.find((tag) => tag.value === 'TagA') as TagResponseDto; - const tagB = tags.find((tag) => tag.value === 'TagA/TagB') as TagResponseDto; - const tagC = tags.find((tag) => tag.value === 'TagA/TagB/TagC') as TagResponseDto; - const tagD = tags.find((tag) => tag.value === 'TagD') as TagResponseDto; - - expect(tagA).toEqual(expect.objectContaining({ name: 'TagA', value: 'TagA' })); - expect(tagB).toEqual(expect.objectContaining({ name: 'TagB', value: 'TagA/TagB', parentId: tagA.id })); - expect(tagC).toEqual(expect.objectContaining({ name: 'TagC', value: 'TagA/TagB/TagC', parentId: tagB.id })); - expect(tagD).toEqual(expect.objectContaining({ name: 'TagD', value: 'TagD' })); - }); - }); - - describe('PUT /tags', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/tags`).send({ name: 'TagA/TagB' }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization (api key)', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app).put('/tags').set('x-api-key', secret).send({ name: 'TagA' }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.create')); - }); - - it('should upsert tags', async () => { - const { status, body } = await request(app) - .put(`/tags`) - .send({ tags: ['TagA/TagB/TagC/TagD'] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ name: 'TagD', value: 'TagA/TagB/TagC/TagD' })]); - }); - - it('should upsert tags in parallel without conflicts', async () => { - const [[tag1], [tag2], [tag3], [tag4]] = await Promise.all([ - upsert(admin.accessToken, ['TagA/TagB/TagC/TagD']), - upsert(admin.accessToken, ['TagA/TagB/TagC/TagD']), - upsert(admin.accessToken, ['TagA/TagB/TagC/TagD']), - upsert(admin.accessToken, ['TagA/TagB/TagC/TagD']), - ]); - - const { id, parentId, createdAt } = tag1; - for (const tag of [tag1, tag2, tag3, tag4]) { - expect(tag).toMatchObject({ - id, - parentId, - createdAt, - name: 'TagD', - value: 'TagA/TagB/TagC/TagD', - }); - } - }); - }); - - describe('PUT /tags/assets', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/tags/assets`).send({ tagIds: [], assetIds: [] }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization (api key)', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app) - .put('/tags/assets') - .set('x-api-key', secret) - .send({ assetIds: [], tagIds: [] }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.asset')); - }); - - it('should skip assets that are not owned by the user', async () => { - const [tagA, tagB, tagC, assetA, assetB] = await Promise.all([ - create(user.accessToken, { name: 'TagA' }), - create(user.accessToken, { name: 'TagB' }), - create(user.accessToken, { name: 'TagC' }), - utils.createAsset(user.accessToken), - utils.createAsset(admin.accessToken), - ]); - const { status, body } = await request(app) - .put(`/tags/assets`) - .send({ tagIds: [tagA.id, tagB.id, tagC.id], assetIds: [assetA.id, assetB.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 3 }); - }); - - it('should skip tags that are not owned by the user', async () => { - const [tagA, tagB, tagC, assetA, assetB] = await Promise.all([ - create(user.accessToken, { name: 'TagA' }), - create(user.accessToken, { name: 'TagB' }), - create(admin.accessToken, { name: 'TagC' }), - utils.createAsset(user.accessToken), - utils.createAsset(user.accessToken), - ]); - const { status, body } = await request(app) - .put(`/tags/assets`) - .send({ tagIds: [tagA.id, tagB.id, tagC.id], assetIds: [assetA.id, assetB.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 4 }); - }); - - it('should bulk tag assets', async () => { - const [tagA, tagB, tagC, assetA, assetB] = await Promise.all([ - create(user.accessToken, { name: 'TagA' }), - create(user.accessToken, { name: 'TagB' }), - create(user.accessToken, { name: 'TagC' }), - utils.createAsset(user.accessToken), - utils.createAsset(user.accessToken), - ]); - const { status, body } = await request(app) - .put(`/tags/assets`) - .send({ tagIds: [tagA.id, tagB.id, tagC.id], assetIds: [assetA.id, assetB.id] }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 6 }); - }); - }); - - describe('GET /tags/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get(`/tags/${uuidDto.notFound}`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .get(`/tags/${tag.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require authorization (api key)', async () => { - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app) - .get(`/tags/${uuidDto.notFound}`) - .set('x-api-key', secret) - .send({ assetIds: [], tagIds: [] }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.read')); - }); - - it('should require a valid uuid', async () => { - const { status, body } = await request(app) - .get(`/tags/${uuidDto.invalid}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['id must be a UUID'])); - }); - - it('should get tag details', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .get(`/tags/${tag.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ - id: expect.any(String), - name: 'TagA', - value: 'TagA', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - }); - - it('should get nested tag details', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - const tagB = await create(user.accessToken, { name: 'TagB', parentId: tagA.id }); - const tagC = await create(user.accessToken, { name: 'TagC', parentId: tagB.id }); - const tagD = await create(user.accessToken, { name: 'TagD', parentId: tagC.id }); - - const { status, body } = await request(app) - .get(`/tags/${tagD.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ - id: expect.any(String), - parentId: tagC.id, - name: 'TagD', - value: 'TagA/TagB/TagC/TagD', - createdAt: expect.any(String), - updatedAt: expect.any(String), - }); - }); - }); - - describe('PUT /tags/:id', () => { - it('should require authentication', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app).put(`/tags/${tag.id}`).send({ color: '#000000' }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const tag = await create(admin.accessToken, { name: 'tagA' }); - const { status, body } = await request(app) - .put(`/tags/${tag.id}`) - .send({ color: '#000000' }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require authorization (api key)', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app) - .put(`/tags/${tag.id}`) - .set('x-api-key', secret) - .send({ color: '#000000' }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.update')); - }); - - it('should update a tag', async () => { - const tag = await create(user.accessToken, { name: 'tagA' }); - const { status, body } = await request(app) - .put(`/tags/${tag.id}`) - .send({ color: '#000000' }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual(expect.objectContaining({ color: `#000000` })); - }); - - it('should update a tag color without a # prefix', async () => { - const tag = await create(user.accessToken, { name: 'tagA' }); - const { status, body } = await request(app) - .put(`/tags/${tag.id}`) - .send({ color: '000000' }) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual(expect.objectContaining({ color: `#000000` })); - }); - }); - - describe('DELETE /tags/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).delete(`/tags/${uuidDto.notFound}`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .delete(`/tags/${tag.id}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require authorization (api key)', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app).delete(`/tags/${tag.id}`).set('x-api-key', secret); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.delete')); - }); - - it('should require a valid uuid', async () => { - const { status, body } = await request(app) - .delete(`/tags/${uuidDto.invalid}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest(['id must be a UUID'])); - }); - - it('should delete a tag', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status } = await request(app) - .delete(`/tags/${tag.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(204); - }); - - it('should delete a nested tag (root)', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - await create(user.accessToken, { name: 'TagB', parentId: tagA.id }); - const { status } = await request(app) - .delete(`/tags/${tagA.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(204); - const tags = await getAllTags({ headers: asBearerAuth(user.accessToken) }); - expect(tags.length).toBe(0); - }); - - it('should delete a nested tag (leaf)', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - const tagB = await create(user.accessToken, { name: 'TagB', parentId: tagA.id }); - const { status } = await request(app) - .delete(`/tags/${tagB.id}`) - .set('Authorization', `Bearer ${user.accessToken}`); - expect(status).toBe(204); - const tags = await getAllTags({ headers: asBearerAuth(user.accessToken) }); - expect(tags.length).toBe(1); - expect(tags[0]).toEqual(tagA); - }); - }); - - describe('PUT /tags/:id/assets', () => { - it('should require authentication', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .put(`/tags/${tagA.id}/assets`) - .send({ ids: [userAsset.id] }); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .put(`/tags/${tag.id}/assets`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ids: [userAsset.id] }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require authorization (api key)', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app) - .put(`/tags/${tag.id}/assets`) - .set('x-api-key', secret) - .send({ ids: [userAsset.id] }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.asset')); - }); - - it('should be able to tag own asset', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .put(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ids: [userAsset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: userAsset.id, success: true })]); - }); - - it("should not be able to add assets to another user's tag", async () => { - const tagA = await create(admin.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .put(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ids: [userAsset.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest('Not found or no tag.asset access')); - }); - - it('should add duplicate assets only once', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .put(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ids: [userAsset.id, userAsset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ id: userAsset.id, success: true }), - expect.objectContaining({ id: userAsset.id, success: false, error: 'duplicate' }), - ]); - }); - }); - - describe('DELETE /tags/:id/assets', () => { - it('should require authentication', async () => { - const tagA = await create(admin.accessToken, { name: 'TagA' }); - const { status, body } = await request(app) - .delete(`/tags/${tagA}/assets`) - .send({ ids: [userAsset.id] }); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - await tagAssets( - { id: tagA.id, bulkIdsDto: { ids: [userAsset.id] } }, - { headers: asBearerAuth(user.accessToken) }, - ); - const { status, body } = await request(app) - .delete(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ids: [userAsset.id] }); - - expect(status).toBe(400); - expect(body).toEqual(errorDto.noPermission); - }); - - it('should require authorization (api key)', async () => { - const tag = await create(user.accessToken, { name: 'TagA' }); - const { secret } = await utils.createApiKey(user.accessToken, [Permission.AssetRead]); - const { status, body } = await request(app) - .delete(`/tags/${tag.id}/assets`) - .set('x-api-key', secret) - .send({ ids: [userAsset.id] }); - expect(status).toBe(403); - expect(body).toEqual(errorDto.missingPermission('tag.asset')); - }); - - it('should be able to remove own asset from own tag', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - await tagAssets( - { id: tagA.id, bulkIdsDto: { ids: [userAsset.id] } }, - { headers: asBearerAuth(user.accessToken) }, - ); - const { status, body } = await request(app) - .delete(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ids: [userAsset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([expect.objectContaining({ id: userAsset.id, success: true })]); - }); - - it.skip('should remove duplicate assets only once', async () => { - const tagA = await create(user.accessToken, { name: 'TagA' }); - await tagAssets( - { id: tagA.id, bulkIdsDto: { ids: [userAsset.id] } }, - { headers: asBearerAuth(user.accessToken) }, - ); - const { status, body } = await request(app) - .delete(`/tags/${tagA.id}/assets`) - .set('Authorization', `Bearer ${user.accessToken}`) - .send({ ids: [userAsset.id, userAsset.id] }); - - expect(status).toBe(200); - expect(body).toEqual([ - expect.objectContaining({ id: userAsset.id, success: true }), - expect.objectContaining({ id: userAsset.id, success: false, error: 'not_found' }), - ]); - }); - }); -}); diff --git a/e2e/src/api/specs/trash.e2e-spec.ts b/e2e/src/api/specs/trash.e2e-spec.ts deleted file mode 100644 index 7a1a61f946..0000000000 --- a/e2e/src/api/specs/trash.e2e-spec.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { LoginResponseDto, getAssetInfo, getAssetStatistics } from '@immich/sdk'; -import { existsSync } from 'node:fs'; -import { Socket } from 'socket.io-client'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, testAssetDir, testAssetDirInternal, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; - -describe('/trash', () => { - let admin: LoginResponseDto; - let ws: Socket; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - ws = await utils.connectWebsocket(admin.accessToken); - }); - - afterAll(() => { - utils.disconnectWebsocket(ws); - }); - - describe('POST /trash/empty', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/trash/empty'); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should empty the trash', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - await utils.deleteAssets(admin.accessToken, [assetId]); - - const before = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(before).toStrictEqual(expect.objectContaining({ id: assetId, isTrashed: true })); - - const { status, body } = await request(app) - .post('/trash/empty') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 1 }); - - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: assetId }); - - const after = await getAssetStatistics({ isTrashed: true }, { headers: asBearerAuth(admin.accessToken) }); - expect(after.total).toBe(0); - - expect(existsSync(before.originalPath)).toBe(false); - }); - - it('should empty the trash with archived assets', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - await utils.archiveAssets(admin.accessToken, [assetId]); - await utils.deleteAssets(admin.accessToken, [assetId]); - - const before = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(before).toStrictEqual(expect.objectContaining({ id: assetId, isTrashed: true, isArchived: true })); - - const { status, body } = await request(app) - .post('/trash/empty') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 1 }); - - await utils.waitForWebsocketEvent({ event: 'assetDelete', id: assetId }); - - const after = await getAssetStatistics({ isTrashed: true }, { headers: asBearerAuth(admin.accessToken) }); - expect(after.total).toBe(0); - - expect(existsSync(before.originalPath)).toBe(false); - }); - - it('should remove offline assets', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.items.length).toBe(1); - const asset = assets.items[0]; - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/offline/**'] }); - - await utils.scan(admin.accessToken, library.id); - - const assetBefore = await utils.getAssetInfo(admin.accessToken, asset.id); - expect(assetBefore).toMatchObject({ isTrashed: true, isOffline: true }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const { status } = await request(app).post('/trash/empty').set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - - await utils.waitForQueueFinish(admin.accessToken, 'backgroundTask'); - - const assetAfter = await utils.getAssetInfo(admin.accessToken, asset.id); - expect(assetAfter).toMatchObject({ isTrashed: true, isOffline: true }); - }); - - it.skip('should not delete offline assets from disk', async () => { - // Can't be tested at the moment due to no mechanism to forward time - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.items.length).toBe(1); - const asset = assets.items[0]; - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/offline/**'] }); - - await utils.scan(admin.accessToken, library.id); - - const assetBefore = await utils.getAssetInfo(admin.accessToken, asset.id); - expect(assetBefore).toMatchObject({ isTrashed: true, isOffline: true }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - const { status } = await request(app).post('/trash/empty').set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - - await utils.waitForQueueFinish(admin.accessToken, 'backgroundTask'); - - const after = await getAssetStatistics({ isTrashed: true }, { headers: asBearerAuth(admin.accessToken) }); - expect(after.total).toBe(0); - - expect(existsSync(`${testAssetDir}/temp/offline/offline.png`)).toBe(true); - - utils.removeImageFile(`${testAssetDir}/temp/offline/offline.png`); - }); - }); - - describe('POST /trash/restore', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/trash/restore'); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should restore all trashed assets', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - await utils.deleteAssets(admin.accessToken, [assetId]); - - const before = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(before).toStrictEqual(expect.objectContaining({ id: assetId, isTrashed: true })); - - const { status, body } = await request(app) - .post('/trash/restore') - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual({ count: 1 }); - - const after = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(after).toStrictEqual(expect.objectContaining({ id: assetId, isTrashed: false })); - }); - - it('should not restore offline assets', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.count).toBe(1); - const assetId = assets.items[0].id; - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/offline/**'] }); - - await utils.scan(admin.accessToken, library.id); - - const before = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(before).toStrictEqual(expect.objectContaining({ id: assetId, isOffline: true })); - - const { status } = await request(app).post('/trash/restore').set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - - const after = await getAssetInfo({ id: assetId }, { headers: asBearerAuth(admin.accessToken) }); - expect(after).toStrictEqual(expect.objectContaining({ id: assetId, isOffline: true })); - - utils.removeImageFile(`${testAssetDir}/temp/offline/offline.png`); - }); - }); - - describe('POST /trash/restore/assets', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post('/trash/restore/assets'); - - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should restore a trashed asset by id', async () => { - const { id: assetId } = await utils.createAsset(admin.accessToken); - await utils.deleteAssets(admin.accessToken, [assetId]); - - const before = await utils.getAssetInfo(admin.accessToken, assetId); - expect(before.isTrashed).toBe(true); - - const { status, body } = await request(app) - .post('/trash/restore/assets') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ids: [assetId] }); - expect(status).toBe(200); - expect(body).toEqual({ count: 1 }); - - const after = await utils.getAssetInfo(admin.accessToken, assetId); - expect(after.isTrashed).toBe(false); - }); - - it('should not restore an offline asset', async () => { - const library = await utils.createLibrary(admin.accessToken, { - ownerId: admin.userId, - importPaths: [`${testAssetDirInternal}/temp/offline`], - }); - - utils.createImageFile(`${testAssetDir}/temp/offline/offline.png`); - - await utils.scan(admin.accessToken, library.id); - await utils.waitForQueueFinish(admin.accessToken, 'library'); - - const { assets } = await utils.searchAssets(admin.accessToken, { libraryId: library.id }); - expect(assets.count).toBe(1); - const assetId = assets.items[0].id; - - await utils.updateLibrary(admin.accessToken, library.id, { exclusionPatterns: ['**/offline/**'] }); - - await utils.scan(admin.accessToken, library.id); - await utils.waitForQueueFinish(admin.accessToken, 'library'); - - const before = await utils.getAssetInfo(admin.accessToken, assetId); - expect(before.isTrashed).toBe(true); - - const { status } = await request(app) - .post('/trash/restore/assets') - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ids: [assetId] }); - expect(status).toBe(200); - - const after = await utils.getAssetInfo(admin.accessToken, assetId); - expect(after.isTrashed).toBe(true); - - utils.removeImageFile(`${testAssetDir}/temp/offline/offline.png`); - }); - }); -}); diff --git a/e2e/src/api/specs/user-admin.e2e-spec.ts b/e2e/src/api/specs/user-admin.e2e-spec.ts deleted file mode 100644 index 793c508a36..0000000000 --- a/e2e/src/api/specs/user-admin.e2e-spec.ts +++ /dev/null @@ -1,383 +0,0 @@ -import { - LoginResponseDto, - QueueName, - createStack, - deleteUserAdmin, - getMyUser, - getUserAdmin, - getUserPreferencesAdmin, - login, -} from '@immich/sdk'; -import { Socket } from 'socket.io-client'; -import { createUserDto, uuidDto } from 'src/fixtures'; -import { errorDto } from 'src/responses'; -import { app, asBearerAuth, utils } from 'src/utils'; -import request from 'supertest'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; - -describe('/admin/users', () => { - let websocket: Socket; - - let admin: LoginResponseDto; - let nonAdmin: LoginResponseDto; - let deletedUser: LoginResponseDto; - let userToDelete: LoginResponseDto; - - beforeAll(async () => { - await utils.resetDatabase(); - admin = await utils.adminSetup({ onboarding: false }); - - [websocket, nonAdmin, deletedUser, userToDelete] = await Promise.all([ - utils.connectWebsocket(admin.accessToken), - utils.userSetup(admin.accessToken, createUserDto.user1), - utils.userSetup(admin.accessToken, createUserDto.user2), - utils.userSetup(admin.accessToken, createUserDto.user3), - ]); - - await deleteUserAdmin( - { id: deletedUser.userId, userAdminDeleteDto: {} }, - { headers: asBearerAuth(admin.accessToken) }, - ); - }); - - afterAll(() => { - utils.disconnectWebsocket(websocket); - }); - - describe('GET /admin/users', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).get(`/admin/users`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const { status, body } = await request(app) - .get(`/admin/users`) - .set('Authorization', `Bearer ${nonAdmin.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should hide deleted users by default', async () => { - const { status, body } = await request(app) - .get(`/admin/users`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toHaveLength(3); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ email: admin.userEmail }), - expect.objectContaining({ email: nonAdmin.userEmail }), - expect.objectContaining({ email: userToDelete.userEmail }), - ]), - ); - }); - - it('should include deleted users', async () => { - const { status, body } = await request(app) - .get(`/admin/users?withDeleted=true`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toHaveLength(4); - expect(body).toEqual( - expect.arrayContaining([ - expect.objectContaining({ email: admin.userEmail }), - expect.objectContaining({ email: nonAdmin.userEmail }), - expect.objectContaining({ email: userToDelete.userEmail }), - expect.objectContaining({ email: deletedUser.userEmail }), - ]), - ); - }); - }); - - describe('POST /admin/users', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post(`/admin/users`).send(createUserDto.user1); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const { status, body } = await request(app) - .post(`/admin/users`) - .set('Authorization', `Bearer ${nonAdmin.accessToken}`) - .send(createUserDto.user1); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - for (const key of ['password', 'email', 'name', 'quotaSizeInBytes', 'shouldChangePassword', 'notify']) { - it(`should not allow null ${key}`, async () => { - const { status, body } = await request(app) - .post(`/admin/users`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ ...createUserDto.user1, [key]: null }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - } - - it('should accept `isAdmin`', async () => { - const { status, body } = await request(app) - .post(`/admin/users`) - .send({ - isAdmin: true, - email: 'user5@immich.cloud', - password: 'password123', - name: 'Immich', - }) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(body).toMatchObject({ - email: 'user5@immich.cloud', - isAdmin: true, - shouldChangePassword: true, - }); - expect(status).toBe(201); - }); - }); - - describe('PUT /admin/users/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/admin/users/${uuidDto.notFound}`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const { status, body } = await request(app) - .put(`/admin/users/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${nonAdmin.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - for (const key of ['password', 'email', 'name', 'shouldChangePassword']) { - it(`should not allow null ${key}`, async () => { - const { status, body } = await request(app) - .put(`/admin/users/${uuidDto.notFound}`) - .set('Authorization', `Bearer ${admin.accessToken}`) - .send({ [key]: null }); - expect(status).toBe(400); - expect(body).toEqual(errorDto.badRequest()); - }); - } - - it('should allow a non-admin to become an admin', async () => { - const user = await utils.userSetup(admin.accessToken, createUserDto.create('admin2')); - const { status, body } = await request(app) - .put(`/admin/users/${user.userId}`) - .send({ isAdmin: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ isAdmin: true }); - }); - - it('ignores updates to profileImagePath', async () => { - const { status, body } = await request(app) - .put(`/admin/users/${admin.userId}`) - .send({ profileImagePath: 'invalid.jpg' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ id: admin.userId, profileImagePath: '' }); - }); - - it('should update first and last name', async () => { - const before = await getUserAdmin({ id: admin.userId }, { headers: asBearerAuth(admin.accessToken) }); - - const { status, body } = await request(app) - .put(`/admin/users/${admin.userId}`) - .send({ name: 'Name' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toEqual({ - ...before, - updatedAt: expect.any(String), - name: 'Name', - }); - expect(before.updatedAt).not.toEqual(body.updatedAt); - }); - - it('should update password', async () => { - const { status, body } = await request(app) - .put(`/admin/users/${nonAdmin.userId}`) - .send({ password: 'super-secret' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ email: nonAdmin.userEmail }); - - const token = await login({ loginCredentialDto: { email: nonAdmin.userEmail, password: 'super-secret' } }); - expect(token.accessToken).toBeDefined(); - - const user = await getMyUser({ headers: asBearerAuth(token.accessToken) }); - expect(user).toMatchObject({ email: nonAdmin.userEmail }); - }); - - it('should update the avatar color', async () => { - const { status, body } = await request(app) - .put(`/admin/users/${admin.userId}`) - .send({ avatarColor: 'orange' }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ avatarColor: 'orange' }); - - const after = await getUserAdmin({ id: admin.userId }, { headers: asBearerAuth(admin.accessToken) }); - expect(after).toMatchObject({ avatarColor: 'orange' }); - }); - }); - - describe('PUT /admin/users/:id/preferences', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).put(`/admin/users/${userToDelete.userId}/preferences`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should update memories enabled', async () => { - const before = await getUserPreferencesAdmin({ id: admin.userId }, { headers: asBearerAuth(admin.accessToken) }); - expect(before).toMatchObject({ memories: { enabled: true } }); - - const { status, body } = await request(app) - .put(`/admin/users/${admin.userId}/preferences`) - .send({ memories: { enabled: false } }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ memories: { enabled: false } }); - - const after = await getUserPreferencesAdmin({ id: admin.userId }, { headers: asBearerAuth(admin.accessToken) }); - expect(after).toMatchObject({ memories: { enabled: false } }); - }); - - it('should update download archive size', async () => { - const { status, body } = await request(app) - .put(`/admin/users/${admin.userId}/preferences`) - .send({ download: { archiveSize: 1_234_567 } }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ download: { archiveSize: 1_234_567 } }); - - const after = await getUserPreferencesAdmin({ id: admin.userId }, { headers: asBearerAuth(admin.accessToken) }); - expect(after).toMatchObject({ download: { archiveSize: 1_234_567 } }); - }); - }); - - describe('DELETE /admin/users/:id', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).delete(`/admin/users/${userToDelete.userId}`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const { status, body } = await request(app) - .delete(`/admin/users/${userToDelete.userId}`) - .set('Authorization', `Bearer ${nonAdmin.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should delete user', async () => { - const { status, body } = await request(app) - .delete(`/admin/users/${userToDelete.userId}`) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ - id: userToDelete.userId, - updatedAt: expect.any(String), - deletedAt: expect.any(String), - }); - }); - - it('should hard delete a user', async () => { - const user = await utils.userSetup(admin.accessToken, createUserDto.create('hard-delete-1')); - - const { status, body } = await request(app) - .delete(`/admin/users/${user.userId}`) - .send({ force: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ - id: user.userId, - updatedAt: expect.any(String), - deletedAt: expect.any(String), - }); - - await utils.waitForWebsocketEvent({ event: 'userDelete', id: user.userId, timeout: 5000 }); - }); - - it('should hard delete a user with stacked assets', async () => { - const user = await utils.userSetup(admin.accessToken, createUserDto.create('hard-delete-1')); - - const [asset1, asset2] = await Promise.all([ - utils.createAsset(user.accessToken), - utils.createAsset(user.accessToken), - ]); - - await createStack( - { stackCreateDto: { assetIds: [asset1.id, asset2.id] } }, - { headers: asBearerAuth(user.accessToken) }, - ); - - await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask); - - const { status, body } = await request(app) - .delete(`/admin/users/${user.userId}`) - .send({ force: true }) - .set('Authorization', `Bearer ${admin.accessToken}`); - - expect(status).toBe(200); - expect(body).toMatchObject({ - id: user.userId, - updatedAt: expect.any(String), - deletedAt: expect.any(String), - }); - - await utils.waitForWebsocketEvent({ event: 'userDelete', id: user.userId, timeout: 5000 }); - }); - }); - - describe('POST /admin/users/:id/restore', () => { - it('should require authentication', async () => { - const { status, body } = await request(app).post(`/admin/users/${userToDelete.userId}/restore`); - expect(status).toBe(401); - expect(body).toEqual(errorDto.unauthorized); - }); - - it('should require authorization', async () => { - const { status, body } = await request(app) - .post(`/admin/users/${userToDelete.userId}/restore`) - .set('Authorization', `Bearer ${nonAdmin.accessToken}`); - expect(status).toBe(403); - expect(body).toEqual(errorDto.forbidden); - }); - - it('should restore a user', async () => { - const user = await utils.userSetup(admin.accessToken, createUserDto.create('restore')); - - await deleteUserAdmin({ id: user.userId, userAdminDeleteDto: {} }, { headers: asBearerAuth(admin.accessToken) }); - - const { status, body } = await request(app) - .post(`/admin/users/${user.userId}/restore`) - .set('Authorization', `Bearer ${admin.accessToken}`); - expect(status).toBe(200); - expect(body).toEqual( - expect.objectContaining({ - id: user.userId, - email: user.userEmail, - status: 'active', - deletedAt: null, - }), - ); - }); - }); -}); diff --git a/e2e/src/api/specs/user.e2e-spec.ts b/e2e/src/api/specs/user.e2e-spec.ts index 3f280dddf5..7f322a0d33 100644 --- a/e2e/src/api/specs/user.e2e-spec.ts +++ b/e2e/src/api/specs/user.e2e-spec.ts @@ -1,4 +1,4 @@ -import { LoginResponseDto, SharedLinkType, deleteUserAdmin, getMyPreferences, getMyUser, login } from '@immich/sdk'; +import { LoginResponseDto, SharedLinkType, deleteUserAdmin, getMyPreferences, getMyUser, login } from '@server/sdk'; import { createUserDto } from 'src/fixtures'; import { errorDto } from 'src/responses'; import { app, asBearerAuth, utils } from 'src/utils'; diff --git a/e2e/src/cli/specs/login.e2e-spec.ts b/e2e/src/cli/specs/login.e2e-spec.ts deleted file mode 100644 index 3bc3ebc9c2..0000000000 --- a/e2e/src/cli/specs/login.e2e-spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Permission } from '@immich/sdk'; -import { stat } from 'node:fs/promises'; -import { app, immichCli, utils } from 'src/utils'; -import { beforeEach, describe, expect, it } from 'vitest'; - -describe(`immich login`, () => { - beforeEach(async () => { - await utils.resetDatabase(); - }); - - it('should require a url', async () => { - const { stderr, exitCode } = await immichCli(['login']); - expect(stderr).toBe("error: missing required argument 'url'"); - expect(exitCode).toBe(1); - }); - - it('should require a key', async () => { - const { stderr, exitCode } = await immichCli(['login', app]); - expect(stderr).toBe("error: missing required argument 'key'"); - expect(exitCode).toBe(1); - }); - - it('should require a valid key', async () => { - const { stderr, exitCode } = await immichCli(['login', app, 'immich-is-so-cool']); - expect(stderr).toContain('Failed to connect to server'); - expect(stderr).toContain('Invalid API key'); - expect(stderr).toContain('401'); - expect(exitCode).toBe(1); - }); - - it('should login and save auth.yml with 600', async () => { - const admin = await utils.adminSetup(); - const key = await utils.createApiKey(admin.accessToken, [Permission.All]); - const { stdout, stderr, exitCode } = await immichCli(['login', app, `${key.secret}`]); - expect(stdout.split('\n')).toEqual([ - 'Logging in to http://127.0.0.1:2285/api', - 'Logged in as admin@immich.cloud', - 'Wrote auth info to /tmp/immich/auth.yml', - ]); - expect(stderr).toBe(''); - expect(exitCode).toBe(0); - - const stats = await stat('/tmp/immich/auth.yml'); - const mode = (stats.mode & 0o777).toString(8); - expect(mode).toEqual('600'); - }); - - it('should login without /api in the url', async () => { - const admin = await utils.adminSetup(); - const key = await utils.createApiKey(admin.accessToken, [Permission.All]); - const { stdout, stderr, exitCode } = await immichCli(['login', app.replaceAll('/api', ''), `${key.secret}`]); - expect(stdout.split('\n')).toEqual([ - 'Logging in to http://127.0.0.1:2285', - 'Discovered API at http://127.0.0.1:2285/api', - 'Logged in as admin@immich.cloud', - 'Wrote auth info to /tmp/immich/auth.yml', - ]); - expect(stderr).toBe(''); - expect(exitCode).toBe(0); - }); -}); diff --git a/e2e/src/cli/specs/server-info.e2e-spec.ts b/e2e/src/cli/specs/server-info.e2e-spec.ts deleted file mode 100644 index 96c45c8cc0..0000000000 --- a/e2e/src/cli/specs/server-info.e2e-spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { immichCli, utils } from 'src/utils'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe(`immich server-info`, () => { - beforeAll(async () => { - await utils.resetDatabase(); - const admin = await utils.adminSetup(); - await utils.cliLogin(admin.accessToken); - }); - - it('should return the server info', async () => { - const { stderr, stdout, exitCode } = await immichCli(['server-info']); - expect(stdout.split('\n')).toEqual([ - expect.stringContaining('Server Info (via admin@immich.cloud'), - ' Url: http://127.0.0.1:2285/api', - expect.stringContaining('Version:'), - ' Formats:', - expect.stringContaining('Images:'), - expect.stringContaining('Videos:'), - ' Statistics:', - ' Images: 0', - ' Videos: 0', - ' Total: 0', - ]); - expect(stderr).toBe(''); - expect(exitCode).toBe(0); - }); -}); diff --git a/e2e/src/cli/specs/upload.e2e-spec.ts b/e2e/src/cli/specs/upload.e2e-spec.ts deleted file mode 100644 index b53b4403f8..0000000000 --- a/e2e/src/cli/specs/upload.e2e-spec.ts +++ /dev/null @@ -1,763 +0,0 @@ -import { LoginResponseDto, getAllAlbums, getAssetStatistics } from '@immich/sdk'; -import { cpSync, readFileSync } from 'node:fs'; -import { mkdir, readdir, rm, symlink } from 'node:fs/promises'; -import { asKeyAuth, immichCli, specialCharStrings, testAssetDir, utils } from 'src/utils'; -import { beforeAll, beforeEach, describe, expect, it } from 'vitest'; - -interface Test { - test: string; - paths: string[]; - files: Record; -} - -const tests: Test[] = [ - { - test: 'should support globbing with *', - paths: [`/photos*`], - files: { - '/photos1/image1.jpg': true, - '/photos2/image2.jpg': true, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with an asterisk', - paths: [`/photos*/image1.jpg`], - files: { - '/photos*/image1.jpg': true, - '/photos*/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with a space', - paths: [`/my photos/image1.jpg`], - files: { - '/my photos/image1.jpg': true, - '/my photos/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with a single quote', - paths: [`/photos'/image1.jpg`], - files: { - "/photos'/image1.jpg": true, - "/photos'/image2.jpg": false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with a double quote', - paths: [`/photos"/image1.jpg`], - files: { - '/photos"/image1.jpg': true, - '/photos"/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with a comma', - paths: [`/photos, eh/image1.jpg`], - files: { - '/photos, eh/image1.jpg': true, - '/photos, eh/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with an opening brace', - paths: [`/photos{/image1.jpg`], - files: { - '/photos{/image1.jpg': true, - '/photos{/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, - { - test: 'should support paths with a closing brace', - paths: [`/photos}/image1.jpg`], - files: { - '/photos}/image1.jpg': true, - '/photos}/image2.jpg': false, - '/images/image3.jpg': false, - }, - }, -]; - -describe(`immich upload`, () => { - let admin: LoginResponseDto; - let key: string; - - beforeAll(async () => { - await utils.resetDatabase(); - - admin = await utils.adminSetup(); - key = await utils.cliLogin(admin.accessToken); - }); - - beforeEach(async () => { - await utils.resetDatabase(['asset', 'album']); - }); - - describe(`immich upload /path/to/file.jpg`, () => { - it('should upload a single file', async () => { - const { stderr, stdout, exitCode } = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - }); - - describe(`should accept special cases`, () => { - for (const { test, paths, files } of tests) { - it(test, async () => { - const baseDir = `/tmp/upload/`; - - const testPaths = Object.keys(files).map((filePath) => `${baseDir}/${filePath}`); - testPaths.map((filePath) => utils.createImageFile(filePath)); - - const commandLine = paths.map((argument) => `${baseDir}/${argument}`); - - const expectedCount = Object.entries(files).filter((entry) => entry[1]).length; - - const { stderr, stdout, exitCode } = await immichCli(['upload', ...commandLine]); - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining(`Successfully uploaded ${expectedCount} new asset`)]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(expectedCount); - - testPaths.map((filePath) => utils.removeImageFile(filePath)); - }); - } - }); - - it.each(specialCharStrings)(`should upload a multiple files from paths containing %s`, async (testString) => { - // https://github.com/immich-app/immich/issues/12078 - - // NOTE: this test must contain more than one path since a related bug is only triggered with multiple paths - - const testPaths = [ - `${testAssetDir}/temp/dir1${testString}name/asset.jpg`, - `${testAssetDir}/temp/dir2${testString}name/asset.jpg`, - ]; - - cpSync(`${testAssetDir}/albums/nature/tanners_ridge.jpg`, testPaths[0]); - cpSync(`${testAssetDir}/albums/nature/silver_fir.jpg`, testPaths[1]); - - const { stderr, stdout, exitCode } = await immichCli(['upload', ...testPaths]); - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 2 new assets')]), - ); - expect(exitCode).toBe(0); - - utils.removeImageFile(testPaths[0]); - utils.removeImageFile(testPaths[1]); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(2); - }); - - it('should skip a duplicate file', async () => { - const first = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(first.stderr).toContain('{message}'); - expect(first.stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(first.exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - - const second = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(second.stderr).toContain('{message}'); - expect(second.stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 0 new files and 1 duplicate'), - expect.stringContaining('All assets were already uploaded, nothing to do'), - ]), - ); - expect(second.exitCode).toBe(0); - }); - - it('should skip files that do not exist', async () => { - const { stderr, stdout, exitCode } = await immichCli(['upload', `/path/to/file`]); - expect(stderr).toBe(''); - expect(stdout.split('\n')).toEqual(expect.arrayContaining([expect.stringContaining('No files found, exiting')])); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - }); - - it('should have accurate dry run', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/silver_fir.jpg`, - '--dry-run', - ]); - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Would have uploaded 1 asset')]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - }); - - it('dry run should handle duplicates', async () => { - const first = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(first.stderr).toContain('{message}'); - expect(first.stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(first.exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - - const second = await immichCli(['upload', `${testAssetDir}/albums/nature/`, '--dry-run']); - expect(second.stderr).toContain('{message}'); - expect(second.stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 8 new files and 1 duplicate'), - expect.stringContaining('Would have uploaded 8 assets'), - ]), - ); - expect(second.exitCode).toBe(0); - }); - }); - - describe('immich upload --recursive', () => { - it('should upload a folder recursively', async () => { - const { stderr, stdout, exitCode } = await immichCli(['upload', `${testAssetDir}/albums/nature/`, '--recursive']); - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 9 new assets')]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(9); - }); - }); - - describe('immich upload --recursive --album', () => { - it('should create albums from folder names', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--recursive', - '--album', - ]); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Successfully uploaded 9 new assets'), - expect.stringContaining('Successfully created 1 new album'), - expect.stringContaining('Successfully updated 9 assets'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(9); - - const albums = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums.length).toBe(1); - expect(albums[0].albumName).toBe('nature'); - }); - - it('should add existing assets to albums', async () => { - const response1 = await immichCli(['upload', `${testAssetDir}/albums/nature/`, '--recursive']); - expect(response1.stdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 9 new assets')]), - ); - expect(response1.stderr).toContain('{message}'); - expect(response1.exitCode).toBe(0); - - const assets1 = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets1.total).toBe(9); - - const albums1 = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums1.length).toBe(0); - - const response2 = await immichCli(['upload', `${testAssetDir}/albums/nature/`, '--recursive', '--album']); - expect(response2.stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('All assets were already uploaded, nothing to do.'), - expect.stringContaining('Successfully updated 9 assets'), - ]), - ); - expect(response2.stderr).toContain('{message}'); - expect(response2.exitCode).toBe(0); - - const assets2 = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets2.total).toBe(9); - - const albums2 = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums2.length).toBe(1); - expect(albums2[0].albumName).toBe('nature'); - }); - - it('should have accurate dry run', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--recursive', - '--album', - '--dry-run', - ]); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Would have uploaded 9 assets'), - expect.stringContaining('Would have created 1 new album'), - expect.stringContaining('Would have updated albums of 9 assets'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - - const albums = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums.length).toBe(0); - }); - }); - - describe('immich upload --recursive --album-name=e2e', () => { - it('should create a named album', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--recursive', - '--album-name=e2e', - ]); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Successfully uploaded 9 new assets'), - expect.stringContaining('Successfully created 1 new album'), - expect.stringContaining('Successfully updated 9 assets'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(9); - - const albums = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums.length).toBe(1); - expect(albums[0].albumName).toBe('e2e'); - }); - - it('should have accurate dry run', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--recursive', - '--album-name=e2e', - '--dry-run', - ]); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Would have uploaded 9 assets'), - expect.stringContaining('Would have created 1 new album'), - expect.stringContaining('Would have updated albums of 9 assets'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - - const albums = await getAllAlbums({}, { headers: asKeyAuth(key) }); - expect(albums.length).toBe(0); - }); - }); - - describe('immich upload --delete', () => { - it('should delete local files if specified', async () => { - await mkdir(`/tmp/albums/nature`, { recursive: true }); - const filesToLink = await readdir(`${testAssetDir}/albums/nature`); - for (const file of filesToLink) { - await symlink(`${testAssetDir}/albums/nature/${file}`, `/tmp/albums/nature/${file}`); - } - - const { stderr, stdout, exitCode } = await immichCli(['upload', `/tmp/albums/nature`, '--delete']); - - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files).toEqual([]); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Successfully uploaded 9 new assets'), - expect.stringContaining('Deleting assets that have been uploaded'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(9); - }); - - it('should have accurate dry run', async () => { - await mkdir(`/tmp/albums/nature`, { recursive: true }); - const filesToLink = await readdir(`${testAssetDir}/albums/nature`); - for (const file of filesToLink) { - await symlink(`${testAssetDir}/albums/nature/${file}`, `/tmp/albums/nature/${file}`); - } - - const { stderr, stdout, exitCode } = await immichCli(['upload', `/tmp/albums/nature`, '--delete', '--dry-run']); - - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files.length).toBe(9); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Would have uploaded 9 assets'), - expect.stringContaining('Would have deleted 9 local assets'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - }); - }); - - describe('immich upload --delete-duplicates', () => { - it('should delete local duplicate files', async () => { - const { - stderr: firstStderr, - stdout: firstStdout, - exitCode: firstExitCode, - } = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(firstStderr).toContain('{message}'); - expect(firstStdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(firstExitCode).toBe(0); - - await mkdir(`/tmp/albums/nature`, { recursive: true }); - await symlink(`${testAssetDir}/albums/nature/silver_fir.jpg`, `/tmp/albums/nature/silver_fir.jpg`); - - // Upload with --delete-duplicates flag - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `/tmp/albums/nature/silver_fir.jpg`, - '--delete-duplicates', - ]); - - // Check that the duplicate file was deleted - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files.length).toBe(0); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 0 new files and 1 duplicate'), - expect.stringContaining('All assets were already uploaded, nothing to do'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - // Verify no new assets were uploaded - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - }); - - it('should have accurate dry run with --delete-duplicates', async () => { - const { - stderr: firstStderr, - stdout: firstStdout, - exitCode: firstExitCode, - } = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(firstStderr).toContain('{message}'); - expect(firstStdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(firstExitCode).toBe(0); - - await mkdir(`/tmp/albums/nature`, { recursive: true }); - await symlink(`${testAssetDir}/albums/nature/silver_fir.jpg`, `/tmp/albums/nature/silver_fir.jpg`); - - // Upload with --delete-duplicates and --dry-run flags - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `/tmp/albums/nature/silver_fir.jpg`, - '--delete-duplicates', - '--dry-run', - ]); - - // Check that the duplicate file was NOT deleted in dry run mode - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files.length).toBe(1); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 0 new files and 1 duplicate'), - expect.stringContaining('Would have deleted 1 local asset'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - // Verify no new assets were uploaded - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - }); - - it('should work with both --delete and --delete-duplicates flags', async () => { - // First, upload a file to create a duplicate on the server - const { - stderr: firstStderr, - stdout: firstStdout, - exitCode: firstExitCode, - } = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(firstStderr).toContain('{message}'); - expect(firstStdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(firstExitCode).toBe(0); - - // Both new and duplicate files - await mkdir(`/tmp/albums/nature`, { recursive: true }); - await symlink(`${testAssetDir}/albums/nature/silver_fir.jpg`, `/tmp/albums/nature/silver_fir.jpg`); // duplicate - await symlink(`${testAssetDir}/albums/nature/el_torcal_rocks.jpg`, `/tmp/albums/nature/el_torcal_rocks.jpg`); // new - - // Upload with both --delete and --delete-duplicates flags - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `/tmp/albums/nature`, - '--delete', - '--delete-duplicates', - ]); - - // Check that both files were deleted (new file due to --delete, duplicate due to --delete-duplicates) - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files.length).toBe(0); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 1 new files and 1 duplicate'), - expect.stringContaining('Successfully uploaded 1 new asset'), - expect.stringContaining('Deleting assets that have been uploaded'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - // Verify one new asset was uploaded (total should be 2 now) - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(2); - }); - - it('should only delete duplicates when --delete-duplicates is used without --delete', async () => { - const { - stderr: firstStderr, - stdout: firstStdout, - exitCode: firstExitCode, - } = await immichCli(['upload', `${testAssetDir}/albums/nature/silver_fir.jpg`]); - expect(firstStderr).toContain('{message}'); - expect(firstStdout.split('\n')).toEqual( - expect.arrayContaining([expect.stringContaining('Successfully uploaded 1 new asset')]), - ); - expect(firstExitCode).toBe(0); - - // Both new and duplicate files - await mkdir(`/tmp/albums/nature`, { recursive: true }); - await symlink(`${testAssetDir}/albums/nature/silver_fir.jpg`, `/tmp/albums/nature/silver_fir.jpg`); // duplicate - await symlink(`${testAssetDir}/albums/nature/el_torcal_rocks.jpg`, `/tmp/albums/nature/el_torcal_rocks.jpg`); // new - - // Upload with only --delete-duplicates flag - const { stderr, stdout, exitCode } = await immichCli(['upload', `/tmp/albums/nature`, '--delete-duplicates']); - - // Check that only the duplicate was deleted, new file should remain - const files = await readdir(`/tmp/albums/nature`); - await rm(`/tmp/albums/nature`, { recursive: true }); - expect(files).toEqual(['el_torcal_rocks.jpg']); - - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - expect.stringContaining('Found 1 new files and 1 duplicate'), - expect.stringContaining('Successfully uploaded 1 new asset'), - ]), - ); - expect(stderr).toContain('{message}'); - expect(exitCode).toBe(0); - - // Verify one new asset was uploaded (total should be 2 now) - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(2); - }); - }); - - describe('immich upload --skip-hash', () => { - it('should skip hashing', async () => { - const filename = `albums/nature/silver_fir.jpg`; - await utils.createAsset(admin.accessToken, { - assetData: { - bytes: readFileSync(`${testAssetDir}/${filename}`), - filename: 'silver_fit.jpg', - }, - }); - const { stderr, stdout, exitCode } = await immichCli(['upload', `${testAssetDir}/${filename}`, '--skip-hash']); - - expect(stderr).toBe(''); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - 'Skipping hash check, assuming all files are new', - expect.stringContaining('Successfully uploaded 0 new assets'), - expect.stringContaining('Skipped 1 duplicate asset'), - ]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - }); - - it('should throw an error if attempting dry run', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--skip-hash', - '--dry-run', - ]); - - expect(stdout).toBe(''); - expect(stderr).toEqual(`error: option '-n, --dry-run' cannot be used with option '-h, --skip-hash'`); - expect(exitCode).not.toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - }); - }); - - describe('immich upload --concurrency ', () => { - it('should work', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--concurrency', - '2', - ]); - - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - 'Found 9 new files and 0 duplicates', - expect.stringContaining('Successfully uploaded 9 new assets'), - ]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(9); - }); - - it('should reject string argument', async () => { - const { stderr, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--concurrency string', - ]); - - expect(stderr).toContain('unknown option'); - expect(exitCode).not.toBe(0); - }); - - it('should reject command without number', async () => { - const { stderr, exitCode } = await immichCli(['upload', `${testAssetDir}/albums/nature/`, '--concurrency']); - - expect(stderr).toContain('argument missing'); - expect(exitCode).not.toBe(0); - }); - }); - - describe('immich upload --ignore ', () => { - it('should work', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--ignore', - 'silver_fir.jpg', - ]); - - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - 'Found 8 new files and 0 duplicates', - expect.stringContaining('Successfully uploaded 8 new assets'), - ]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(8); - }); - - it('should ignore assets matching glob pattern', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--ignore', - '!(*_*_*).jpg', - ]); - - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - 'Found 1 new files and 0 duplicates', - expect.stringContaining('Successfully uploaded 1 new asset'), - ]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(1); - }); - - it('should have accurate dry run', async () => { - const { stderr, stdout, exitCode } = await immichCli([ - 'upload', - `${testAssetDir}/albums/nature/`, - '--ignore', - 'silver_fir.jpg', - '--dry-run', - ]); - - expect(stderr).toContain('{message}'); - expect(stdout.split('\n')).toEqual( - expect.arrayContaining([ - 'Found 8 new files and 0 duplicates', - expect.stringContaining('Would have uploaded 8 assets'), - ]), - ); - expect(exitCode).toBe(0); - - const assets = await getAssetStatistics({}, { headers: asKeyAuth(key) }); - expect(assets.total).toBe(0); - }); - }); -}); diff --git a/e2e/src/cli/specs/version.e2e-spec.ts b/e2e/src/cli/specs/version.e2e-spec.ts deleted file mode 100644 index 56a0d8b0b1..0000000000 --- a/e2e/src/cli/specs/version.e2e-spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { immichCli } from 'src/utils'; -import { describe, expect, it } from 'vitest'; - -const pkg = JSON.parse(readFileSync('../cli/package.json', 'utf8')); - -describe(`immich --version`, () => { - describe('immich --version', () => { - it('should print the cli version', async () => { - const { stdout, stderr, exitCode } = await immichCli(['--version']); - expect(stdout).toEqual(pkg.version); - expect(stderr).toEqual(''); - expect(exitCode).toBe(0); - }); - }); - - describe('immich -V', () => { - it('should print the cli version', async () => { - const { stdout, stderr, exitCode } = await immichCli(['-V']); - expect(stdout).toEqual(pkg.version); - expect(stderr).toEqual(''); - expect(exitCode).toBe(0); - }); - }); -}); diff --git a/e2e/src/generators.ts b/e2e/src/generators.ts deleted file mode 100644 index 5e4895d708..0000000000 --- a/e2e/src/generators.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { PNG } from 'pngjs'; - -const createPNG = (r: number, g: number, b: number) => { - const image = new PNG({ width: 1, height: 1 }); - image.data[0] = r; - image.data[1] = g; - image.data[2] = b; - image.data[3] = 255; - return PNG.sync.write(image); -}; - -function* newPngFactory() { - for (let r = 0; r < 255; r++) { - for (let g = 0; g < 255; g++) { - for (let b = 0; b < 255; b++) { - yield createPNG(r, g, b); - } - } - } -} - -const pngFactory = newPngFactory(); - -export const makeRandomImage = () => { - const { value } = pngFactory.next(); - if (!value) { - throw new Error('Ran out of random asset data'); - } - return value; -}; diff --git a/e2e/src/generators/memory.ts b/e2e/src/generators/memory.ts deleted file mode 100644 index c17b4aa476..0000000000 --- a/e2e/src/generators/memory.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { generateMemoriesFromTimeline, generateMemory } from './memory/model-objects'; -export type { MemoryConfig, MemoryYearConfig } from './memory/model-objects'; diff --git a/e2e/src/generators/memory/model-objects.ts b/e2e/src/generators/memory/model-objects.ts deleted file mode 100644 index 1bcc703ed8..0000000000 --- a/e2e/src/generators/memory/model-objects.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { faker } from '@faker-js/faker'; -import { MemoryType, type MemoryResponseDto, type OnThisDayDto } from '@immich/sdk'; -import { DateTime } from 'luxon'; -import { toAssetResponseDto } from 'src/generators/timeline/rest-response'; -import type { MockTimelineAsset } from 'src/generators/timeline/timeline-config'; -import { SeededRandom, selectRandomMultiple } from 'src/generators/timeline/utils'; - -export type MemoryConfig = { - id?: string; - ownerId: string; - year: number; - memoryAt: string; - isSaved?: boolean; -}; - -export type MemoryYearConfig = { - year: number; - assetCount: number; -}; - -export function generateMemory(config: MemoryConfig, assets: MockTimelineAsset[]): MemoryResponseDto { - const now = new Date().toISOString(); - const memoryId = config.id ?? faker.string.uuid(); - - return { - id: memoryId, - assets: assets.map((asset) => toAssetResponseDto(asset)), - data: { year: config.year } as OnThisDayDto, - memoryAt: config.memoryAt, - createdAt: now, - updatedAt: now, - isSaved: config.isSaved ?? false, - ownerId: config.ownerId, - type: MemoryType.OnThisDay, - }; -} - -export function generateMemoriesFromTimeline( - timelineAssets: MockTimelineAsset[], - ownerId: string, - memoryConfigs: MemoryYearConfig[], - seed: number = 42, -): MemoryResponseDto[] { - const rng = new SeededRandom(seed); - const memories: MemoryResponseDto[] = []; - const usedAssetIds = new Set(); - - for (const config of memoryConfigs) { - const yearAssets = timelineAssets.filter((asset) => { - const assetYear = DateTime.fromISO(asset.fileCreatedAt).year; - return assetYear === config.year && !usedAssetIds.has(asset.id); - }); - - if (yearAssets.length === 0) { - continue; - } - - const countToSelect = Math.min(config.assetCount, yearAssets.length); - const selectedAssets = selectRandomMultiple(yearAssets, countToSelect, rng); - - for (const asset of selectedAssets) { - usedAssetIds.add(asset.id); - } - - selectedAssets.sort( - (a, b) => DateTime.fromISO(b.fileCreatedAt).diff(DateTime.fromISO(a.fileCreatedAt)).milliseconds, - ); - - const memoryAt = DateTime.now().set({ year: config.year }).toISO()!; - - memories.push( - generateMemory( - { - ownerId, - year: config.year, - memoryAt, - }, - selectedAssets, - ), - ); - } - - return memories; -} diff --git a/e2e/src/generators/timeline.ts b/e2e/src/generators/timeline.ts deleted file mode 100644 index d4c91d667f..0000000000 --- a/e2e/src/generators/timeline.ts +++ /dev/null @@ -1,37 +0,0 @@ -export { generateTimelineData } from './timeline/model-objects'; - -export { createDefaultTimelineConfig, validateTimelineConfig } from './timeline/timeline-config'; - -export type { - MockAlbum, - MonthSpec, - SerializedTimelineData, - MockTimelineAsset as TimelineAssetConfig, - TimelineConfig, - MockTimelineData as TimelineData, -} from './timeline/timeline-config'; - -export { - getAlbum, - getAsset, - getTimeBucket, - getTimeBuckets, - toAssetResponseDto, - toColumnarFormat, -} from './timeline/rest-response'; - -export type { Changes } from './timeline/rest-response'; - -export { randomImage, randomImageFromString, randomPreview, randomThumbnail } from './timeline/images'; - -export { - SeededRandom, - getMockAsset, - parseTimeBucketKey, - selectRandom, - selectRandomDays, - selectRandomMultiple, -} from './timeline/utils'; - -export { ASSET_DISTRIBUTION, DAY_DISTRIBUTION } from './timeline/distribution-patterns'; -export type { DayPattern, MonthDistribution } from './timeline/distribution-patterns'; diff --git a/e2e/src/generators/timeline/distribution-patterns.ts b/e2e/src/generators/timeline/distribution-patterns.ts deleted file mode 100644 index ae621fd9c5..0000000000 --- a/e2e/src/generators/timeline/distribution-patterns.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { generateConsecutiveDays, generateDayAssets } from 'src/generators/timeline/model-objects'; -import { SeededRandom, selectRandomDays } from 'src/generators/timeline/utils'; -import type { MockTimelineAsset } from './timeline-config'; -import { GENERATION_CONSTANTS } from './timeline-config'; - -type AssetDistributionStrategy = (rng: SeededRandom) => number; - -type DayDistributionStrategy = ( - year: number, - month: number, - daysInMonth: number, - totalAssets: number, - ownerId: string, - rng: SeededRandom, -) => MockTimelineAsset[]; - -/** - * Strategies for determining total asset count per month - */ -export const ASSET_DISTRIBUTION: Record = { - empty: null, // Special case - handled separately - sparse: (rng) => rng.nextInt(3, 9), // 3-8 assets - medium: (rng) => rng.nextInt(15, 31), // 15-30 assets - dense: (rng) => rng.nextInt(50, 81), // 50-80 assets - 'very-dense': (rng) => rng.nextInt(80, 151), // 80-150 assets -}; - -/** - * Strategies for distributing assets across days within a month - */ -export const DAY_DISTRIBUTION: Record = { - 'single-day': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // All assets on one day in the middle of the month - const day = Math.floor(daysInMonth / 2); - return generateDayAssets(year, month, day, totalAssets, ownerId, rng); - }, - - 'consecutive-large': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // 3-5 consecutive days with evenly distributed assets - const numDays = Math.min(5, Math.floor(totalAssets / 15)); - const startDay = rng.nextInt(1, daysInMonth - numDays + 2); - return generateConsecutiveDays(year, month, startDay, numDays, totalAssets, ownerId, rng); - }, - - 'consecutive-small': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Multiple consecutive days with 1-3 assets each (side-by-side layout) - const assets: MockTimelineAsset[] = []; - const numDays = Math.min(totalAssets, Math.floor(daysInMonth / 2)); - const startDay = rng.nextInt(1, daysInMonth - numDays + 2); - let assetIndex = 0; - - for (let i = 0; i < numDays && assetIndex < totalAssets; i++) { - const dayAssets = Math.min(3, rng.nextInt(1, 4)); - const actualAssets = Math.min(dayAssets, totalAssets - assetIndex); - // Create a new RNG for this day - const dayRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, startDay + i, actualAssets, ownerId, dayRng)); - assetIndex += actualAssets; - } - return assets; - }, - - alternating: (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Alternate between large (15-25) and small (1-3) days - const assets: MockTimelineAsset[] = []; - let day = 1; - let isLarge = true; - let assetIndex = 0; - - while (assetIndex < totalAssets && day <= daysInMonth) { - const dayAssets = isLarge ? Math.min(25, rng.nextInt(15, 26)) : rng.nextInt(1, 4); - - const actualAssets = Math.min(dayAssets, totalAssets - assetIndex); - // Create a new RNG for this day - const dayRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, day, actualAssets, ownerId, dayRng)); - assetIndex += actualAssets; - - day += isLarge ? 1 : 1; // Could add gaps here - isLarge = !isLarge; - } - return assets; - }, - - 'sparse-scattered': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Spread assets across random days with gaps - const assets: MockTimelineAsset[] = []; - const numDays = Math.min(totalAssets, Math.floor(daysInMonth * GENERATION_CONSTANTS.SPARSE_DAY_COVERAGE)); - const daysWithPhotos = selectRandomDays(daysInMonth, numDays, rng); - let assetIndex = 0; - - for (let i = 0; i < daysWithPhotos.length && assetIndex < totalAssets; i++) { - const dayAssets = - Math.floor(totalAssets / numDays) + (i === daysWithPhotos.length - 1 ? totalAssets % numDays : 0); - // Create a new RNG for this day - const dayRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, daysWithPhotos[i], dayAssets, ownerId, dayRng)); - assetIndex += dayAssets; - } - return assets; - }, - - 'start-heavy': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Most assets in first week - const assets: MockTimelineAsset[] = []; - const firstWeekAssets = Math.floor(totalAssets * 0.7); - const remainingAssets = totalAssets - firstWeekAssets; - - // First 7 days - assets.push(...generateConsecutiveDays(year, month, 1, 7, firstWeekAssets, ownerId, rng)); - - // Remaining scattered - if (remainingAssets > 0) { - const midDay = Math.floor(daysInMonth / 2); - // Create a new RNG for the remaining assets - const remainingRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, midDay, remainingAssets, ownerId, remainingRng)); - } - return assets; - }, - - 'end-heavy': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Most assets in last week - const assets: MockTimelineAsset[] = []; - const lastWeekAssets = Math.floor(totalAssets * 0.7); - const remainingAssets = totalAssets - lastWeekAssets; - - // Remaining at start - if (remainingAssets > 0) { - // Create a new RNG for the start assets - const startRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, 2, remainingAssets, ownerId, startRng)); - } - - // Last 7 days - const startDay = daysInMonth - 6; - assets.push(...generateConsecutiveDays(year, month, startDay, 7, lastWeekAssets, ownerId, rng)); - return assets; - }, - - 'mid-heavy': (year, month, daysInMonth, totalAssets, ownerId, rng) => { - // Most assets in middle of month - const assets: MockTimelineAsset[] = []; - const midAssets = Math.floor(totalAssets * 0.7); - const sideAssets = Math.floor((totalAssets - midAssets) / 2); - - // Start - if (sideAssets > 0) { - // Create a new RNG for the start assets - const startRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, 2, sideAssets, ownerId, startRng)); - } - - // Middle - const midStart = Math.floor(daysInMonth / 2) - 3; - assets.push(...generateConsecutiveDays(year, month, midStart, 7, midAssets, ownerId, rng)); - - // End - const endAssets = totalAssets - midAssets - sideAssets; - if (endAssets > 0) { - // Create a new RNG for the end assets - const endRng = new SeededRandom(rng.nextInt(0, 1_000_000)); - assets.push(...generateDayAssets(year, month, daysInMonth - 1, endAssets, ownerId, endRng)); - } - return assets; - }, -}; -export type MonthDistribution = - | 'empty' // 0 assets - | 'sparse' // 3-8 assets - | 'medium' // 15-30 assets - | 'dense' // 50-80 assets - | 'very-dense'; // 80-150 assets - -export type DayPattern = - | 'single-day' // All images in one day - | 'consecutive-large' // Multiple days with 15-25 images each - | 'consecutive-small' // Multiple days with 1-3 images each (side-by-side) - | 'alternating' // Alternating large/small days - | 'sparse-scattered' // Few images scattered across month - | 'start-heavy' // Most images at start of month - | 'end-heavy' // Most images at end of month - | 'mid-heavy'; // Most images in middle of month diff --git a/e2e/src/generators/timeline/images.ts b/e2e/src/generators/timeline/images.ts deleted file mode 100644 index 69ec576714..0000000000 --- a/e2e/src/generators/timeline/images.ts +++ /dev/null @@ -1,111 +0,0 @@ -import sharp from 'sharp'; -import { SeededRandom } from 'src/generators/timeline/utils'; - -export const randomThumbnail = async (seed: string, ratio: number) => { - const height = 235; - const width = Math.round(height * ratio); - return randomImageFromString(seed, { width, height }); -}; - -export const randomPreview = async (seed: string, ratio: number) => { - const height = 500; - const width = Math.round(height * ratio); - return randomImageFromString(seed, { width, height }); -}; - -export const randomImageFromString = async ( - seed: string = '', - { width = 100, height = 100 }: { width: number; height: number }, -) => { - // Convert string to number for seeding - let seedNumber = 0; - for (let i = 0; i < seed.length; i++) { - seedNumber = (seedNumber << 5) - seedNumber + (seed.codePointAt(i) ?? 0); - seedNumber = seedNumber & seedNumber; // Convert to 32bit integer - } - return randomImage(new SeededRandom(Math.abs(seedNumber)), { width, height }); -}; - -export const randomImage = async (rng: SeededRandom, { width, height }: { width: number; height: number }) => { - const r1 = rng.nextInt(0, 256); - const g1 = rng.nextInt(0, 256); - const b1 = rng.nextInt(0, 256); - const r2 = rng.nextInt(0, 256); - const g2 = rng.nextInt(0, 256); - const b2 = rng.nextInt(0, 256); - const patternType = rng.nextInt(0, 5); - - let svgPattern = ''; - - switch (patternType) { - case 0: { - // Solid color - svgPattern = ` - - `; - break; - } - - case 1: { - // Horizontal stripes - const stripeHeight = 10; - svgPattern = ` - ${Array.from( - { length: height / stripeHeight }, - (_, i) => - ``, - ).join('')} - `; - break; - } - - case 2: { - // Vertical stripes - const stripeWidth = 10; - svgPattern = ` - ${Array.from( - { length: width / stripeWidth }, - (_, i) => - ``, - ).join('')} - `; - break; - } - - case 3: { - // Checkerboard - const squareSize = 10; - svgPattern = ` - ${Array.from({ length: height / squareSize }, (_, row) => - Array.from({ length: width / squareSize }, (_, col) => { - const isEven = (row + col) % 2 === 0; - return ``; - }).join(''), - ).join('')} - `; - break; - } - - case 4: { - // Diagonal stripes - svgPattern = ` - - - - - - - - `; - break; - } - } - - const svgBuffer = Buffer.from(svgPattern); - const jpegData = await sharp(svgBuffer).jpeg({ quality: 50 }).toBuffer(); - return jpegData; -}; diff --git a/e2e/src/generators/timeline/model-objects.ts b/e2e/src/generators/timeline/model-objects.ts deleted file mode 100644 index f06596fd1a..0000000000 --- a/e2e/src/generators/timeline/model-objects.ts +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Generator functions for timeline model objects - */ - -import { faker } from '@faker-js/faker'; -import { AssetVisibility } from '@immich/sdk'; -import { DateTime } from 'luxon'; -import { writeFileSync } from 'node:fs'; -import { SeededRandom } from 'src/generators/timeline/utils'; -import type { DayPattern, MonthDistribution } from './distribution-patterns'; -import { ASSET_DISTRIBUTION, DAY_DISTRIBUTION } from './distribution-patterns'; -import type { MockTimelineAsset, MockTimelineData, SerializedTimelineData, TimelineConfig } from './timeline-config'; -import { ASPECT_RATIO_WEIGHTS, GENERATION_CONSTANTS, validateTimelineConfig } from './timeline-config'; - -/** - * Generate a random aspect ratio based on weighted probabilities - */ -export function generateAspectRatio(rng: SeededRandom): string { - const random = rng.next(); - let cumulative = 0; - - for (const [ratio, weight] of Object.entries(ASPECT_RATIO_WEIGHTS)) { - cumulative += weight; - if (random < cumulative) { - return ratio; - } - } - return '16:9'; // Default fallback -} - -export function generateThumbhash(rng: SeededRandom): string { - return Array.from({ length: 10 }, () => rng.nextInt(0, 256).toString(16).padStart(2, '0')).join(''); -} - -export function generateDuration(rng: SeededRandom): string { - return `${rng.nextInt(GENERATION_CONSTANTS.MIN_VIDEO_DURATION_SECONDS, GENERATION_CONSTANTS.MAX_VIDEO_DURATION_SECONDS)}.${rng.nextInt(0, 1000).toString().padStart(3, '0')}`; -} - -export function generateUUID(): string { - return faker.string.uuid(); -} - -export function generateAsset( - year: number, - month: number, - day: number, - ownerId: string, - rng: SeededRandom, -): MockTimelineAsset { - const from = DateTime.fromObject({ year, month, day }).setZone('UTC'); - const to = from.endOf('day'); - const date = faker.date.between({ from: from.toJSDate(), to: to.toJSDate() }); - const isVideo = rng.next() < GENERATION_CONSTANTS.VIDEO_PROBABILITY; - - const assetId = generateUUID(); - const hasGPS = rng.next() < GENERATION_CONSTANTS.GPS_PERCENTAGE; - - const ratio = generateAspectRatio(rng); - - const asset: MockTimelineAsset = { - id: assetId, - ownerId, - ratio: Number.parseFloat(ratio.split(':')[0]) / Number.parseFloat(ratio.split(':')[1]), - thumbhash: generateThumbhash(rng), - localDateTime: date.toISOString(), - fileCreatedAt: date.toISOString(), - isFavorite: rng.next() < GENERATION_CONSTANTS.FAVORITE_PROBABILITY, - isTrashed: false, - isVideo, - isImage: !isVideo, - duration: isVideo ? generateDuration(rng) : null, - projectionType: null, - livePhotoVideoId: null, - city: hasGPS ? faker.location.city() : null, - country: hasGPS ? faker.location.country() : null, - people: null, - latitude: hasGPS ? faker.location.latitude() : null, - longitude: hasGPS ? faker.location.longitude() : null, - visibility: AssetVisibility.Timeline, - stack: null, - fileSizeInByte: faker.number.int({ min: 510, max: 5_000_000 }), - checksum: faker.string.alphanumeric({ length: 5 }), - }; - - return asset; -} - -/** - * Generate assets for a specific day - */ -export function generateDayAssets( - year: number, - month: number, - day: number, - assetCount: number, - ownerId: string, - rng: SeededRandom, -): MockTimelineAsset[] { - return Array.from({ length: assetCount }, () => generateAsset(year, month, day, ownerId, rng)); -} - -/** - * Distribute assets evenly across consecutive days - * - * @returns Array of generated timeline assets - */ -export function generateConsecutiveDays( - year: number, - month: number, - startDay: number, - numDays: number, - totalAssets: number, - ownerId: string, - rng: SeededRandom, -): MockTimelineAsset[] { - const assets: MockTimelineAsset[] = []; - const assetsPerDay = Math.floor(totalAssets / numDays); - - for (let i = 0; i < numDays; i++) { - const dayAssets = - i === numDays - 1 - ? totalAssets - assetsPerDay * (numDays - 1) // Remainder on last day - : assetsPerDay; - // Create a new RNG with a different seed for each day - const dayRng = new SeededRandom(rng.nextInt(0, 1_000_000) + i * 100); - assets.push(...generateDayAssets(year, month, startDay + i, dayAssets, ownerId, dayRng)); - } - - return assets; -} - -/** - * Generate assets for a month with specified distribution pattern - */ -export function generateMonthAssets( - year: number, - month: number, - ownerId: string, - distribution: MonthDistribution = 'medium', - pattern: DayPattern = 'consecutive-large', - rng: SeededRandom, -): MockTimelineAsset[] { - const daysInMonth = new Date(year, month, 0).getDate(); - - if (distribution === 'empty') { - return []; - } - - const distributionStrategy = ASSET_DISTRIBUTION[distribution]; - if (!distributionStrategy) { - console.warn(`Unknown distribution: ${distribution}, defaulting to medium`); - return []; - } - const totalAssets = distributionStrategy(rng); - - const dayStrategy = DAY_DISTRIBUTION[pattern]; - if (!dayStrategy) { - console.warn(`Unknown pattern: ${pattern}, defaulting to consecutive-large`); - // Fallback to consecutive-large pattern - const numDays = Math.min(5, Math.floor(totalAssets / 15)); - const startDay = rng.nextInt(1, daysInMonth - numDays + 2); - const assets = generateConsecutiveDays(year, month, startDay, numDays, totalAssets, ownerId, rng); - assets.sort((a, b) => DateTime.fromISO(b.localDateTime).diff(DateTime.fromISO(a.localDateTime)).milliseconds); - return assets; - } - - const assets = dayStrategy(year, month, daysInMonth, totalAssets, ownerId, rng); - assets.sort((a, b) => DateTime.fromISO(b.localDateTime).diff(DateTime.fromISO(a.localDateTime)).milliseconds); - return assets; -} - -/** - * Main generator function for timeline data - */ -export function generateTimelineData(config: TimelineConfig): MockTimelineData { - validateTimelineConfig(config); - - const buckets = new Map(); - const monthStats: Record = {}; - - const globalRng = new SeededRandom(config.seed || GENERATION_CONSTANTS.DEFAULT_SEED); - faker.seed(globalRng.nextInt(0, 1_000_000)); - for (const monthConfig of config.months) { - const { year, month, distribution, pattern } = monthConfig; - - const monthSeed = globalRng.nextInt(0, 1_000_000); - const monthRng = new SeededRandom(monthSeed); - - const monthAssets = generateMonthAssets( - year, - month, - config.ownerId || generateUUID(), - distribution, - pattern, - monthRng, - ); - - if (monthAssets.length > 0) { - const monthKey = `${year}-${month.toString().padStart(2, '0')}`; - monthStats[monthKey] = { - count: monthAssets.length, - distribution, - pattern, - }; - - // Create bucket key (YYYY-MM-01) - const bucketKey = `${year}-${month.toString().padStart(2, '0')}-01`; - buckets.set(bucketKey, monthAssets); - } - } - - // Create a mock album from random assets - const allAssets = [...buckets.values()].flat(); - - // Select 10-30 random assets for the album (or all assets if less than 10) - const albumSize = Math.min(allAssets.length, globalRng.nextInt(10, 31)); - const selectedAssetConfigs: MockTimelineAsset[] = []; - const usedIndices = new Set(); - - while (selectedAssetConfigs.length < albumSize && usedIndices.size < allAssets.length) { - const randomIndex = globalRng.nextInt(0, allAssets.length); - if (!usedIndices.has(randomIndex)) { - usedIndices.add(randomIndex); - selectedAssetConfigs.push(allAssets[randomIndex]); - } - } - - // Sort selected assets by date (newest first) - selectedAssetConfigs.sort( - (a, b) => DateTime.fromISO(b.localDateTime).diff(DateTime.fromISO(a.localDateTime)).milliseconds, - ); - - const selectedAssets = selectedAssetConfigs.map((asset) => asset.id); - - const now = new Date().toISOString(); - const album = { - id: generateUUID(), - albumName: 'Test Album', - description: 'A mock album for testing', - assetIds: selectedAssets, - thumbnailAssetId: selectedAssets.length > 0 ? selectedAssets[0] : null, - createdAt: now, - updatedAt: now, - }; - - // Write to file if configured - if (config.writeToFile) { - const outputPath = config.outputPath || '/tmp/timeline-data.json'; - - // Convert Map to object for serialization - const serializedData: SerializedTimelineData = { - buckets: Object.fromEntries(buckets), - album, - }; - - try { - writeFileSync(outputPath, JSON.stringify(serializedData, null, 2)); - console.log(`Timeline data written to ${outputPath}`); - } catch (error) { - console.error(`Failed to write timeline data to ${outputPath}:`, error); - } - } - - return { buckets, album }; -} diff --git a/e2e/src/generators/timeline/rest-response.ts b/e2e/src/generators/timeline/rest-response.ts deleted file mode 100644 index a193535cd3..0000000000 --- a/e2e/src/generators/timeline/rest-response.ts +++ /dev/null @@ -1,439 +0,0 @@ -/** - * REST API output functions for converting timeline data to API response formats - */ - -import { - AssetTypeEnum, - AssetVisibility, - UserAvatarColor, - type AlbumResponseDto, - type AssetResponseDto, - type ExifResponseDto, - type TimeBucketAssetResponseDto, - type TimeBucketsResponseDto, - type UserResponseDto, -} from '@immich/sdk'; -import { DateTime } from 'luxon'; -import { signupDto } from 'src/fixtures'; -import { parseTimeBucketKey } from 'src/generators/timeline/utils'; -import type { MockTimelineAsset, MockTimelineData } from './timeline-config'; - -/** - * Convert timeline/asset models to columnar format (parallel arrays) - */ -export function toColumnarFormat(assets: MockTimelineAsset[]): TimeBucketAssetResponseDto { - const result: TimeBucketAssetResponseDto = { - id: [], - ownerId: [], - ratio: [], - thumbhash: [], - fileCreatedAt: [], - localOffsetHours: [], - isFavorite: [], - isTrashed: [], - isImage: [], - duration: [], - projectionType: [], - livePhotoVideoId: [], - city: [], - country: [], - visibility: [], - }; - - for (const asset of assets) { - result.id.push(asset.id); - result.ownerId.push(asset.ownerId); - result.ratio.push(asset.ratio); - result.thumbhash.push(asset.thumbhash); - result.fileCreatedAt.push(asset.fileCreatedAt); - result.localOffsetHours.push(0); // Assuming UTC for mocks - result.isFavorite.push(asset.isFavorite); - result.isTrashed.push(asset.isTrashed); - result.isImage.push(asset.isImage); - result.duration.push(asset.duration); - result.projectionType.push(asset.projectionType); - result.livePhotoVideoId.push(asset.livePhotoVideoId); - result.city.push(asset.city); - result.country.push(asset.country); - result.visibility.push(asset.visibility); - } - - if (assets.some((a) => a.latitude !== null || a.longitude !== null)) { - result.latitude = assets.map((a) => a.latitude); - result.longitude = assets.map((a) => a.longitude); - } - - result.stack = assets.map(() => null); - return result; -} - -/** - * Extract a single bucket from timeline data (mimics getTimeBucket API) - * Automatically handles both ISO timestamp and simple month formats - * Returns data in columnar format matching the actual API - * When albumId is provided, only returns assets from that album - */ -export function getTimeBucket( - timelineData: MockTimelineData, - timeBucket: string, - isTrashed: boolean | undefined, - isArchived: boolean | undefined, - isFavorite: boolean | undefined, - albumId: string | undefined, - changes: Changes, -): TimeBucketAssetResponseDto { - const bucketKey = parseTimeBucketKey(timeBucket); - let assets = timelineData.buckets.get(bucketKey); - - if (!assets) { - return toColumnarFormat([]); - } - - // Create sets for quick lookups - const deletedAssetIds = new Set(changes.assetDeletions); - const archivedAssetIds = new Set(changes.assetArchivals); - const favoritedAssetIds = new Set(changes.assetFavorites); - - // Filter assets based on trashed/archived status - assets = assets.filter((asset) => - shouldIncludeAsset(asset, isTrashed, isArchived, isFavorite, deletedAssetIds, archivedAssetIds, favoritedAssetIds), - ); - - // Filter to only include assets from the specified album - if (albumId) { - const album = timelineData.album; - if (!album || album.id !== albumId) { - return toColumnarFormat([]); - } - - // Create a Set for faster lookup - const albumAssetIds = new Set([...album.assetIds, ...changes.albumAdditions]); - assets = assets.filter((asset) => albumAssetIds.has(asset.id)); - } - - // Override properties for assets in changes arrays - const assetsWithOverrides = assets.map((asset) => { - if (deletedAssetIds.has(asset.id) || archivedAssetIds.has(asset.id) || favoritedAssetIds.has(asset.id)) { - return { - ...asset, - isFavorite: favoritedAssetIds.has(asset.id) ? true : asset.isFavorite, - isTrashed: deletedAssetIds.has(asset.id) ? true : asset.isTrashed, - visibility: archivedAssetIds.has(asset.id) ? AssetVisibility.Archive : asset.visibility, - }; - } - return asset; - }); - - return toColumnarFormat(assetsWithOverrides); -} - -export type Changes = { - // ids of assets that are newly added to the album - albumAdditions: string[]; - // ids of assets that are newly deleted - assetDeletions: string[]; - // ids of assets that are newly archived - assetArchivals: string[]; - // ids of assets that are newly favorited - assetFavorites: string[]; -}; - -/** - * Helper function to determine if an asset should be included based on filter criteria - * @param asset - The asset to check - * @param isTrashed - Filter for trashed status (undefined means no filter) - * @param isArchived - Filter for archived status (undefined means no filter) - * @param isFavorite - Filter for favorite status (undefined means no filter) - * @param deletedAssetIds - Set of IDs for assets that have been deleted - * @param archivedAssetIds - Set of IDs for assets that have been archived - * @param favoritedAssetIds - Set of IDs for assets that have been favorited - * @returns true if the asset matches all filter criteria - */ -function shouldIncludeAsset( - asset: MockTimelineAsset, - isTrashed: boolean | undefined, - isArchived: boolean | undefined, - isFavorite: boolean | undefined, - deletedAssetIds: Set, - archivedAssetIds: Set, - favoritedAssetIds: Set, -): boolean { - // Determine actual status (property or in changes) - const actuallyTrashed = asset.isTrashed || deletedAssetIds.has(asset.id); - const actuallyArchived = asset.visibility === 'archive' || archivedAssetIds.has(asset.id); - const actuallyFavorited = asset.isFavorite || favoritedAssetIds.has(asset.id); - - // Apply filters - if (isTrashed !== undefined && actuallyTrashed !== isTrashed) { - return false; - } - if (isArchived !== undefined && actuallyArchived !== isArchived) { - return false; - } - if (isFavorite !== undefined && actuallyFavorited !== isFavorite) { - return false; - } - - return true; -} -/** - * Get summary for all buckets (mimics getTimeBuckets API) - * When albumId is provided, only includes buckets that contain assets from that album - */ -export function getTimeBuckets( - timelineData: MockTimelineData, - isTrashed: boolean | undefined, - isArchived: boolean | undefined, - isFavorite: boolean | undefined, - albumId: string | undefined, - changes: Changes, -): TimeBucketsResponseDto[] { - const summary: TimeBucketsResponseDto[] = []; - - // Create sets for quick lookups - const deletedAssetIds = new Set(changes.assetDeletions); - const archivedAssetIds = new Set(changes.assetArchivals); - const favoritedAssetIds = new Set(changes.assetFavorites); - - // If no albumId is specified, return summary for all assets - if (albumId) { - // Filter to only include buckets with assets from the specified album - const album = timelineData.album; - if (!album || album.id !== albumId) { - return []; - } - - // Create a Set for faster lookup - const albumAssetIds = new Set([...album.assetIds, ...changes.albumAdditions]); - for (const removed of changes.assetDeletions) { - albumAssetIds.delete(removed); - } - for (const [bucketKey, assets] of timelineData.buckets) { - // Count how many assets in this bucket are in the album and match trashed/archived filters - const albumAssetsInBucket = assets.filter((asset) => { - // Must be in the album - if (!albumAssetIds.has(asset.id)) { - return false; - } - - return shouldIncludeAsset( - asset, - isTrashed, - isArchived, - isFavorite, - deletedAssetIds, - archivedAssetIds, - favoritedAssetIds, - ); - }); - - if (albumAssetsInBucket.length > 0) { - summary.push({ - timeBucket: bucketKey, - count: albumAssetsInBucket.length, - }); - } - } - } else { - for (const [bucketKey, assets] of timelineData.buckets) { - // Filter assets based on trashed/archived status - const filteredAssets = assets.filter((asset) => - shouldIncludeAsset( - asset, - isTrashed, - isArchived, - isFavorite, - deletedAssetIds, - archivedAssetIds, - favoritedAssetIds, - ), - ); - - if (filteredAssets.length > 0) { - summary.push({ - timeBucket: bucketKey, - count: filteredAssets.length, - }); - } - } - } - - // Sort summary by date (newest first) using luxon - summary.sort((a, b) => { - const dateA = DateTime.fromISO(a.timeBucket); - const dateB = DateTime.fromISO(b.timeBucket); - return dateB.diff(dateA).milliseconds; - }); - - return summary; -} - -const createDefaultOwner = (ownerId: string) => { - const defaultOwner: UserResponseDto = { - id: ownerId, - email: signupDto.admin.email, - name: signupDto.admin.name, - profileImagePath: '', - profileChangedAt: new Date().toISOString(), - avatarColor: UserAvatarColor.Blue, - }; - return defaultOwner; -}; - -/** - * Convert a TimelineAssetConfig to a full AssetResponseDto - * This matches the response from GET /api/assets/:id - */ -export function toAssetResponseDto(asset: MockTimelineAsset, owner?: UserResponseDto): AssetResponseDto { - const now = new Date().toISOString(); - - // Default owner if not provided - const defaultOwner = createDefaultOwner(asset.ownerId); - - const exifInfo: ExifResponseDto = { - make: null, - model: null, - exifImageWidth: asset.ratio > 1 ? 4000 : 3000, - exifImageHeight: asset.ratio > 1 ? Math.round(4000 / asset.ratio) : Math.round(3000 * asset.ratio), - fileSizeInByte: asset.fileSizeInByte, - orientation: '1', - dateTimeOriginal: asset.fileCreatedAt, - modifyDate: asset.fileCreatedAt, - timeZone: asset.latitude === null ? null : 'UTC', - lensModel: null, - fNumber: null, - focalLength: null, - iso: null, - exposureTime: null, - latitude: asset.latitude, - longitude: asset.longitude, - city: asset.city, - country: asset.country, - state: null, - description: null, - }; - - return { - id: asset.id, - deviceAssetId: `device-${asset.id}`, - ownerId: asset.ownerId, - owner: owner || defaultOwner, - libraryId: `library-${asset.ownerId}`, - deviceId: `device-${asset.ownerId}`, - type: asset.isVideo ? AssetTypeEnum.Video : AssetTypeEnum.Image, - originalPath: `/original/${asset.id}.${asset.isVideo ? 'mp4' : 'jpg'}`, - originalFileName: `${asset.id}.${asset.isVideo ? 'mp4' : 'jpg'}`, - originalMimeType: asset.isVideo ? 'video/mp4' : 'image/jpeg', - thumbhash: asset.thumbhash, - fileCreatedAt: asset.fileCreatedAt, - fileModifiedAt: asset.fileCreatedAt, - localDateTime: asset.localDateTime, - updatedAt: now, - createdAt: asset.fileCreatedAt, - isFavorite: asset.isFavorite, - isArchived: false, - isTrashed: asset.isTrashed, - visibility: asset.visibility, - duration: asset.duration || '0:00:00.00000', - exifInfo, - livePhotoVideoId: asset.livePhotoVideoId, - tags: [], - people: [], - unassignedFaces: [], - stack: asset.stack, - isOffline: false, - hasMetadata: true, - duplicateId: null, - resized: true, - checksum: asset.checksum, - width: exifInfo.exifImageWidth ?? 1, - height: exifInfo.exifImageHeight ?? 1, - isEdited: false, - }; -} - -/** - * Get a single asset by ID from timeline data - * This matches the response from GET /api/assets/:id - */ -export function getAsset( - timelineData: MockTimelineData, - assetId: string, - owner?: UserResponseDto, -): AssetResponseDto | undefined { - // Search through all buckets for the asset - const buckets = [...timelineData.buckets.values()]; - for (const assets of buckets) { - const asset = assets.find((a) => a.id === assetId); - if (asset) { - return toAssetResponseDto(asset, owner); - } - } - return undefined; -} - -/** - * Get a mock album from timeline data - * This matches the response from GET /api/albums/:id - */ -export function getAlbum( - timelineData: MockTimelineData, - ownerId: string, - albumId: string | undefined, - changes: Changes, -): AlbumResponseDto | undefined { - if (!timelineData.album) { - return undefined; - } - - // If albumId is provided and doesn't match, return undefined - if (albumId && albumId !== timelineData.album.id) { - return undefined; - } - - const album = timelineData.album; - const albumOwner = createDefaultOwner(ownerId); - - // Get the actual asset objects from the timeline data - const albumAssets: AssetResponseDto[] = []; - const allAssets = [...timelineData.buckets.values()].flat(); - - for (const assetId of album.assetIds) { - const assetConfig = allAssets.find((a) => a.id === assetId); - if (assetConfig) { - albumAssets.push(toAssetResponseDto(assetConfig, albumOwner)); - } - } - for (const assetId of changes.albumAdditions ?? []) { - const assetConfig = allAssets.find((a) => a.id === assetId); - if (assetConfig) { - albumAssets.push(toAssetResponseDto(assetConfig, albumOwner)); - } - } - - albumAssets.sort((a, b) => DateTime.fromISO(b.localDateTime).diff(DateTime.fromISO(a.localDateTime)).milliseconds); - - // For a basic mock album, we don't include any albumUsers (shared users) - // The owner is represented by the owner field, not in albumUsers - const response: AlbumResponseDto = { - id: album.id, - albumName: album.albumName, - description: album.description, - albumThumbnailAssetId: album.thumbnailAssetId, - createdAt: album.createdAt, - updatedAt: album.updatedAt, - ownerId: albumOwner.id, - owner: albumOwner, - albumUsers: [], // Empty array for non-shared album - shared: false, - hasSharedLink: false, - isActivityEnabled: true, - assetCount: albumAssets.length, - assets: albumAssets, - startDate: albumAssets.length > 0 ? albumAssets.at(-1)?.fileCreatedAt : undefined, - endDate: albumAssets.length > 0 ? albumAssets[0].fileCreatedAt : undefined, - lastModifiedAssetTimestamp: albumAssets.length > 0 ? albumAssets[0].fileCreatedAt : undefined, - }; - - return response; -} diff --git a/e2e/src/generators/timeline/timeline-config.ts b/e2e/src/generators/timeline/timeline-config.ts deleted file mode 100644 index 8dbe8399b1..0000000000 --- a/e2e/src/generators/timeline/timeline-config.ts +++ /dev/null @@ -1,200 +0,0 @@ -import type { AssetVisibility } from '@immich/sdk'; -import { DayPattern, MonthDistribution } from 'src/generators/timeline/distribution-patterns'; - -// Constants for generation parameters -export const GENERATION_CONSTANTS = { - VIDEO_PROBABILITY: 0.15, // 15% of assets are videos - GPS_PERCENTAGE: 0.7, // 70% of assets have GPS data - FAVORITE_PROBABILITY: 0.1, // 10% of assets are favorited - MIN_VIDEO_DURATION_SECONDS: 5, - MAX_VIDEO_DURATION_SECONDS: 300, - DEFAULT_SEED: 12_345, - DEFAULT_OWNER_ID: 'user-1', - MAX_SELECT_ATTEMPTS: 10, - SPARSE_DAY_COVERAGE: 0.4, // 40% of days have photos in sparse pattern -} as const; - -// Aspect ratio distribution weights (must sum to 1) -export const ASPECT_RATIO_WEIGHTS = { - '4:3': 0.35, // 35% 4:3 landscape - '3:2': 0.25, // 25% 3:2 landscape - '16:9': 0.2, // 20% 16:9 landscape - '2:3': 0.1, // 10% 2:3 portrait - '1:1': 0.09, // 9% 1:1 square - '3:1': 0.01, // 1% 3:1 panorama -} as const; - -export type AspectRatio = { - width: number; - height: number; - ratio: number; - name: string; -}; - -// Mock configuration for asset generation - will be transformed to API response formats -export type MockTimelineAsset = { - id: string; - ownerId: string; - ratio: number; - thumbhash: string | null; - localDateTime: string; - fileCreatedAt: string; - isFavorite: boolean; - isTrashed: boolean; - isVideo: boolean; - isImage: boolean; - duration: string | null; - projectionType: string | null; - livePhotoVideoId: string | null; - city: string | null; - country: string | null; - people: string[] | null; - latitude: number | null; - longitude: number | null; - visibility: AssetVisibility; - stack: null; - checksum: string; - fileSizeInByte: number; -}; - -export type MonthSpec = { - year: number; - month: number; // 1-12 - distribution: MonthDistribution; - pattern: DayPattern; -}; - -/** - * Configuration for timeline data generation - */ -export type TimelineConfig = { - ownerId?: string; - months: MonthSpec[]; - seed?: number; - writeToFile?: boolean; - outputPath?: string; -}; - -export type MockAlbum = { - id: string; - albumName: string; - description: string; - assetIds: string[]; // IDs of assets in the album - thumbnailAssetId: string | null; - createdAt: string; - updatedAt: string; -}; - -export type MockTimelineData = { - buckets: Map; - album: MockAlbum; // Mock album created from random assets -}; - -export type SerializedTimelineData = { - buckets: Record; - album: MockAlbum; -}; - -/** - * Validates a TimelineConfig object to ensure all values are within expected ranges - */ -export function validateTimelineConfig(config: TimelineConfig): void { - if (!config.months || config.months.length === 0) { - throw new Error('TimelineConfig must contain at least one month'); - } - - const seenMonths = new Set(); - - for (const month of config.months) { - if (month.month < 1 || month.month > 12) { - throw new Error(`Invalid month: ${month.month}. Must be between 1 and 12`); - } - - if (month.year < 1900 || month.year > 2100) { - throw new Error(`Invalid year: ${month.year}. Must be between 1900 and 2100`); - } - - const monthKey = `${month.year}-${month.month}`; - if (seenMonths.has(monthKey)) { - throw new Error(`Duplicate month found: ${monthKey}`); - } - seenMonths.add(monthKey); - - // Validate distribution if provided - if (month.distribution && !['empty', 'sparse', 'medium', 'dense', 'very-dense'].includes(month.distribution)) { - throw new Error( - `Invalid distribution: ${month.distribution}. Must be one of: empty, sparse, medium, dense, very-dense`, - ); - } - - const validPatterns = [ - 'single-day', - 'consecutive-large', - 'consecutive-small', - 'alternating', - 'sparse-scattered', - 'start-heavy', - 'end-heavy', - 'mid-heavy', - ]; - if (month.pattern && !validPatterns.includes(month.pattern)) { - throw new Error(`Invalid pattern: ${month.pattern}. Must be one of: ${validPatterns.join(', ')}`); - } - } - - // Validate seed if provided - if (config.seed !== undefined && (config.seed < 0 || !Number.isInteger(config.seed))) { - throw new Error('Seed must be a non-negative integer'); - } - - // Validate ownerId if provided - if (config.ownerId !== undefined && config.ownerId.trim() === '') { - throw new Error('Owner ID cannot be an empty string'); - } -} - -/** - * Create a default timeline configuration - */ -export function createDefaultTimelineConfig(): TimelineConfig { - const months: MonthSpec[] = [ - // 2024 - Mix of patterns - { year: 2024, month: 12, distribution: 'very-dense', pattern: 'alternating' }, - { year: 2024, month: 11, distribution: 'dense', pattern: 'consecutive-large' }, - { year: 2024, month: 10, distribution: 'medium', pattern: 'mid-heavy' }, - { year: 2024, month: 9, distribution: 'sparse', pattern: 'consecutive-small' }, - { year: 2024, month: 8, distribution: 'empty', pattern: 'single-day' }, - { year: 2024, month: 7, distribution: 'dense', pattern: 'start-heavy' }, - { year: 2024, month: 6, distribution: 'medium', pattern: 'sparse-scattered' }, - { year: 2024, month: 5, distribution: 'sparse', pattern: 'single-day' }, - { year: 2024, month: 4, distribution: 'very-dense', pattern: 'consecutive-large' }, - { year: 2024, month: 3, distribution: 'empty', pattern: 'single-day' }, - { year: 2024, month: 2, distribution: 'medium', pattern: 'end-heavy' }, - { year: 2024, month: 1, distribution: 'dense', pattern: 'alternating' }, - - // 2023 - Testing year boundaries and more patterns - { year: 2023, month: 12, distribution: 'very-dense', pattern: 'end-heavy' }, - { year: 2023, month: 11, distribution: 'sparse', pattern: 'consecutive-small' }, - { year: 2023, month: 10, distribution: 'empty', pattern: 'single-day' }, - { year: 2023, month: 9, distribution: 'medium', pattern: 'alternating' }, - { year: 2023, month: 8, distribution: 'dense', pattern: 'mid-heavy' }, - { year: 2023, month: 7, distribution: 'sparse', pattern: 'sparse-scattered' }, - { year: 2023, month: 6, distribution: 'medium', pattern: 'consecutive-large' }, - { year: 2023, month: 5, distribution: 'empty', pattern: 'single-day' }, - { year: 2023, month: 4, distribution: 'sparse', pattern: 'single-day' }, - { year: 2023, month: 3, distribution: 'dense', pattern: 'start-heavy' }, - { year: 2023, month: 2, distribution: 'medium', pattern: 'alternating' }, - { year: 2023, month: 1, distribution: 'very-dense', pattern: 'consecutive-large' }, - ]; - - for (let year = 2022; year >= 2000; year--) { - for (let month = 12; month >= 1; month--) { - months.push({ year, month, distribution: 'medium', pattern: 'sparse-scattered' }); - } - } - - return { - months, - seed: 42, - }; -} diff --git a/e2e/src/generators/timeline/utils.ts b/e2e/src/generators/timeline/utils.ts deleted file mode 100644 index 686a8223ef..0000000000 --- a/e2e/src/generators/timeline/utils.ts +++ /dev/null @@ -1,186 +0,0 @@ -import { DateTime } from 'luxon'; -import { GENERATION_CONSTANTS, MockTimelineAsset } from 'src/generators/timeline/timeline-config'; - -/** - * Linear Congruential Generator for deterministic pseudo-random numbers - */ -export class SeededRandom { - private seed: number; - - constructor(seed: number) { - this.seed = seed; - } - - /** - * Generate next random number in range [0, 1) - */ - next(): number { - // LCG parameters from Numerical Recipes - this.seed = (this.seed * 1_664_525 + 1_013_904_223) % 2_147_483_647; - return this.seed / 2_147_483_647; - } - - /** - * Generate random integer in range [min, max) - */ - nextInt(min: number, max: number): number { - return Math.floor(this.next() * (max - min)) + min; - } - - /** - * Generate random boolean with given probability - */ - nextBoolean(probability = 0.5): boolean { - return this.next() < probability; - } -} - -/** - * Select random days using seed variation to avoid collisions. - * - * @param daysInMonth - Total number of days in the month - * @param numDays - Number of days to select - * @param rng - Random number generator instance - * @returns Array of selected day numbers, sorted in descending order - */ -export function selectRandomDays(daysInMonth: number, numDays: number, rng: SeededRandom): number[] { - const selectedDays = new Set(); - const maxAttempts = numDays * GENERATION_CONSTANTS.MAX_SELECT_ATTEMPTS; // Safety limit - let attempts = 0; - - while (selectedDays.size < numDays && attempts < maxAttempts) { - const day = rng.nextInt(1, daysInMonth + 1); - selectedDays.add(day); - attempts++; - } - - // Fallback: if we couldn't select enough random days, fill with sequential days - if (selectedDays.size < numDays) { - for (let day = 1; day <= daysInMonth && selectedDays.size < numDays; day++) { - selectedDays.add(day); - } - } - - return [...selectedDays].toSorted((a, b) => b - a); -} - -/** - * Select item from array using seeded random - */ -export function selectRandom(arr: T[], rng: SeededRandom): T { - if (arr.length === 0) { - throw new Error('Cannot select from empty array'); - } - const index = rng.nextInt(0, arr.length); - return arr[index]; -} - -/** - * Select multiple random items from array using seeded random without duplicates - */ -export function selectRandomMultiple(arr: T[], count: number, rng: SeededRandom): T[] { - if (arr.length === 0) { - throw new Error('Cannot select from empty array'); - } - if (count < 0) { - throw new Error('Count must be non-negative'); - } - if (count > arr.length) { - throw new Error('Count cannot exceed array length'); - } - - const result: T[] = []; - const selectedIndices = new Set(); - - while (result.length < count) { - const index = rng.nextInt(0, arr.length); - if (!selectedIndices.has(index)) { - selectedIndices.add(index); - result.push(arr[index]); - } - } - - return result; -} - -/** - * Parse timeBucket parameter to extract year-month key - * Handles both formats: - * - ISO timestamp: "2024-12-01T00:00:00.000Z" -> "2024-12-01" - * - Simple format: "2024-12-01" -> "2024-12-01" - */ -export function parseTimeBucketKey(timeBucket: string): string { - if (!timeBucket) { - throw new Error('timeBucket parameter cannot be empty'); - } - - const dt = DateTime.fromISO(timeBucket, { zone: 'utc' }); - - if (!dt.isValid) { - // Fallback to regex if not a valid ISO string - const match = timeBucket.match(/^(\d{4}-\d{2}-\d{2})/); - return match ? match[1] : timeBucket; - } - - // Format as YYYY-MM-01 (first day of month) - return `${dt.year}-${String(dt.month).padStart(2, '0')}-01`; -} - -export function getMockAsset( - asset: MockTimelineAsset, - sortedDescendingAssets: MockTimelineAsset[], - direction: 'next' | 'previous', - unit: 'day' | 'month' | 'year' = 'day', -): MockTimelineAsset | null { - const currentDateTime = DateTime.fromISO(asset.localDateTime, { zone: 'utc' }); - - const currentIndex = sortedDescendingAssets.findIndex((a) => a.id === asset.id); - - if (currentIndex === -1) { - return null; - } - - const step = direction === 'next' ? 1 : -1; - const startIndex = currentIndex + step; - - if (direction === 'next' && currentIndex >= sortedDescendingAssets.length - 1) { - return null; - } - if (direction === 'previous' && currentIndex <= 0) { - return null; - } - - const isInDifferentPeriod = (date1: DateTime, date2: DateTime): boolean => { - if (unit === 'day') { - return !date1.startOf('day').equals(date2.startOf('day')); - } else if (unit === 'month') { - return date1.year !== date2.year || date1.month !== date2.month; - } else { - return date1.year !== date2.year; - } - }; - - if (direction === 'next') { - // Search forward in array (backwards in time) - for (let i = startIndex; i < sortedDescendingAssets.length; i++) { - const nextAsset = sortedDescendingAssets[i]; - const nextDate = DateTime.fromISO(nextAsset.localDateTime, { zone: 'utc' }); - - if (isInDifferentPeriod(nextDate, currentDateTime)) { - return nextAsset; - } - } - } else { - // Search backward in array (forwards in time) - for (let i = startIndex; i >= 0; i--) { - const prevAsset = sortedDescendingAssets[i]; - const prevDate = DateTime.fromISO(prevAsset.localDateTime, { zone: 'utc' }); - - if (isInDifferentPeriod(prevDate, currentDateTime)) { - return prevAsset; - } - } - } - - return null; -} diff --git a/e2e/src/immich-admin/specs/immich-admin.e2e-spec.ts b/e2e/src/immich-admin/specs/immich-admin.e2e-spec.ts deleted file mode 100644 index 24699cda30..0000000000 --- a/e2e/src/immich-admin/specs/immich-admin.e2e-spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { immichAdmin, utils } from 'src/utils'; -import { beforeAll, describe, expect, it } from 'vitest'; - -describe(`immich-admin`, () => { - beforeAll(async () => { - await utils.resetDatabase(); - await utils.adminSetup(); - }); - - describe('revoke-admin', () => { - it('should revoke admin privileges from a user', async () => { - const { child, promise } = immichAdmin(['revoke-admin']); - - let data = ''; - child.stdout.on('data', (chunk) => { - data += chunk; - if (data.includes('Please enter the user email:')) { - child.stdin.end('admin@immich.cloud\n'); - } - }); - - const { stdout, exitCode } = await promise; - expect(exitCode).toBe(0); - - expect(stdout).toContain('Admin access has been revoked from'); - }); - }); - - describe('grant-admin', () => { - it('should grant admin privileges to a user', async () => { - const { child, promise } = immichAdmin(['grant-admin']); - - let data = ''; - child.stdout.on('data', (chunk) => { - data += chunk; - if (data.includes('Please enter the user email:')) { - child.stdin.end('admin@immich.cloud\n'); - } - }); - - const { stdout, exitCode } = await promise; - expect(exitCode).toBe(0); - - expect(stdout).toContain('Admin access has been granted to'); - }); - }); - - describe('list-users', () => { - it('should list the admin user', async () => { - const { stdout, exitCode } = await immichAdmin(['list-users']).promise; - expect(exitCode).toBe(0); - - // TODO: Vitest needs upgrade to Node 22.x to fix the failed check - // expect(stderr).toBe(''); - expect(stdout).toContain("email: 'admin@immich.cloud'"); - expect(stdout).toContain("name: 'Immich Admin'"); - }); - }); - - describe('reset-admin-password', () => { - it('should reset admin password', async () => { - const { child, promise } = immichAdmin(['reset-admin-password']); - - let data = ''; - child.stdout.on('data', (chunk) => { - data += chunk; - if (data.includes('Please choose a new password (optional)')) { - child.stdin.end('\n'); - } - }); - - const { stdout, exitCode } = await promise; - expect(exitCode).toBe(0); - // TODO: Vitest needs upgrade to Node 22.x to fix the failed check - // expect(stderr).toBe(''); - expect(stdout).toContain('The admin password has been updated to:'); - }); - }); -}); diff --git a/e2e/src/mock-network/base-network.ts b/e2e/src/mock-network/base-network.ts deleted file mode 100644 index f23202ca77..0000000000 --- a/e2e/src/mock-network/base-network.ts +++ /dev/null @@ -1,285 +0,0 @@ -import { BrowserContext } from '@playwright/test'; -import { playwrightHost } from 'playwright.config'; - -export const setupBaseMockApiRoutes = async (context: BrowserContext, adminUserId: string) => { - await context.addCookies([ - { - name: 'immich_is_authenticated', - value: 'true', - domain: playwrightHost, - path: '/', - }, - ]); - await context.route('**/api/users/me', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - id: adminUserId, - email: 'admin@immich.cloud', - name: 'Immich Admin', - profileImagePath: '', - avatarColor: 'orange', - profileChangedAt: '2025-01-22T21:31:23.996Z', - storageLabel: 'admin', - shouldChangePassword: true, - isAdmin: true, - createdAt: '2025-01-22T21:31:23.996Z', - deletedAt: null, - updatedAt: '2025-11-14T00:00:00.369Z', - oauthId: '', - quotaSizeInBytes: null, - quotaUsageInBytes: 20_849_000_159, - status: 'active', - license: null, - }, - }); - }); - await context.route('**/users/me/preferences', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - albums: { - defaultAssetOrder: 'desc', - }, - folders: { - enabled: false, - sidebarWeb: false, - }, - memories: { - enabled: true, - duration: 5, - }, - people: { - enabled: true, - sidebarWeb: false, - }, - sharedLinks: { - enabled: true, - sidebarWeb: false, - }, - ratings: { - enabled: false, - }, - tags: { - enabled: false, - sidebarWeb: false, - }, - emailNotifications: { - enabled: true, - albumInvite: true, - albumUpdate: true, - }, - download: { - archiveSize: 4_294_967_296, - includeEmbeddedVideos: false, - }, - purchase: { - showSupportBadge: true, - hideBuyButtonUntil: '2100-02-12T00:00:00.000Z', - }, - cast: { - gCastEnabled: false, - }, - }, - }); - }); - await context.route('**/server/about', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - version: 'v2.2.3', - versionUrl: 'https://github.com/immich-app/immich/releases/tag/v2.2.3', - licensed: false, - build: '1234567890', - buildUrl: 'https://github.com/immich-app/immich/actions/runs/1234567890', - buildImage: 'e2e', - buildImageUrl: 'https://github.com/immich-app/immich/pkgs/container/immich-server', - repository: 'immich-app/immich', - repositoryUrl: 'https://github.com/immich-app/immich', - sourceRef: 'e2e', - sourceCommit: 'e2eeeeeeeeeeeeeeeeee', - sourceUrl: 'https://github.com/immich-app/immich/commit/e2eeeeeeeeeeeeeeeeee', - nodejs: 'v22.18.0', - exiftool: '13.41', - ffmpeg: '7.1.1-6', - libvips: '8.17.2', - imagemagick: '7.1.2-2', - }, - }); - }); - await context.route('**/api/server/features', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - smartSearch: false, - facialRecognition: false, - duplicateDetection: false, - map: true, - reverseGeocoding: true, - importFaces: false, - sidecar: true, - search: true, - trash: true, - oauth: false, - oauthAutoLaunch: false, - ocr: false, - passwordLogin: true, - configFile: false, - email: false, - }, - }); - }); - await context.route('**/api/server/config', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - loginPageMessage: '', - trashDays: 30, - userDeleteDelay: 7, - oauthButtonText: 'Login with OAuth', - isInitialized: true, - isOnboarded: true, - externalDomain: '', - publicUsers: true, - mapDarkStyleUrl: 'https://tiles.immich.cloud/v1/style/dark.json', - mapLightStyleUrl: 'https://tiles.immich.cloud/v1/style/light.json', - maintenanceMode: false, - }, - }); - }); - await context.route('**/api/server/media-types', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - video: [ - '.3gp', - '.3gpp', - '.avi', - '.flv', - '.insv', - '.m2t', - '.m2ts', - '.m4v', - '.mkv', - '.mov', - '.mp4', - '.mpe', - '.mpeg', - '.mpg', - '.mts', - '.vob', - '.webm', - '.wmv', - ], - image: [ - '.3fr', - '.ari', - '.arw', - '.cap', - '.cin', - '.cr2', - '.cr3', - '.crw', - '.dcr', - '.dng', - '.erf', - '.fff', - '.iiq', - '.k25', - '.kdc', - '.mrw', - '.nef', - '.nrw', - '.orf', - '.ori', - '.pef', - '.psd', - '.raf', - '.raw', - '.rw2', - '.rwl', - '.sr2', - '.srf', - '.srw', - '.x3f', - '.avif', - '.gif', - '.jpeg', - '.jpg', - '.png', - '.webp', - '.bmp', - '.heic', - '.heif', - '.hif', - '.insp', - '.jp2', - '.jpe', - '.jxl', - '.svg', - '.tif', - '.tiff', - ], - sidecar: ['.xmp'], - }, - }); - }); - await context.route('**/api/notifications*', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: [], - }); - }); - await context.route('**/api/albums*', async (route, request) => { - if (request.url().endsWith('albums?shared=true') || request.url().endsWith('albums')) { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: [], - }); - } - await route.fallback(); - }); - await context.route('**/api/memories*', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: [], - }); - }); - await context.route('**/api/server/storage', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - diskSize: '100.0 GiB', - diskUse: '74.4 GiB', - diskAvailable: '25.6 GiB', - diskSizeRaw: 107_374_182_400, - diskUseRaw: 79_891_660_800, - diskAvailableRaw: 27_482_521_600, - diskUsagePercentage: 74.4, - }, - }); - }); - await context.route('**/api/server/version-history', async (route) => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: [ - { - id: 'd1fbeadc-cb4f-4db3-8d19-8c6a921d5d8e', - createdAt: '2025-11-15T20:14:01.935Z', - version: '2.2.3', - }, - ], - }); - }); -}; diff --git a/e2e/src/mock-network/memory-network.ts b/e2e/src/mock-network/memory-network.ts deleted file mode 100644 index 9a3a9e6555..0000000000 --- a/e2e/src/mock-network/memory-network.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { MemoryResponseDto } from '@immich/sdk'; -import { BrowserContext } from '@playwright/test'; - -export type MemoryChanges = { - memoryDeletions: string[]; - assetRemovals: Map; -}; - -export const setupMemoryMockApiRoutes = async ( - context: BrowserContext, - memories: MemoryResponseDto[], - changes: MemoryChanges, -) => { - await context.route('**/api/memories*', async (route, request) => { - const url = new URL(request.url()); - const pathname = url.pathname; - - if (pathname === '/api/memories' && request.method() === 'GET') { - const activeMemories = memories - .filter((memory) => !changes.memoryDeletions.includes(memory.id)) - .map((memory) => { - const removedAssets = changes.assetRemovals.get(memory.id) ?? []; - return { - ...memory, - assets: memory.assets.filter((asset) => !removedAssets.includes(asset.id)), - }; - }) - .filter((memory) => memory.assets.length > 0); - - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: activeMemories, - }); - } - - const memoryMatch = pathname.match(/\/api\/memories\/([^/]+)$/); - if (memoryMatch && request.method() === 'GET') { - const memoryId = memoryMatch[1]; - const memory = memories.find((m) => m.id === memoryId); - - if (!memory || changes.memoryDeletions.includes(memoryId)) { - return route.fulfill({ status: 404 }); - } - - const removedAssets = changes.assetRemovals.get(memoryId) ?? []; - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - ...memory, - assets: memory.assets.filter((asset) => !removedAssets.includes(asset.id)), - }, - }); - } - - if (/\/api\/memories\/([^/]+)$/.test(pathname) && request.method() === 'DELETE') { - const memoryId = pathname.split('/').pop()!; - changes.memoryDeletions.push(memoryId); - return route.fulfill({ status: 204 }); - } - - await route.fallback(); - }); -}; diff --git a/e2e/src/mock-network/timeline-network.ts b/e2e/src/mock-network/timeline-network.ts deleted file mode 100644 index 8780409657..0000000000 --- a/e2e/src/mock-network/timeline-network.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { AssetResponseDto } from '@immich/sdk'; -import { BrowserContext, Page, Request, Route } from '@playwright/test'; -import { basename } from 'node:path'; -import { - Changes, - getAlbum, - getAsset, - getTimeBucket, - getTimeBuckets, - randomPreview, - randomThumbnail, - TimelineData, -} from 'src/generators/timeline'; -import { sleep } from 'src/web/specs/timeline/utils'; - -export class TimelineTestContext { - slowBucket = false; - adminId = ''; -} - -export const setupTimelineMockApiRoutes = async ( - context: BrowserContext, - timelineRestData: TimelineData, - changes: Changes, - testContext: TimelineTestContext, -) => { - await context.route('**/api/timeline**', async (route, request) => { - const url = new URL(request.url()); - const pathname = url.pathname; - if (pathname === '/api/timeline/buckets') { - const albumId = url.searchParams.get('albumId') || undefined; - const isTrashed = url.searchParams.get('isTrashed') ? url.searchParams.get('isTrashed') === 'true' : undefined; - const isFavorite = url.searchParams.get('isFavorite') ? url.searchParams.get('isFavorite') === 'true' : undefined; - const isArchived = url.searchParams.get('visibility') - ? url.searchParams.get('visibility') === 'archive' - : undefined; - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: getTimeBuckets(timelineRestData, isTrashed, isArchived, isFavorite, albumId, changes), - }); - } else if (pathname === '/api/timeline/bucket') { - const timeBucket = url.searchParams.get('timeBucket'); - if (!timeBucket) { - return route.continue(); - } - const isTrashed = url.searchParams.get('isTrashed') ? url.searchParams.get('isTrashed') === 'true' : undefined; - const isArchived = url.searchParams.get('visibility') - ? url.searchParams.get('visibility') === 'archive' - : undefined; - const isFavorite = url.searchParams.get('isFavorite') ? url.searchParams.get('isFavorite') === 'true' : undefined; - const albumId = url.searchParams.get('albumId') || undefined; - const assets = getTimeBucket(timelineRestData, timeBucket, isTrashed, isArchived, isFavorite, albumId, changes); - if (testContext.slowBucket) { - await sleep(5000); - } - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: assets, - }); - } - return route.continue(); - }); - - await context.route('**/api/assets/*', async (route, request) => { - if (request.method() === 'GET') { - const url = new URL(request.url()); - const pathname = url.pathname; - const assetId = basename(pathname); - let asset = getAsset(timelineRestData, assetId); - if (changes.assetDeletions.includes(asset!.id)) { - asset = { - ...asset, - isTrashed: true, - } as AssetResponseDto; - } - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: asset, - }); - } - await route.fallback(); - }); - - await context.route('**/api/assets', async (route, request) => { - if (request.method() === 'DELETE') { - return route.fulfill({ - status: 204, - }); - } - await route.fallback(); - }); - - await context.route('**/api/assets/*/ocr', async (route) => { - return route.fulfill({ status: 200, contentType: 'application/json', json: [] }); - }); - - await context.route('**/api/assets/*/thumbnail?size=*', async (route, request) => { - const pattern = /\/api\/assets\/(?[^/]+)\/thumbnail\?size=(?preview|thumbnail)/; - const match = request.url().match(pattern); - if (!match?.groups) { - throw new Error(`Invalid URL for thumbnail endpoint: ${request.url()}`); - } - - if (match.groups.size === 'preview') { - if (!route.request().serviceWorker()) { - return route.continue(); - } - const asset = getAsset(timelineRestData, match.groups.assetId); - return route.fulfill({ - status: 200, - headers: { 'content-type': 'image/jpeg', ETag: 'abc123', 'Cache-Control': 'public, max-age=3600' }, - body: await randomPreview( - match.groups.assetId, - (asset?.exifInfo?.exifImageWidth ?? 0) / (asset?.exifInfo?.exifImageHeight ?? 1), - ), - }); - } - if (match.groups.size === 'thumbnail') { - if (!route.request().serviceWorker()) { - return route.continue(); - } - const asset = getAsset(timelineRestData, match.groups.assetId); - return route.fulfill({ - status: 200, - headers: { 'content-type': 'image/jpeg' }, - body: await randomThumbnail( - match.groups.assetId, - (asset?.exifInfo?.exifImageWidth ?? 0) / (asset?.exifInfo?.exifImageHeight ?? 1), - ), - }); - } - return route.continue(); - }); - - await context.route('**/api/albums/**', async (route, request) => { - const albumsMatch = request.url().match(/\/api\/albums\/(?[^/?]+)/); - if (albumsMatch) { - const album = getAlbum(timelineRestData, testContext.adminId, albumsMatch.groups?.albumId, changes); - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: album, - }); - } - return route.fallback(); - }); - - await context.route('**/api/albums**', async (route, request) => { - const allAlbums = request.url().match(/\/api\/albums\?assetId=(?[^&]+)/); - if (allAlbums) { - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: [], - }); - } - return route.fallback(); - }); -}; - -export const pageRoutePromise = async ( - page: Page, - route: string, - callback: (route: Route, request: Request) => Promise, -) => { - let resolveRequest: ((value: unknown | PromiseLike) => void) | undefined; - const deleteRequest = new Promise((resolve) => { - resolveRequest = resolve; - }); - await page.route(route, async (route, request) => { - await callback(route, request); - const requestJson = request.postDataJSON(); - resolveRequest?.(requestJson); - }); - return deleteRequest; -}; diff --git a/e2e/src/utils.ts b/e2e/src/utils.ts index 7307f87854..b1db2e4218 100644 --- a/e2e/src/utils.ts +++ b/e2e/src/utils.ts @@ -1,3 +1,4 @@ +import { BrowserContext } from '@playwright/test'; import { AssetMediaCreateDto, AssetMediaResponseDto, @@ -53,8 +54,7 @@ import { updateMyPreferences, upsertTags, validate, -} from '@immich/sdk'; -import { BrowserContext } from '@playwright/test'; +} from '@server/sdk'; import { exec, spawn } from 'node:child_process'; import { createHash } from 'node:crypto'; import { createWriteStream, existsSync, mkdirSync, renameSync, rmSync, writeFileSync } from 'node:fs'; diff --git a/e2e/src/web/specs/album.e2e-spec.ts b/e2e/src/web/specs/album.e2e-spec.ts deleted file mode 100644 index 953c7d00ae..0000000000 --- a/e2e/src/web/specs/album.e2e-spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LoginResponseDto } from '@immich/sdk'; -import { test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe('Album', () => { - let admin: LoginResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - test(`doesn't delete album after canceling add assets`, async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - - await page.goto('/albums'); - await page.getByRole('button', { name: 'Create album' }).click(); - await page.getByRole('button', { name: 'Select photos' }).click(); - await page.getByRole('button', { name: 'Close' }).click(); - - await page.reload(); - await page.getByRole('button', { name: 'Select photos' }).waitFor(); - }); -}); diff --git a/e2e/src/web/specs/asset-viewer/asset-viewer.ui-spec.ts b/e2e/src/web/specs/asset-viewer/asset-viewer.ui-spec.ts deleted file mode 100644 index 669f1b815c..0000000000 --- a/e2e/src/web/specs/asset-viewer/asset-viewer.ui-spec.ts +++ /dev/null @@ -1,269 +0,0 @@ -import { faker } from '@faker-js/faker'; -import { expect, test } from '@playwright/test'; -import { - Changes, - createDefaultTimelineConfig, - generateTimelineData, - SeededRandom, - selectRandom, - TimelineAssetConfig, - TimelineData, -} from 'src/generators/timeline'; -import { setupBaseMockApiRoutes } from 'src/mock-network/base-network'; -import { setupTimelineMockApiRoutes, TimelineTestContext } from 'src/mock-network/timeline-network'; -import { utils } from 'src/utils'; -import { assetViewerUtils } from 'src/web/specs/timeline/utils'; - -test.describe.configure({ mode: 'parallel' }); -test.describe('asset-viewer', () => { - const rng = new SeededRandom(529); - let adminUserId: string; - let timelineRestData: TimelineData; - const assets: TimelineAssetConfig[] = []; - const yearMonths: string[] = []; - const testContext = new TimelineTestContext(); - const changes: Changes = { - albumAdditions: [], - assetDeletions: [], - assetArchivals: [], - assetFavorites: [], - }; - - test.beforeAll(async () => { - utils.initSdk(); - adminUserId = faker.string.uuid(); - testContext.adminId = adminUserId; - timelineRestData = generateTimelineData({ ...createDefaultTimelineConfig(), ownerId: adminUserId }); - for (const timeBucket of timelineRestData.buckets.values()) { - assets.push(...timeBucket); - } - for (const yearMonth of timelineRestData.buckets.keys()) { - const [year, month] = yearMonth.split('-'); - yearMonths.push(`${year}-${Number(month)}`); - } - }); - - test.beforeEach(async ({ context }) => { - await setupBaseMockApiRoutes(context, adminUserId); - await setupTimelineMockApiRoutes(context, timelineRestData, changes, testContext); - }); - - test.afterEach(() => { - testContext.slowBucket = false; - changes.albumAdditions = []; - changes.assetDeletions = []; - changes.assetArchivals = []; - changes.assetFavorites = []; - }); - - test.describe('/photos/:id', () => { - test('Navigate to next asset via button', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - - await page.getByLabel('View next asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index + 1].id}`); - }); - - test('Navigate to previous asset via button', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - - await page.getByLabel('View previous asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index - 1]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index - 1].id}`); - }); - - test('Navigate to next asset via keyboard (ArrowRight)', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - - await page.keyboard.press('ArrowRight'); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index + 1].id}`); - }); - - test('Navigate to previous asset via keyboard (ArrowLeft)', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - - await page.keyboard.press('ArrowLeft'); - await assetViewerUtils.waitForViewerLoad(page, assets[index - 1]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index - 1].id}`); - }); - - test('Navigate forward 5 times via button', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - - for (let i = 1; i <= 5; i++) { - await page.getByLabel('View next asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + i]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index + i].id}`); - } - }); - - test('Navigate backward 5 times via button', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - - for (let i = 1; i <= 5; i++) { - await page.getByLabel('View previous asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index - i]); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${assets[index - i].id}`); - } - }); - - test('Navigate forward then backward via keyboard', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - - // Navigate forward 3 times - for (let i = 1; i <= 3; i++) { - await page.keyboard.press('ArrowRight'); - await assetViewerUtils.waitForViewerLoad(page, assets[index + i]); - } - - // Navigate backward 3 times to return to original - for (let i = 2; i >= 0; i--) { - await page.keyboard.press('ArrowLeft'); - await assetViewerUtils.waitForViewerLoad(page, assets[index + i]); - } - - // Verify we're back at the original asset - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - }); - - test('Verify no next button on last asset', async ({ page }) => { - const lastAsset = assets.at(-1)!; - await page.goto(`/photos/${lastAsset.id}`); - await assetViewerUtils.waitForViewerLoad(page, lastAsset); - - // Verify next button doesn't exist - await expect(page.getByLabel('View next asset')).toHaveCount(0); - }); - - test('Verify no previous button on first asset', async ({ page }) => { - const firstAsset = assets[0]; - await page.goto(`/photos/${firstAsset.id}`); - await assetViewerUtils.waitForViewerLoad(page, firstAsset); - - // Verify previous button doesn't exist - await expect(page.getByLabel('View previous asset')).toHaveCount(0); - }); - - test('Delete photo advances to next', async ({ page }) => { - const asset = selectRandom(assets, rng); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - const index = assets.indexOf(asset); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - }); - test('Delete photo advances to next (2x)', async ({ page }) => { - const asset = selectRandom(assets, rng); - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - const index = assets.indexOf(asset); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 2]); - }); - test('Delete last photo advances to prev', async ({ page }) => { - const asset = assets.at(-1)!; - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - const index = assets.indexOf(asset); - await assetViewerUtils.waitForViewerLoad(page, assets[index - 1]); - }); - test('Delete last photo advances to prev (2x)', async ({ page }) => { - const asset = assets.at(-1)!; - await page.goto(`/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - const index = assets.indexOf(asset); - await assetViewerUtils.waitForViewerLoad(page, assets[index - 1]); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index - 2]); - }); - }); - test.describe('/trash/photos/:id', () => { - test('Delete trashed photo advances to next', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - const deletedAssets = assets.slice(index - 10, index + 10).map((asset) => asset.id); - changes.assetDeletions.push(...deletedAssets); - await page.goto(`/trash/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - }); - test('Delete trashed photo advances to next 2x', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - const deletedAssets = assets.slice(index - 10, index + 10).map((asset) => asset.id); - changes.assetDeletions.push(...deletedAssets); - await page.goto(`/trash/photos/${asset.id}`); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 1]); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 2]); - }); - test('Delete trashed photo advances to prev', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - const deletedAssets = assets.slice(index - 10, index + 10).map((asset) => asset.id); - changes.assetDeletions.push(...deletedAssets); - await page.goto(`/trash/photos/${assets[index + 9].id}`); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 9]); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 8]); - }); - test('Delete trashed photo advances to prev 2x', async ({ page }) => { - const asset = selectRandom(assets, rng); - const index = assets.indexOf(asset); - const deletedAssets = assets.slice(index - 10, index + 10).map((asset) => asset.id); - changes.assetDeletions.push(...deletedAssets); - await page.goto(`/trash/photos/${assets[index + 9].id}`); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 9]); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 8]); - await page.getByLabel('Delete').click(); - // confirm dialog - await page.getByRole('button').getByText('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[index + 7]); - }); - }); -}); diff --git a/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts b/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts deleted file mode 100644 index 2f90e4e3d8..0000000000 --- a/e2e/src/web/specs/asset-viewer/detail-panel.e2e-spec.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto, SharedLinkType } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import type { Socket } from 'socket.io-client'; -import { utils } from 'src/utils'; - -test.describe('Detail Panel', () => { - let admin: LoginResponseDto; - let asset: AssetMediaResponseDto; - let websocket: Socket; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - asset = await utils.createAsset(admin.accessToken); - websocket = await utils.connectWebsocket(admin.accessToken); - }); - - test.afterAll(() => { - utils.disconnectWebsocket(websocket); - }); - - test('can be opened for shared links', async ({ page }) => { - const sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset.id], - }); - await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - - await expect(page.getByRole('button', { name: 'Info' })).toBeVisible(); - await page.keyboard.press('i'); - await expect(page.locator('#detail-panel')).toBeVisible(); - await page.keyboard.press('i'); - await expect(page.locator('#detail-panel')).toHaveCount(0); - }); - - test('cannot be opened for shared links with hidden metadata', async ({ page }) => { - const sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset.id], - showMetadata: false, - }); - await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - - await expect(page.getByRole('button', { name: 'Info' })).toHaveCount(0); - await page.keyboard.press('i'); - await expect(page.locator('#detail-panel')).toHaveCount(0); - await page.keyboard.press('i'); - await expect(page.locator('#detail-panel')).toHaveCount(0); - }); - - test('description is visible for owner on shared links', async ({ context, page }) => { - const sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset.id], - }); - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); - - const textarea = page.getByRole('textbox', { name: 'Add a description' }); - await page.getByRole('button', { name: 'Info' }).click(); - await expect(textarea).toBeVisible(); - await expect(textarea).not.toBeDisabled(); - }); - - test('description changes are visible after reopening', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - - await page.getByRole('button', { name: 'Info' }).click(); - const textarea = page.getByRole('textbox', { name: 'Add a description' }); - await textarea.fill('new description'); - await expect(textarea).toHaveValue('new description'); - - await page.getByRole('button', { name: 'Info' }).click(); - await expect(textarea).not.toBeVisible(); - await page.getByRole('button', { name: 'Info' }).click(); - await expect(textarea).toBeVisible(); - - await utils.waitForWebsocketEvent({ event: 'assetUpdate', id: asset.id }); - await expect(textarea).toHaveValue('new description'); - }); -}); diff --git a/e2e/src/web/specs/asset-viewer/navbar.e2e-spec.ts b/e2e/src/web/specs/asset-viewer/navbar.e2e-spec.ts deleted file mode 100644 index 8fcd1bbdb4..0000000000 --- a/e2e/src/web/specs/asset-viewer/navbar.e2e-spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto, SharedLinkType } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe('Asset Viewer Navbar', () => { - let admin: LoginResponseDto; - let asset: AssetMediaResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - test.beforeEach(async () => { - asset = await utils.createAsset(admin.accessToken); - }); - - test.describe('shared link without metadata', () => { - test('visible guest actions', async ({ page }) => { - const sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset.id], - showMetadata: false, - }); - await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - - const expected = ['Zoom Image', 'Copy Image', 'Download']; - const buttons = await page.getByTestId('asset-viewer-navbar-actions').getByRole('button').all(); - - for (const [i, button] of buttons.entries()) { - await expect(button).toHaveAccessibleName(expected[i]); - } - }); - - test('visible owner actions', async ({ context, page }) => { - const sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Individual, - assetIds: [asset.id], - showMetadata: false, - }); - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - - const expected = ['Share', 'Zoom Image', 'Copy Image', 'Download']; - const buttons = await page.getByTestId('asset-viewer-navbar-actions').getByRole('button').all(); - - for (const [i, button] of buttons.entries()) { - await expect(button).toHaveAccessibleName(expected[i]); - } - }); - }); - - test.describe('actions', () => { - test('favorite asset with shortcut', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - await page.keyboard.press('f'); - await expect(page.getByText('Added to favorites')).toBeVisible(); - }); - }); -}); diff --git a/e2e/src/web/specs/asset-viewer/slideshow.e2e-spec.ts b/e2e/src/web/specs/asset-viewer/slideshow.e2e-spec.ts deleted file mode 100644 index c8cbc21588..0000000000 --- a/e2e/src/web/specs/asset-viewer/slideshow.e2e-spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto } from '@immich/sdk'; -import { expect, type Page, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe('Slideshow', () => { - let admin: LoginResponseDto; - let asset: AssetMediaResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - asset = await utils.createAsset(admin.accessToken); - }); - - const openSlideshow = async (page: Page) => { - await page.goto(`/photos/${asset.id}`); - await page.waitForSelector('#immich-asset-viewer'); - await page.getByRole('button', { name: 'More' }).click(); - await page.getByRole('menuitem', { name: 'Slideshow' }).click(); - }; - - test('open slideshow', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await openSlideshow(page); - await expect(page.getByRole('button', { name: 'Exit Slideshow' })).toBeVisible(); - }); - - test('exit slideshow with button', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await openSlideshow(page); - - const exitButton = page.getByRole('button', { name: 'Exit Slideshow' }); - await exitButton.click(); - await expect(exitButton).not.toBeVisible(); - }); - - test('exit slideshow with shortcut', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await openSlideshow(page); - - const exitButton = page.getByRole('button', { name: 'Exit Slideshow' }); - await expect(exitButton).toBeVisible(); - await page.keyboard.press('Escape'); - await expect(exitButton).not.toBeVisible(); - }); - - test('favorite shortcut is disabled', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - await openSlideshow(page); - - await expect(page.getByRole('button', { name: 'Exit Slideshow' })).toBeVisible(); - await page.keyboard.press('f'); - await expect(page.getByText('Added to favorites')).not.toBeVisible(); - }); -}); diff --git a/e2e/src/web/specs/asset-viewer/stack.e2e-spec.ts b/e2e/src/web/specs/asset-viewer/stack.e2e-spec.ts deleted file mode 100644 index cb40f82c0a..0000000000 --- a/e2e/src/web/specs/asset-viewer/stack.e2e-spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto } from '@immich/sdk'; -import { expect, Page, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -async function ensureDetailPanelVisible(page: Page) { - await page.waitForSelector('#immich-asset-viewer'); - - const isVisible = await page.locator('#detail-panel').isVisible(); - if (!isVisible) { - await page.keyboard.press('i'); - await page.waitForSelector('#detail-panel'); - } -} - -test.describe('Asset Viewer stack', () => { - let admin: LoginResponseDto; - let assetOne: AssetMediaResponseDto; - let assetTwo: AssetMediaResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - await utils.updateMyPreferences(admin.accessToken, { tags: { enabled: true } }); - - assetOne = await utils.createAsset(admin.accessToken); - assetTwo = await utils.createAsset(admin.accessToken); - await utils.createStack(admin.accessToken, [assetOne.id, assetTwo.id]); - - const tags = await utils.upsertTags(admin.accessToken, ['test/1', 'test/2']); - const tagOne = tags.find((tag) => tag.value === 'test/1')!; - const tagTwo = tags.find((tag) => tag.value === 'test/2')!; - await utils.tagAssets(admin.accessToken, tagOne.id, [assetOne.id]); - await utils.tagAssets(admin.accessToken, tagTwo.id, [assetTwo.id]); - }); - - test('stack slideshow is visible', async ({ page, context }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/photos/${assetOne.id}`); - - const stackAssets = page.locator('#stack-slideshow [data-asset]'); - await expect(stackAssets.first()).toBeVisible(); - await expect(stackAssets.nth(1)).toBeVisible(); - }); - - test('tags of primary asset are visible', async ({ page, context }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/photos/${assetOne.id}`); - await ensureDetailPanelVisible(page); - - const tags = page.getByTestId('detail-panel-tags').getByRole('link'); - await expect(tags.first()).toHaveText('test/1'); - }); - - test('tags of second asset are visible', async ({ page, context }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto(`/photos/${assetOne.id}`); - await ensureDetailPanelVisible(page); - - const stackAssets = page.locator('#stack-slideshow [data-asset]'); - await stackAssets.nth(1).click(); - - const tags = page.getByTestId('detail-panel-tags').getByRole('link'); - await expect(tags.first()).toHaveText('test/2'); - }); -}); diff --git a/e2e/src/web/specs/database-backups.e2e-spec.ts b/e2e/src/web/specs/database-backups.e2e-spec.ts deleted file mode 100644 index d101215ceb..0000000000 --- a/e2e/src/web/specs/database-backups.e2e-spec.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { LoginResponseDto } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe.configure({ mode: 'serial' }); - -test.describe('Database Backups', () => { - let admin: LoginResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - test('restore a backup from settings', async ({ context, page }) => { - test.setTimeout(60_000); - - await utils.resetBackups(admin.accessToken); - const filename = await utils.createBackup(admin.accessToken); - await utils.setAuthCookies(context, admin.accessToken); - - // work-around until test is running on released version - await utils.move( - `/data/backups/${filename}`, - '/data/backups/immich-db-backup-20260114T184016-v2.5.0-pg14.19.sql.gz', - ); - - await page.goto('/admin/maintenance?isOpen=backups'); - await page.getByRole('button', { name: 'Restore', exact: true }).click(); - await page.getByRole('dialog').getByRole('button', { name: 'Restore' }).click(); - - await page.waitForURL('/maintenance?**'); - await page.waitForURL('/admin/maintenance**', { timeout: 60_000 }); - }); - - test('handle backup restore failure', async ({ context, page }) => { - test.setTimeout(60_000); - - await utils.resetBackups(admin.accessToken); - await utils.prepareTestBackup('corrupted'); - await utils.setAuthCookies(context, admin.accessToken); - - await page.goto('/admin/maintenance?isOpen=backups'); - await page.getByRole('button', { name: 'Restore', exact: true }).click(); - await page.getByRole('dialog').getByRole('button', { name: 'Restore' }).click(); - - await page.waitForURL('/maintenance?**'); - await expect(page.getByText('IM CORRUPTED')).toBeVisible({ timeout: 60_000 }); - await page.getByRole('button', { name: 'End maintenance mode' }).click(); - await page.waitForURL('/admin/maintenance**'); - }); - - test('rollback to restore point if backup is missing admin', async ({ context, page }) => { - test.setTimeout(60_000); - - await utils.resetBackups(admin.accessToken); - await utils.prepareTestBackup('empty'); - await utils.setAuthCookies(context, admin.accessToken); - - await page.goto('/admin/maintenance?isOpen=backups'); - await page.getByRole('button', { name: 'Restore', exact: true }).click(); - await page.getByRole('dialog').getByRole('button', { name: 'Restore' }).click(); - - await page.waitForURL('/maintenance?**'); - await expect(page.getByText('Server health check failed, no admin exists.')).toBeVisible({ timeout: 60_000 }); - await page.getByRole('button', { name: 'End maintenance mode' }).click(); - await page.waitForURL('/admin/maintenance**'); - }); - - test('restore a backup from onboarding', async ({ context, page }) => { - test.setTimeout(60_000); - - await utils.resetBackups(admin.accessToken); - const filename = await utils.createBackup(admin.accessToken); - await utils.setAuthCookies(context, admin.accessToken); - - // work-around until test is running on released version - await utils.move( - `/data/backups/${filename}`, - '/data/backups/immich-db-backup-20260114T184016-v2.5.0-pg14.19.sql.gz', - ); - - await utils.resetDatabase(); - - await page.goto('/'); - await page.getByRole('button', { name: 'Restore from backup' }).click(); - - try { - await page.waitForURL('/maintenance**'); - } catch { - // when chained with the rest of the tests - // this navigation may fail..? not sure why... - await page.goto('/maintenance'); - await page.waitForURL('/maintenance**'); - } - - await page.getByRole('button', { name: 'Next' }).click(); - await page.getByRole('button', { name: 'Restore', exact: true }).click(); - await page.getByRole('dialog').getByRole('button', { name: 'Restore' }).click(); - - await page.waitForURL('/maintenance?**'); - await page.waitForURL('/photos', { timeout: 60_000 }); - }); -}); diff --git a/e2e/src/web/specs/maintenance.e2e-spec.ts b/e2e/src/web/specs/maintenance.e2e-spec.ts deleted file mode 100644 index 8b1631f0bf..0000000000 --- a/e2e/src/web/specs/maintenance.e2e-spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { LoginResponseDto } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe.configure({ mode: 'serial' }); - -test.describe('Maintenance', () => { - let admin: LoginResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - test('enter and exit maintenance mode', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - - await page.goto('/admin/maintenance'); - await page.getByRole('button', { name: 'Switch to maintenance mode' }).click(); - - await expect(page.getByText('Temporarily Unavailable')).toBeVisible({ timeout: 10_000 }); - await page.getByRole('button', { name: 'End maintenance mode' }).click(); - await page.waitForURL('**/admin/maintenance*', { timeout: 10_000 }); - }); - - test('maintenance shows no options to users until they authenticate', async ({ page }) => { - const setCookie = await utils.enterMaintenance(admin.accessToken); - const cookie = setCookie - ?.map((cookie) => cookie.split(';')[0].split('=')) - ?.find(([name]) => name === 'immich_maintenance_token'); - - expect(cookie).toBeTruthy(); - - await expect(async () => { - await page.goto('/'); - await page.waitForURL('**/maintenance?**', { - timeout: 1000, - }); - }).toPass({ timeout: 10_000 }); - - await expect(page.getByText('Temporarily Unavailable')).toBeVisible(); - await expect(page.getByRole('button', { name: 'End maintenance mode' })).toHaveCount(0); - - await page.goto(`/maintenance?${new URLSearchParams({ token: cookie![1] })}`); - await expect(page.getByText('Temporarily Unavailable')).toBeVisible(); - await expect(page.getByRole('button', { name: 'End maintenance mode' })).toBeVisible(); - await page.getByRole('button', { name: 'End maintenance mode' }).click(); - await page.waitForURL('**/auth/login'); - }); -}); diff --git a/e2e/src/web/specs/memory/memory-viewer.ui-spec.ts b/e2e/src/web/specs/memory/memory-viewer.ui-spec.ts deleted file mode 100644 index 11e73fbe25..0000000000 --- a/e2e/src/web/specs/memory/memory-viewer.ui-spec.ts +++ /dev/null @@ -1,289 +0,0 @@ -import { faker } from '@faker-js/faker'; -import type { MemoryResponseDto } from '@immich/sdk'; -import { test } from '@playwright/test'; -import { generateMemoriesFromTimeline } from 'src/generators/memory'; -import { - Changes, - createDefaultTimelineConfig, - generateTimelineData, - TimelineAssetConfig, - TimelineData, -} from 'src/generators/timeline'; -import { setupBaseMockApiRoutes } from 'src/mock-network/base-network'; -import { MemoryChanges, setupMemoryMockApiRoutes } from 'src/mock-network/memory-network'; -import { setupTimelineMockApiRoutes, TimelineTestContext } from 'src/mock-network/timeline-network'; -import { memoryAssetViewerUtils, memoryGalleryUtils, memoryViewerUtils } from 'src/web/specs/memory/utils'; - -test.describe.configure({ mode: 'parallel' }); - -test.describe('Memory Viewer - Gallery Asset Viewer Navigation', () => { - let adminUserId: string; - let timelineRestData: TimelineData; - let memories: MemoryResponseDto[]; - const assets: TimelineAssetConfig[] = []; - const testContext = new TimelineTestContext(); - const changes: Changes = { - albumAdditions: [], - assetDeletions: [], - assetArchivals: [], - assetFavorites: [], - }; - const memoryChanges: MemoryChanges = { - memoryDeletions: [], - assetRemovals: new Map(), - }; - - test.beforeAll(async () => { - adminUserId = faker.string.uuid(); - testContext.adminId = adminUserId; - - timelineRestData = generateTimelineData({ - ...createDefaultTimelineConfig(), - ownerId: adminUserId, - }); - - for (const timeBucket of timelineRestData.buckets.values()) { - assets.push(...timeBucket); - } - - memories = generateMemoriesFromTimeline( - assets, - adminUserId, - [ - { year: 2024, assetCount: 3 }, - { year: 2023, assetCount: 2 }, - { year: 2022, assetCount: 4 }, - ], - 42, - ); - }); - - test.beforeEach(async ({ context }) => { - await setupBaseMockApiRoutes(context, adminUserId); - await setupTimelineMockApiRoutes(context, timelineRestData, changes, testContext); - await setupMemoryMockApiRoutes(context, memories, memoryChanges); - }); - - test.afterEach(() => { - testContext.slowBucket = false; - changes.albumAdditions = []; - changes.assetDeletions = []; - changes.assetArchivals = []; - changes.assetFavorites = []; - memoryChanges.memoryDeletions = []; - memoryChanges.assetRemovals.clear(); - }); - - test.describe('Asset viewer navigation from gallery', () => { - test('shows both prev/next buttons for middle asset within a memory', async ({ page }) => { - const firstMemory = memories[0]; - const middleAsset = firstMemory.assets[1]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, middleAsset.id); - await memoryGalleryUtils.clickThumbnail(page, middleAsset.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, middleAsset); - - await memoryAssetViewerUtils.expectPreviousButtonVisible(page); - await memoryAssetViewerUtils.expectNextButtonVisible(page); - }); - - test('shows next button when at last asset of first memory (next memory exists)', async ({ page }) => { - const firstMemory = memories[0]; - const lastAssetOfFirstMemory = firstMemory.assets.at(-1)!; - - await memoryViewerUtils.openMemoryPageWithAsset(page, lastAssetOfFirstMemory.id); - await memoryGalleryUtils.clickThumbnail(page, lastAssetOfFirstMemory.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, lastAssetOfFirstMemory); - - await memoryAssetViewerUtils.expectNextButtonVisible(page); - await memoryAssetViewerUtils.expectPreviousButtonVisible(page); - }); - - test('shows prev button when at first asset of last memory (prev memory exists)', async ({ page }) => { - const lastMemory = memories.at(-1)!; - const firstAssetOfLastMemory = lastMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, firstAssetOfLastMemory.id); - await memoryGalleryUtils.clickThumbnail(page, firstAssetOfLastMemory.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, firstAssetOfLastMemory); - - await memoryAssetViewerUtils.expectPreviousButtonVisible(page); - await memoryAssetViewerUtils.expectNextButtonVisible(page); - }); - - test('can navigate from last asset of memory to first asset of next memory', async ({ page }) => { - const firstMemory = memories[0]; - const secondMemory = memories[1]; - const lastAssetOfFirst = firstMemory.assets.at(-1)!; - const firstAssetOfSecond = secondMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, lastAssetOfFirst.id); - await memoryGalleryUtils.clickThumbnail(page, lastAssetOfFirst.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, lastAssetOfFirst); - - await memoryAssetViewerUtils.clickNextButton(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, firstAssetOfSecond); - - await memoryAssetViewerUtils.expectCurrentAssetId(page, firstAssetOfSecond.id); - }); - - test('can navigate from first asset of memory to last asset of previous memory', async ({ page }) => { - const firstMemory = memories[0]; - const secondMemory = memories[1]; - const lastAssetOfFirst = firstMemory.assets.at(-1)!; - const firstAssetOfSecond = secondMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, firstAssetOfSecond.id); - await memoryGalleryUtils.clickThumbnail(page, firstAssetOfSecond.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, firstAssetOfSecond); - - await memoryAssetViewerUtils.clickPreviousButton(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, lastAssetOfFirst); - }); - - test('hides prev button at very first asset (first memory, first asset, no prev memory)', async ({ page }) => { - const firstMemory = memories[0]; - const veryFirstAsset = firstMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, veryFirstAsset.id); - await memoryGalleryUtils.clickThumbnail(page, veryFirstAsset.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, veryFirstAsset); - - await memoryAssetViewerUtils.expectPreviousButtonNotVisible(page); - await memoryAssetViewerUtils.expectNextButtonVisible(page); - }); - - test('hides next button at very last asset (last memory, last asset, no next memory)', async ({ page }) => { - const lastMemory = memories.at(-1)!; - const veryLastAsset = lastMemory.assets.at(-1)!; - - await memoryViewerUtils.openMemoryPageWithAsset(page, veryLastAsset.id); - await memoryGalleryUtils.clickThumbnail(page, veryLastAsset.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, veryLastAsset); - - await memoryAssetViewerUtils.expectNextButtonNotVisible(page); - await memoryAssetViewerUtils.expectPreviousButtonVisible(page); - }); - }); - - test.describe('Keyboard navigation', () => { - test('ArrowLeft navigates to previous asset across memory boundary', async ({ page }) => { - const firstMemory = memories[0]; - const secondMemory = memories[1]; - const lastAssetOfFirst = firstMemory.assets.at(-1)!; - const firstAssetOfSecond = secondMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, firstAssetOfSecond.id); - await memoryGalleryUtils.clickThumbnail(page, firstAssetOfSecond.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, firstAssetOfSecond); - - await page.keyboard.press('ArrowLeft'); - await memoryAssetViewerUtils.waitForAssetLoad(page, lastAssetOfFirst); - }); - - test('ArrowRight navigates to next asset across memory boundary', async ({ page }) => { - const firstMemory = memories[0]; - const secondMemory = memories[1]; - const lastAssetOfFirst = firstMemory.assets.at(-1)!; - const firstAssetOfSecond = secondMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, lastAssetOfFirst.id); - await memoryGalleryUtils.clickThumbnail(page, lastAssetOfFirst.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, lastAssetOfFirst); - - await page.keyboard.press('ArrowRight'); - await memoryAssetViewerUtils.waitForAssetLoad(page, firstAssetOfSecond); - }); - }); -}); - -test.describe('Memory Viewer - Single Asset Memory Edge Cases', () => { - let adminUserId: string; - let timelineRestData: TimelineData; - let memories: MemoryResponseDto[]; - const assets: TimelineAssetConfig[] = []; - const testContext = new TimelineTestContext(); - const changes: Changes = { - albumAdditions: [], - assetDeletions: [], - assetArchivals: [], - assetFavorites: [], - }; - const memoryChanges: MemoryChanges = { - memoryDeletions: [], - assetRemovals: new Map(), - }; - - test.beforeAll(async () => { - adminUserId = faker.string.uuid(); - testContext.adminId = adminUserId; - - timelineRestData = generateTimelineData({ - ...createDefaultTimelineConfig(), - ownerId: adminUserId, - }); - - for (const timeBucket of timelineRestData.buckets.values()) { - assets.push(...timeBucket); - } - - memories = generateMemoriesFromTimeline( - assets, - adminUserId, - [ - { year: 2024, assetCount: 2 }, - { year: 2023, assetCount: 1 }, - { year: 2022, assetCount: 2 }, - ], - 123, - ); - }); - - test.beforeEach(async ({ context }) => { - await setupBaseMockApiRoutes(context, adminUserId); - await setupTimelineMockApiRoutes(context, timelineRestData, changes, testContext); - await setupMemoryMockApiRoutes(context, memories, memoryChanges); - }); - - test.afterEach(() => { - testContext.slowBucket = false; - changes.albumAdditions = []; - changes.assetDeletions = []; - changes.assetArchivals = []; - changes.assetFavorites = []; - memoryChanges.memoryDeletions = []; - memoryChanges.assetRemovals.clear(); - }); - - test('single asset memory shows both prev/next when surrounded by other memories', async ({ page }) => { - const singleAssetMemory = memories[1]; - const singleAsset = singleAssetMemory.assets[0]; - - await memoryViewerUtils.openMemoryPageWithAsset(page, singleAsset.id); - await memoryGalleryUtils.clickThumbnail(page, singleAsset.id); - - await memoryAssetViewerUtils.waitForViewerOpen(page); - await memoryAssetViewerUtils.waitForAssetLoad(page, singleAsset); - - await memoryAssetViewerUtils.expectPreviousButtonVisible(page); - await memoryAssetViewerUtils.expectNextButtonVisible(page); - }); -}); diff --git a/e2e/src/web/specs/memory/utils.ts b/e2e/src/web/specs/memory/utils.ts deleted file mode 100644 index cf99033e7e..0000000000 --- a/e2e/src/web/specs/memory/utils.ts +++ /dev/null @@ -1,123 +0,0 @@ -import type { AssetResponseDto } from '@immich/sdk'; -import { expect, Page } from '@playwright/test'; - -function getAssetIdFromUrl(url: URL): string | null { - const pathMatch = url.pathname.match(/\/memory\/photos\/([^/]+)/); - if (pathMatch) { - return pathMatch[1]; - } - return url.searchParams.get('id'); -} - -export const memoryViewerUtils = { - locator(page: Page) { - return page.locator('#memory-viewer'); - }, - - async waitForMemoryLoad(page: Page) { - await expect(this.locator(page)).toBeVisible(); - await expect(page.locator('#memory-viewer img').first()).toBeVisible(); - }, - - async openMemoryPage(page: Page) { - await page.goto('/memory'); - await this.waitForMemoryLoad(page); - }, - - async openMemoryPageWithAsset(page: Page, assetId: string) { - await page.goto(`/memory?id=${assetId}`); - await this.waitForMemoryLoad(page); - }, -}; - -export const memoryGalleryUtils = { - locator(page: Page) { - return page.locator('#gallery-memory'); - }, - - thumbnailWithAssetId(page: Page, assetId: string) { - return page.locator(`#gallery-memory [data-thumbnail-focus-container][data-asset="${assetId}"]`); - }, - - async scrollToGallery(page: Page) { - const showGalleryButton = page.getByLabel('Show gallery'); - if (await showGalleryButton.isVisible()) { - await showGalleryButton.click(); - } - await expect(this.locator(page)).toBeInViewport(); - }, - - async clickThumbnail(page: Page, assetId: string) { - await this.scrollToGallery(page); - await this.thumbnailWithAssetId(page, assetId).click(); - }, - - async getAllThumbnails(page: Page) { - await this.scrollToGallery(page); - return page.locator('#gallery-memory [data-thumbnail-focus-container]'); - }, -}; - -export const memoryAssetViewerUtils = { - locator(page: Page) { - return page.locator('#immich-asset-viewer'); - }, - - async waitForViewerOpen(page: Page) { - await expect(this.locator(page)).toBeVisible(); - }, - - async waitForAssetLoad(page: Page, asset: AssetResponseDto) { - const viewer = this.locator(page); - const imgLocator = viewer.locator(`img[draggable="false"][src*="/api/assets/${asset.id}/thumbnail?size=preview"]`); - const videoLocator = viewer.locator(`video[poster*="/api/assets/${asset.id}/thumbnail?size=preview"]`); - - await imgLocator.or(videoLocator).waitFor({ timeout: 10_000 }); - }, - - nextButton(page: Page) { - return page.getByLabel('View next asset'); - }, - - previousButton(page: Page) { - return page.getByLabel('View previous asset'); - }, - - async expectNextButtonVisible(page: Page) { - await expect(this.nextButton(page)).toBeVisible(); - }, - - async expectNextButtonNotVisible(page: Page) { - await expect(this.nextButton(page)).toHaveCount(0); - }, - - async expectPreviousButtonVisible(page: Page) { - await expect(this.previousButton(page)).toBeVisible(); - }, - - async expectPreviousButtonNotVisible(page: Page) { - await expect(this.previousButton(page)).toHaveCount(0); - }, - - async clickNextButton(page: Page) { - await this.nextButton(page).click(); - }, - - async clickPreviousButton(page: Page) { - await this.previousButton(page).click(); - }, - - async closeViewer(page: Page) { - await page.keyboard.press('Escape'); - await expect(this.locator(page)).not.toBeVisible(); - }, - - getCurrentAssetId(page: Page): string | null { - const url = new URL(page.url()); - return getAssetIdFromUrl(url); - }, - - async expectCurrentAssetId(page: Page, expectedAssetId: string) { - await expect.poll(() => this.getCurrentAssetId(page)).toBe(expectedAssetId); - }, -}; diff --git a/e2e/src/web/specs/photo-viewer.e2e-spec.ts b/e2e/src/web/specs/photo-viewer.e2e-spec.ts deleted file mode 100644 index 3f9bb4237a..0000000000 --- a/e2e/src/web/specs/photo-viewer.e2e-spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AssetMediaResponseDto, LoginResponseDto } from '@immich/sdk'; -import { Page, expect, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -function imageLocator(page: Page) { - return page.getByAltText('Image taken').locator('visible=true'); -} -test.describe('Photo Viewer', () => { - let admin: LoginResponseDto; - let asset: AssetMediaResponseDto; - let rawAsset: AssetMediaResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - asset = await utils.createAsset(admin.accessToken); - rawAsset = await utils.createAsset(admin.accessToken, { assetData: { filename: 'test.arw' } }); - }); - - test.beforeEach(async ({ context, page }) => { - // before each test, login as user - await utils.setAuthCookies(context, admin.accessToken); - await page.waitForLoadState('networkidle'); - }); - - test('loads original photo when zoomed', async ({ page }) => { - await page.goto(`/photos/${asset.id}`); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).toContain('thumbnail'); - const box = await imageLocator(page).boundingBox(); - expect(box).toBeTruthy(); - const { x, y, width, height } = box!; - await page.mouse.move(x + width / 2, y + height / 2); - await page.mouse.wheel(0, -1); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).toContain('original'); - }); - - test('loads fullsize image when zoomed and original is web-incompatible', async ({ page }) => { - await page.goto(`/photos/${rawAsset.id}`); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).toContain('thumbnail'); - const box = await imageLocator(page).boundingBox(); - expect(box).toBeTruthy(); - const { x, y, width, height } = box!; - await page.mouse.move(x + width / 2, y + height / 2); - await page.mouse.wheel(0, -1); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).toContain('fullsize'); - }); - - test('reloads photo when checksum changes', async ({ page }) => { - await page.goto(`/photos/${asset.id}`); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).toContain('thumbnail'); - const initialSrc = await imageLocator(page).getAttribute('src'); - await utils.replaceAsset(admin.accessToken, asset.id); - await expect.poll(async () => await imageLocator(page).getAttribute('src')).not.toBe(initialSrc); - }); -}); diff --git a/e2e/src/web/specs/search/search-gallery.ui-spec.ts b/e2e/src/web/specs/search/search-gallery.ui-spec.ts deleted file mode 100644 index e358bed154..0000000000 --- a/e2e/src/web/specs/search/search-gallery.ui-spec.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { faker } from '@faker-js/faker'; -import { expect, test } from '@playwright/test'; -import { - Changes, - createDefaultTimelineConfig, - generateTimelineData, - TimelineAssetConfig, - TimelineData, -} from 'src/generators/timeline'; -import { setupBaseMockApiRoutes } from 'src/mock-network/base-network'; -import { setupTimelineMockApiRoutes, TimelineTestContext } from 'src/mock-network/timeline-network'; -import { assetViewerUtils } from 'src/web/specs/timeline/utils'; - -const buildSearchUrl = (assetId: string) => { - const searchQuery = encodeURIComponent(JSON.stringify({ originalFileName: 'test' })); - return `/search/photos/${assetId}?query=${searchQuery}`; -}; - -test.describe.configure({ mode: 'parallel' }); -test.describe('search gallery-viewer', () => { - let adminUserId: string; - let timelineRestData: TimelineData; - const assets: TimelineAssetConfig[] = []; - const testContext = new TimelineTestContext(); - const changes: Changes = { - albumAdditions: [], - assetDeletions: [], - assetArchivals: [], - assetFavorites: [], - }; - - test.beforeAll(async () => { - adminUserId = faker.string.uuid(); - testContext.adminId = adminUserId; - timelineRestData = generateTimelineData({ ...createDefaultTimelineConfig(), ownerId: adminUserId }); - for (const timeBucket of timelineRestData.buckets.values()) { - assets.push(...timeBucket); - } - }); - - test.beforeEach(async ({ context }) => { - await setupBaseMockApiRoutes(context, adminUserId); - await setupTimelineMockApiRoutes(context, timelineRestData, changes, testContext); - - await context.route('**/api/search/metadata', async (route, request) => { - if (request.method() === 'POST') { - const searchAssets = assets.slice(0, 5).filter((asset) => !changes.assetDeletions.includes(asset.id)); - return route.fulfill({ - status: 200, - contentType: 'application/json', - json: { - albums: { total: 0, count: 0, items: [], facets: [] }, - assets: { - total: searchAssets.length, - count: searchAssets.length, - items: searchAssets, - facets: [], - nextPage: null, - }, - }, - }); - } - await route.fallback(); - }); - }); - - test.afterEach(() => { - testContext.slowBucket = false; - changes.albumAdditions = []; - changes.assetDeletions = []; - changes.assetArchivals = []; - changes.assetFavorites = []; - }); - - test.describe('/search/photos/:id', () => { - test('Deleting a photo advances to the next photo', async ({ page }) => { - const asset = assets[0]; - await page.goto(buildSearchUrl(asset.id)); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[1]); - }); - - test('Deleting two photos in a row advances to the next photo each time', async ({ page }) => { - const asset = assets[0]; - await page.goto(buildSearchUrl(asset.id)); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[1]); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[2]); - }); - - test('Navigating backward then deleting advances to the next photo', async ({ page }) => { - const asset = assets[1]; - await page.goto(buildSearchUrl(asset.id)); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('View previous asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[0]); - await page.getByLabel('View next asset').click(); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[2]); - }); - - test('Deleting the last photo advances to the previous photo', async ({ page }) => { - const lastAsset = assets[4]; - await page.goto(buildSearchUrl(lastAsset.id)); - await assetViewerUtils.waitForViewerLoad(page, lastAsset); - await expect(page.getByLabel('View next asset')).toHaveCount(0); - await page.getByLabel('Delete').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[3]); - await expect(page.getByLabel('View previous asset')).toBeVisible(); - }); - }); -}); diff --git a/e2e/src/web/specs/shared-link.e2e-spec.ts b/e2e/src/web/specs/shared-link.e2e-spec.ts deleted file mode 100644 index 017bc0fcb2..0000000000 --- a/e2e/src/web/specs/shared-link.e2e-spec.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { - AlbumResponseDto, - AssetMediaResponseDto, - LoginResponseDto, - SharedLinkResponseDto, - SharedLinkType, - createAlbum, -} from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { asBearerAuth, utils } from 'src/utils'; - -test.describe('Shared Links', () => { - let admin: LoginResponseDto; - let asset: AssetMediaResponseDto; - let album: AlbumResponseDto; - let sharedLink: SharedLinkResponseDto; - let sharedLinkPassword: SharedLinkResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - asset = await utils.createAsset(admin.accessToken); - album = await createAlbum( - { - createAlbumDto: { - albumName: 'Test Album', - assetIds: [asset.id], - }, - }, - { headers: asBearerAuth(admin.accessToken) }, - ); - sharedLink = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Album, - albumId: album.id, - }); - sharedLinkPassword = await utils.createSharedLink(admin.accessToken, { - type: SharedLinkType.Album, - albumId: album.id, - password: 'test-password', - }); - }); - - test('download from a shared link', async ({ page }) => { - await page.goto(`/share/${sharedLink.key}`); - await page.getByRole('heading', { name: 'Test Album' }).waitFor(); - await page.locator(`[data-asset-id="${asset.id}"]`).hover(); - await page.waitForSelector('[data-group] svg'); - await page.getByRole('checkbox').click(); - await Promise.all([page.waitForEvent('download'), page.getByRole('button', { name: 'Download' }).click()]); - }); - - test('download all from shared link', async ({ page }) => { - await page.goto(`/share/${sharedLink.key}`); - await page.getByRole('heading', { name: 'Test Album' }).waitFor(); - await Promise.all([page.waitForEvent('download'), page.getByRole('button', { name: 'Download' }).click()]); - }); - - test('enter password for a shared link', async ({ page }) => { - await page.goto(`/share/${sharedLinkPassword.key}`); - await page.getByPlaceholder('Password').fill('test-password'); - await page.getByRole('button', { name: 'Submit' }).click(); - await page.getByRole('heading', { name: 'Test Album' }).waitFor(); - }); - - test('show-password button visible', async ({ page }) => { - await page.goto(`/share/${sharedLinkPassword.key}`); - await page.getByPlaceholder('Password').fill('test-password'); - await page.getByRole('button', { name: 'Show password' }).waitFor(); - }); - - test('view password for shared link', async ({ page }) => { - await page.goto(`/share/${sharedLinkPassword.key}`); - const input = page.getByPlaceholder('Password'); - await input.fill('test-password'); - await page.getByRole('button', { name: 'Show password' }).click(); - // await page.getByText('test-password', { exact: true }).waitFor(); - await expect(input).toHaveAttribute('type', 'text'); - }); - - test('hide-password button visible', async ({ page }) => { - await page.goto(`/share/${sharedLinkPassword.key}`); - const input = page.getByPlaceholder('Password'); - await input.fill('test-password'); - await page.getByRole('button', { name: 'Show password' }).click(); - await page.getByRole('button', { name: 'Hide password' }).waitFor(); - }); - - test('hide password for shared link', async ({ page }) => { - await page.goto(`/share/${sharedLinkPassword.key}`); - const input = page.getByPlaceholder('Password'); - await input.fill('test-password'); - await page.getByRole('button', { name: 'Show password' }).click(); - await page.getByRole('button', { name: 'Hide password' }).click(); - await expect(input).toHaveAttribute('type', 'password'); - }); - - test('show error for invalid shared link', async ({ page }) => { - await page.goto('/share/invalid'); - await page.getByRole('heading', { name: 'Invalid share key' }).waitFor(); - }); - - test('auth on navigation from shared link to timeline', async ({ context, page }) => { - await utils.setAuthCookies(context, admin.accessToken); - - await page.goto(`/share/${sharedLink.key}`); - await page.getByRole('heading', { name: 'Test Album' }).waitFor(); - - await page.locator('a[href="/"]').click(); - await page.waitForURL('/photos'); - await page.locator(`[data-asset-id="${asset.id}"]`).waitFor(); - }); -}); diff --git a/e2e/src/web/specs/timeline/timeline.ui-spec.ts b/e2e/src/web/specs/timeline/timeline.ui-spec.ts deleted file mode 100644 index 47026e2cd4..0000000000 --- a/e2e/src/web/specs/timeline/timeline.ui-spec.ts +++ /dev/null @@ -1,862 +0,0 @@ -import { faker } from '@faker-js/faker'; -import { expect, test } from '@playwright/test'; -import { DateTime } from 'luxon'; -import { - Changes, - createDefaultTimelineConfig, - generateTimelineData, - getAsset, - getMockAsset, - SeededRandom, - selectRandom, - selectRandomMultiple, - TimelineAssetConfig, - TimelineData, -} from 'src/generators/timeline'; -import { setupBaseMockApiRoutes } from 'src/mock-network/base-network'; -import { pageRoutePromise, setupTimelineMockApiRoutes, TimelineTestContext } from 'src/mock-network/timeline-network'; -import { utils } from 'src/utils'; -import { - assetViewerUtils, - padYearMonth, - pageUtils, - poll, - thumbnailUtils, - timelineUtils, -} from 'src/web/specs/timeline/utils'; - -test.describe.configure({ mode: 'parallel' }); -test.describe('Timeline', () => { - let adminUserId: string; - let timelineRestData: TimelineData; - const assets: TimelineAssetConfig[] = []; - const yearMonths: string[] = []; - const testContext = new TimelineTestContext(); - const changes: Changes = { - albumAdditions: [], - assetDeletions: [], - assetArchivals: [], - assetFavorites: [], - }; - - test.beforeAll(async () => { - test.fail( - process.env.PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS !== '1', - 'This test requires env var: PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1', - ); - utils.initSdk(); - adminUserId = faker.string.uuid(); - testContext.adminId = adminUserId; - timelineRestData = generateTimelineData({ ...createDefaultTimelineConfig(), ownerId: adminUserId }); - for (const timeBucket of timelineRestData.buckets.values()) { - assets.push(...timeBucket); - } - for (const yearMonth of timelineRestData.buckets.keys()) { - const [year, month] = yearMonth.split('-'); - yearMonths.push(`${year}-${Number(month)}`); - } - }); - - test.beforeEach(async ({ context }) => { - await setupBaseMockApiRoutes(context, adminUserId); - await setupTimelineMockApiRoutes(context, timelineRestData, changes, testContext); - }); - - test.afterEach(() => { - testContext.slowBucket = false; - changes.albumAdditions = []; - changes.assetDeletions = []; - changes.assetArchivals = []; - changes.assetFavorites = []; - }); - - test.describe('/photos', () => { - test('Open /photos', async ({ page }) => { - await page.goto(`/photos`); - await page.waitForSelector('#asset-grid'); - await thumbnailUtils.expectTimelineHasOnScreenAssets(page); - }); - test('Deep link to last photo', async ({ page }) => { - const lastAsset = assets.at(-1)!; - await pageUtils.deepLinkPhotosPage(page, lastAsset.id); - await thumbnailUtils.expectTimelineHasOnScreenAssets(page); - await thumbnailUtils.expectInViewport(page, lastAsset.id); - }); - const rng = new SeededRandom(529); - for (let i = 0; i < 10; i++) { - test('Deep link to random asset ' + i, async ({ page }) => { - const asset = selectRandom(assets, rng); - await pageUtils.deepLinkPhotosPage(page, asset.id); - await thumbnailUtils.expectTimelineHasOnScreenAssets(page); - await thumbnailUtils.expectInViewport(page, asset.id); - }); - } - test('Open /photos, open asset-viewer, browser back', async ({ page }) => { - const rng = new SeededRandom(22); - const asset = selectRandom(assets, rng); - await pageUtils.deepLinkPhotosPage(page, asset.id); - const scrollTopBefore = await timelineUtils.getScrollTop(page); - await thumbnailUtils.clickAssetId(page, asset.id); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.goBack(); - await timelineUtils.locator(page).waitFor(); - const scrollTopAfter = await timelineUtils.getScrollTop(page); - expect(scrollTopAfter).toBe(scrollTopBefore); - }); - test('Open /photos, open asset-viewer, next photo, browser back, back', async ({ page }) => { - const rng = new SeededRandom(49); - const asset = selectRandom(assets, rng); - const assetIndex = assets.indexOf(asset); - const nextAsset = assets[assetIndex + 1]; - await pageUtils.deepLinkPhotosPage(page, asset.id); - const scrollTopBefore = await timelineUtils.getScrollTop(page); - await thumbnailUtils.clickAssetId(page, asset.id); - await assetViewerUtils.waitForViewerLoad(page, asset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${asset.id}`); - await page.getByLabel('View next asset').click(); - await assetViewerUtils.waitForViewerLoad(page, nextAsset); - await expect.poll(() => new URL(page.url()).pathname).toBe(`/photos/${nextAsset.id}`); - await page.goBack(); - await assetViewerUtils.waitForViewerLoad(page, asset); - await page.goBack(); - await page.waitForURL('**/photos?at=*'); - const scrollTopAfter = await timelineUtils.getScrollTop(page); - expect(Math.abs(scrollTopAfter - scrollTopBefore)).toBeLessThan(5); - }); - test('Open /photos, open asset-viewer, next photo 15x, backwardsArrow', async ({ page }) => { - await pageUtils.deepLinkPhotosPage(page, assets[0].id); - await thumbnailUtils.clickAssetId(page, assets[0].id); - await assetViewerUtils.waitForViewerLoad(page, assets[0]); - for (let i = 1; i <= 15; i++) { - await page.getByLabel('View next asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets[i]); - } - await page.getByLabel('Go back').click(); - await page.waitForURL('**/photos?at=*'); - await thumbnailUtils.expectInViewport(page, assets[15].id); - await thumbnailUtils.expectBottomIsTimelineBottom(page, assets[15]!.id); - }); - test('Open /photos, open asset-viewer, previous photo 15x, backwardsArrow', async ({ page }) => { - const lastAsset = assets.at(-1)!; - await pageUtils.deepLinkPhotosPage(page, lastAsset.id); - await thumbnailUtils.clickAssetId(page, lastAsset.id); - await assetViewerUtils.waitForViewerLoad(page, lastAsset); - for (let i = 1; i <= 15; i++) { - await page.getByLabel('View previous asset').click(); - await assetViewerUtils.waitForViewerLoad(page, assets.at(-1 - i)!); - } - await page.getByLabel('Go back').click(); - await page.waitForURL('**/photos?at=*'); - await thumbnailUtils.expectInViewport(page, assets.at(-1 - 15)!.id); - await thumbnailUtils.expectTopIsTimelineTop(page, assets.at(-1 - 15)!.id); - }); - }); - test.describe('keyboard', () => { - /** - * This text tests keyboard nativation, and also ensures that the scroll-to-asset behavior - * scrolls the minimum amount. That is, if you are navigating using right arrow (auto scrolling - * as necessary downwards), then the asset should always be at the lowest row of the grid. - */ - test('Next/previous asset - ArrowRight/ArrowLeft', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await thumbnailUtils.withAssetId(page, assets[0].id).focus(); - const rightKey = 'ArrowRight'; - const leftKey = 'ArrowLeft'; - for (let i = 1; i < 15; i++) { - await page.keyboard.press(rightKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - for (let i = 15; i <= 20; i++) { - await page.keyboard.press(rightKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - expect(await thumbnailUtils.expectBottomIsTimelineBottom(page, assets.at(i)!.id)); - } - // now test previous asset - for (let i = 19; i >= 15; i--) { - await page.keyboard.press(leftKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - for (let i = 14; i > 0; i--) { - await page.keyboard.press(leftKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - expect(await thumbnailUtils.expectTopIsTimelineTop(page, assets.at(i)!.id)); - } - }); - test('Next/previous asset - Tab/Shift+Tab', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await thumbnailUtils.withAssetId(page, assets[0].id).focus(); - const rightKey = 'Tab'; - const leftKey = 'Shift+Tab'; - for (let i = 1; i < 15; i++) { - await page.keyboard.press(rightKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - for (let i = 15; i <= 20; i++) { - await page.keyboard.press(rightKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - // now test previous asset - for (let i = 19; i >= 15; i--) { - await page.keyboard.press(leftKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - for (let i = 14; i > 0; i--) { - await page.keyboard.press(leftKey); - await assetViewerUtils.expectActiveAssetToBe(page, assets[i].id); - } - }); - test('Next/previous day - d, Shift+D', async ({ page }) => { - await pageUtils.openPhotosPage(page); - let asset = assets[0]; - await timelineUtils.locator(page).hover(); - await page.keyboard.press('d'); - await assetViewerUtils.expectActiveAssetToBe(page, asset.id); - for (let i = 0; i < 15; i++) { - await page.keyboard.press('d'); - const next = getMockAsset(asset, assets, 'next', 'day')!; - await assetViewerUtils.expectActiveAssetToBe(page, next.id); - asset = next; - } - for (let i = 0; i < 15; i++) { - await page.keyboard.press('Shift+D'); - const previous = getMockAsset(asset, assets, 'previous', 'day')!; - await assetViewerUtils.expectActiveAssetToBe(page, previous.id); - asset = previous; - } - }); - test('Next/previous month - m, Shift+M', async ({ page }) => { - await pageUtils.openPhotosPage(page); - let asset = assets[0]; - await timelineUtils.locator(page).hover(); - await page.keyboard.press('m'); - await assetViewerUtils.expectActiveAssetToBe(page, asset.id); - for (let i = 0; i < 15; i++) { - await page.keyboard.press('m'); - const next = getMockAsset(asset, assets, 'next', 'month')!; - await assetViewerUtils.expectActiveAssetToBe(page, next.id); - asset = next; - } - for (let i = 0; i < 15; i++) { - await page.keyboard.press('Shift+M'); - const previous = getMockAsset(asset, assets, 'previous', 'month')!; - await assetViewerUtils.expectActiveAssetToBe(page, previous.id); - asset = previous; - } - }); - test('Next/previous year - y, Shift+Y', async ({ page }) => { - await pageUtils.openPhotosPage(page); - let asset = assets[0]; - await timelineUtils.locator(page).hover(); - await page.keyboard.press('y'); - await assetViewerUtils.expectActiveAssetToBe(page, asset.id); - for (let i = 0; i < 15; i++) { - await page.keyboard.press('y'); - const next = getMockAsset(asset, assets, 'next', 'year')!; - await assetViewerUtils.expectActiveAssetToBe(page, next.id); - asset = next; - } - for (let i = 0; i < 15; i++) { - await page.keyboard.press('Shift+Y'); - const previous = getMockAsset(asset, assets, 'previous', 'year')!; - await assetViewerUtils.expectActiveAssetToBe(page, previous.id); - asset = previous; - } - }); - test('Navigate to time - g', async ({ page }) => { - const rng = new SeededRandom(4782); - await pageUtils.openPhotosPage(page); - for (let i = 0; i < 10; i++) { - const asset = selectRandom(assets, rng); - await pageUtils.goToAsset(page, asset.fileCreatedAt); - await thumbnailUtils.expectInViewport(page, asset.id); - } - }); - }); - test.describe('selection', () => { - test('Select day, unselect day', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await pageUtils.selectDay(page, 'Wed, Dec 11, 2024'); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(4); - await pageUtils.selectDay(page, 'Wed, Dec 11, 2024'); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(0); - }); - test('Select asset, click asset to select', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await thumbnailUtils.withAssetId(page, assets[1].id).hover(); - await thumbnailUtils.selectButton(page, assets[1].id).click(); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(1); - // no need to hover, once selection is active - await thumbnailUtils.clickAssetId(page, assets[2].id); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(2); - }); - test('Select asset, click unselect asset', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await thumbnailUtils.withAssetId(page, assets[1].id).hover(); - await thumbnailUtils.selectButton(page, assets[1].id).click(); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(1); - await thumbnailUtils.clickAssetId(page, assets[1].id); - // the hover uses a checked button too, so just move mouse away - await page.mouse.move(0, 0); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(0); - }); - test('Select asset, shift-hover candidates, shift-click end', async ({ page }) => { - await pageUtils.openPhotosPage(page); - const asset = assets[0]; - await thumbnailUtils.withAssetId(page, asset.id).hover(); - await thumbnailUtils.selectButton(page, asset.id).click(); - await page.keyboard.down('Shift'); - await thumbnailUtils.withAssetId(page, assets[2].id).hover(); - await expect( - thumbnailUtils.locator(page).locator('.absolute.top-0.h-full.w-full.bg-immich-primary.opacity-40'), - ).toHaveCount(3); - await thumbnailUtils.selectButton(page, assets[2].id).click(); - await page.keyboard.up('Shift'); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(3); - }); - test('Add multiple to selection - Select day, shift-click end', async ({ page }) => { - await pageUtils.openPhotosPage(page); - await thumbnailUtils.withAssetId(page, assets[0].id).hover(); - await thumbnailUtils.selectButton(page, assets[0].id).click(); - await thumbnailUtils.clickAssetId(page, assets[2].id); - await page.keyboard.down('Shift'); - await thumbnailUtils.clickAssetId(page, assets[4].id); - await page.mouse.move(0, 0); - await expect(thumbnailUtils.selectedAsset(page)).toHaveCount(4); - }); - }); - test.describe('scroll', () => { - test('Open /photos, random click scrubber 20x', async ({ page }) => { - test.slow(); - await pageUtils.openPhotosPage(page); - const rng = new SeededRandom(6637); - const selectedMonths = selectRandomMultiple(yearMonths, 20, rng); - for (const month of selectedMonths) { - await page.locator(`[data-segment-year-month="${month}"]`).click({ force: true }); - const visibleMockAssetsYearMonths = await poll(page, async () => { - const assetIds = await thumbnailUtils.getAllInViewport( - page, - (assetId: string) => getYearMonth(assets, assetId) === month, - ); - const visibleMockAssetsYearMonths: string[] = []; - for (const assetId of assetIds!) { - const yearMonth = getYearMonth(assets, assetId); - visibleMockAssetsYearMonths.push(yearMonth); - if (yearMonth === month) { - return [yearMonth]; - } - } - }); - if (page.isClosed()) { - return; - } - expect(visibleMockAssetsYearMonths).toContain(month); - } - }); - test('Deep link to last photo, scroll up', async ({ page }) => { - const lastAsset = assets.at(-1)!; - await pageUtils.deepLinkPhotosPage(page, lastAsset.id); - - await timelineUtils.locator(page).hover(); - for (let i = 0; i < 100; i++) { - await page.mouse.wheel(0, -100); - await page.waitForTimeout(25); - } - - await thumbnailUtils.expectInViewport(page, '14e5901f-fd7f-40c0-b186-4d7e7fc67968'); - }); - test('Deep link to first bucket, scroll down', async ({ page }) => { - const lastAsset = assets.at(0)!; - await pageUtils.deepLinkPhotosPage(page, lastAsset.id); - await timelineUtils.locator(page).hover(); - for (let i = 0; i < 100; i++) { - await page.mouse.wheel(0, 100); - await page.waitForTimeout(25); - } - await thumbnailUtils.expectInViewport(page, 'b7983a13-4b4e-4950-a731-f2962d9a1555'); - }); - test('Deep link to last photo, drag scrubber to scroll up', async ({ page }) => { - const lastAsset = assets.at(-1)!; - await pageUtils.deepLinkPhotosPage(page, lastAsset.id); - const lastMonth = yearMonths.at(-1); - const firstScrubSegment = page.locator(`[data-segment-year-month="${yearMonths[0]}"]`); - const lastScrubSegment = page.locator(`[data-segment-year-month="${lastMonth}"]`); - const sourcebox = (await lastScrubSegment.boundingBox())!; - const targetBox = (await firstScrubSegment.boundingBox())!; - await firstScrubSegment.hover(); - const currentY = sourcebox.y; - await page.mouse.move(sourcebox.x + sourcebox?.width / 2, currentY); - await page.mouse.down(); - await page.mouse.move(sourcebox.x + sourcebox?.width / 2, targetBox.y, { steps: 100 }); - await page.mouse.up(); - await thumbnailUtils.expectInViewport(page, assets[0].id); - }); - test('Deep link to first bucket, drag scrubber to scroll down', async ({ page }) => { - await pageUtils.deepLinkPhotosPage(page, assets[0].id); - const firstScrubSegment = page.locator(`[data-segment-year-month="${yearMonths[0]}"]`); - const sourcebox = (await firstScrubSegment.boundingBox())!; - await firstScrubSegment.hover(); - const currentY = sourcebox.y; - await page.mouse.move(sourcebox.x + sourcebox?.width / 2, currentY); - await page.mouse.down(); - const height = page.viewportSize()?.height; - expect(height).toBeDefined(); - await page.mouse.move(sourcebox.x + sourcebox?.width / 2, height! - 10, { - steps: 100, - }); - await page.mouse.up(); - await thumbnailUtils.expectInViewport(page, assets.at(-1)!.id); - }); - test('Buckets cancel on scroll', async ({ page }) => { - await pageUtils.openPhotosPage(page); - testContext.slowBucket = true; - const failedUris: string[] = []; - page.on('requestfailed', (request) => { - failedUris.push(request.url()); - }); - const offscreenSegment = page.locator(`[data-segment-year-month="${yearMonths[12]}"]`); - await offscreenSegment.click({ force: true }); - const lastSegment = page.locator(`[data-segment-year-month="${yearMonths.at(-1)!}"]`); - await lastSegment.click({ force: true }); - const uris = await poll(page, async () => (failedUris.length > 0 ? failedUris : null)); - expect(uris).toEqual(expect.arrayContaining([expect.stringContaining(padYearMonth(yearMonths[12]!))])); - }); - }); - test.describe('/albums', () => { - test('Open album', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - await thumbnailUtils.expectInViewport(page, album.assetIds[0]); - }); - test('Deep link to last photo', async ({ page }) => { - const album = timelineRestData.album; - const lastAsset = album.assetIds.at(-1); - await pageUtils.deepLinkAlbumPage(page, album.id, lastAsset!); - await thumbnailUtils.expectInViewport(page, album.assetIds.at(-1)!); - await thumbnailUtils.expectBottomIsTimelineBottom(page, album.assetIds.at(-1)!); - }); - test('Add photos to album pre-selects existing', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - await page.getByLabel('Add photos').click(); - const asset = getAsset(timelineRestData, album.assetIds[0])!; - await pageUtils.goToAsset(page, asset.fileCreatedAt); - await thumbnailUtils.expectInViewport(page, asset.id); - await thumbnailUtils.expectSelectedReadonly(page, asset.id); - }); - test('Add photos to album', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - await page.locator('nav button[aria-label="Add photos"]').click(); - const asset = getAsset(timelineRestData, album.assetIds[0])!; - await pageUtils.goToAsset(page, asset.fileCreatedAt); - await thumbnailUtils.expectInViewport(page, asset.id); - await thumbnailUtils.expectSelectedReadonly(page, asset.id); - await pageUtils.selectDay(page, 'Tue, Feb 27, 2024'); - const put = pageRoutePromise(page, `**/api/albums/${album.id}/assets`, async (route, request) => { - const requestJson = request.postDataJSON(); - await route.fulfill({ - status: 200, - contentType: 'application/json', - json: requestJson.ids.map((id: string) => ({ id, success: true })), - }); - changes.albumAdditions.push(...requestJson.ids); - }); - await page.getByText('Add assets').click(); - await expect(put).resolves.toEqual({ - ids: [ - 'c077ea7b-cfa1-45e4-8554-f86c00ee5658', - '040fd762-dbbc-486d-a51a-2d84115e6229', - '86af0b5f-79d3-4f75-bab3-3b61f6c72b23', - ], - }); - const addedAsset = getAsset(timelineRestData, 'c077ea7b-cfa1-45e4-8554-f86c00ee5658')!; - await pageUtils.goToAsset(page, addedAsset.fileCreatedAt); - await thumbnailUtils.expectInViewport(page, 'c077ea7b-cfa1-45e4-8554-f86c00ee5658'); - await thumbnailUtils.expectInViewport(page, '040fd762-dbbc-486d-a51a-2d84115e6229'); - await thumbnailUtils.expectInViewport(page, '86af0b5f-79d3-4f75-bab3-3b61f6c72b23'); - }); - }); - test.describe('/trash', () => { - test('open /photos, trash photo, open /trash, restore', async ({ page }) => { - await pageUtils.openPhotosPage(page); - const assetToTrash = assets[0]; - await thumbnailUtils.withAssetId(page, assetToTrash.id).hover(); - await thumbnailUtils.selectButton(page, assetToTrash.id).click(); - await page.getByLabel('Menu').click(); - const deleteRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - changes.assetDeletions.push(...requestJson.ids); - await route.fulfill({ - status: 200, - contentType: 'application/json', - json: requestJson.ids.map((id: string) => ({ id, success: true })), - }); - }); - await page.getByRole('menuitem').getByText('Delete').click(); - await expect(deleteRequest).resolves.toEqual({ - force: false, - ids: [assetToTrash.id], - }); - await page.getByText('Trash', { exact: true }).click(); - await thumbnailUtils.expectInViewport(page, assetToTrash.id); - await thumbnailUtils.withAssetId(page, assetToTrash.id).hover(); - await thumbnailUtils.selectButton(page, assetToTrash.id).click(); - const restoreRequest = pageRoutePromise(page, '**/api/trash/restore/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - changes.assetDeletions = changes.assetDeletions.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 200, - contentType: 'application/json', - json: { count: requestJson.ids.length }, - }); - }); - await page.getByText('Restore', { exact: true }).click(); - await expect(restoreRequest).resolves.toEqual({ - ids: [assetToTrash.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToTrash.id)).toHaveCount(0); - await page.getByText('Photos', { exact: true }).click(); - await thumbnailUtils.expectInViewport(page, assetToTrash.id); - }); - test('open album, trash photo, open /trash, restore', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - const assetToTrash = getAsset(timelineRestData, album.assetIds[0])!; - await thumbnailUtils.withAssetId(page, assetToTrash.id).hover(); - await thumbnailUtils.selectButton(page, assetToTrash.id).click(); - await page.getByLabel('Menu').click(); - const deleteRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - changes.assetDeletions.push(...requestJson.ids); - await route.fulfill({ - status: 200, - contentType: 'application/json', - json: requestJson.ids.map((id: string) => ({ id, success: true })), - }); - }); - await page.getByRole('menuitem').getByText('Delete').click(); - await expect(deleteRequest).resolves.toEqual({ - force: false, - ids: [assetToTrash.id], - }); - await page.locator('#asset-selection-app-bar').getByLabel('Close').click(); - await page.getByText('Trash', { exact: true }).click(); - await timelineUtils.waitForTimelineLoad(page); - await thumbnailUtils.expectInViewport(page, assetToTrash.id); - await thumbnailUtils.withAssetId(page, assetToTrash.id).hover(); - await thumbnailUtils.selectButton(page, assetToTrash.id).click(); - const restoreRequest = pageRoutePromise(page, '**/api/trash/restore/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - changes.assetDeletions = changes.assetDeletions.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 200, - contentType: 'application/json', - json: { count: requestJson.ids.length }, - }); - }); - await page.getByText('Restore', { exact: true }).click(); - await expect(restoreRequest).resolves.toEqual({ - ids: [assetToTrash.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToTrash.id)).toHaveCount(0); - await pageUtils.openAlbumPage(page, album.id); - await thumbnailUtils.expectInViewport(page, assetToTrash.id); - }); - }); - test.describe('/archive', () => { - test('open /photos, archive photo, open /archive, unarchive', async ({ page }) => { - await pageUtils.openPhotosPage(page); - const assetToArchive = assets[0]; - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - await page.getByLabel('Menu').click(); - const archive = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'archive') { - return await route.continue(); - } - await route.fulfill({ - status: 204, - }); - changes.assetArchivals.push(...requestJson.ids); - }); - await page.getByRole('menuitem').getByText('Archive').click(); - await expect(archive).resolves.toEqual({ - visibility: 'archive', - ids: [assetToArchive.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToArchive.id)).toHaveCount(0); - await page.getByRole('link').getByText('Archive').click(); - await thumbnailUtils.expectInViewport(page, assetToArchive.id); - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - const unarchiveRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'timeline') { - return await route.continue(); - } - changes.assetArchivals = changes.assetArchivals.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Unarchive').click(); - await expect(unarchiveRequest).resolves.toEqual({ - visibility: 'timeline', - ids: [assetToArchive.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToArchive.id)).toHaveCount(0); - await page.getByText('Photos', { exact: true }).click(); - await thumbnailUtils.expectInViewport(page, assetToArchive.id); - }); - test('open /archive, favorite photo, unfavorite', async ({ page }) => { - const assetToFavorite = assets[0]; - changes.assetArchivals.push(assetToFavorite.id); - await pageUtils.openArchivePage(page); - const favorite = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - const isFavorite = requestJson.isFavorite; - if (isFavorite) { - changes.assetFavorites.push(...requestJson.ids); - } - await route.fulfill({ - status: 204, - }); - }); - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - await page.getByLabel('Favorite').click(); - await expect(favorite).resolves.toEqual({ - isFavorite: true, - ids: [assetToFavorite.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToFavorite.id)).toHaveCount(1); - await thumbnailUtils.expectInViewport(page, assetToFavorite.id); - await thumbnailUtils.expectThumbnailIsFavorite(page, assetToFavorite.id); - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - const unFavoriteRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - changes.assetFavorites = changes.assetFavorites.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Remove from favorites').click(); - await expect(unFavoriteRequest).resolves.toEqual({ - isFavorite: false, - ids: [assetToFavorite.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToFavorite.id)).toHaveCount(1); - await thumbnailUtils.expectThumbnailIsNotFavorite(page, assetToFavorite.id); - }); - test('open album, archive photo, open album, unarchive', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - const assetToArchive = getAsset(timelineRestData, album.assetIds[0])!; - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - await page.getByLabel('Menu').click(); - const archive = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'archive') { - return await route.continue(); - } - changes.assetArchivals.push(...requestJson.ids); - await route.fulfill({ - status: 204, - }); - }); - await page.getByRole('menuitem').getByText('Archive').click(); - await expect(archive).resolves.toEqual({ - visibility: 'archive', - ids: [assetToArchive.id], - }); - await thumbnailUtils.expectThumbnailIsArchive(page, assetToArchive.id); - await page.locator('#asset-selection-app-bar').getByLabel('Close').click(); - await page.getByRole('link').getByText('Archive').click(); - await timelineUtils.waitForTimelineLoad(page); - await thumbnailUtils.expectInViewport(page, assetToArchive.id); - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - const unarchiveRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'timeline') { - return await route.continue(); - } - changes.assetArchivals = changes.assetArchivals.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Unarchive').click(); - await expect(unarchiveRequest).resolves.toEqual({ - visibility: 'timeline', - ids: [assetToArchive.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToArchive.id)).toHaveCount(0); - await pageUtils.openAlbumPage(page, album.id); - await thumbnailUtils.expectInViewport(page, assetToArchive.id); - }); - }); - test.describe('/favorite', () => { - test('open /photos, favorite photo, open /favorites, remove favorite, open /photos', async ({ page }) => { - await pageUtils.openPhotosPage(page); - const assetToFavorite = assets[0]; - - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - const favorite = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - const isFavorite = requestJson.isFavorite; - if (isFavorite) { - changes.assetFavorites.push(...requestJson.ids); - } - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Favorite').click(); - await expect(favorite).resolves.toEqual({ - isFavorite: true, - ids: [assetToFavorite.id], - }); - // ensure thumbnail still exists and has favorite icon - await thumbnailUtils.expectThumbnailIsFavorite(page, assetToFavorite.id); - await page.getByRole('link').getByText('Favorites').click(); - await thumbnailUtils.expectInViewport(page, assetToFavorite.id); - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - const unFavoriteRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - changes.assetFavorites = changes.assetFavorites.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Remove from favorites').click(); - await expect(unFavoriteRequest).resolves.toEqual({ - isFavorite: false, - ids: [assetToFavorite.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToFavorite.id)).toHaveCount(0); - await page.getByText('Photos', { exact: true }).click(); - await thumbnailUtils.expectInViewport(page, assetToFavorite.id); - }); - test('open /favorites, archive photo, unarchive photo', async ({ page }) => { - await pageUtils.openFavorites(page); - const assetToArchive = getAsset(timelineRestData, 'ad31e29f-2069-4574-b9a9-ad86523c92cb')!; - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - await page.getByLabel('Menu').click(); - const archive = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'archive') { - return await route.continue(); - } - await route.fulfill({ - status: 204, - }); - changes.assetArchivals.push(...requestJson.ids); - }); - await page.getByRole('menuitem').getByText('Archive').click(); - await expect(archive).resolves.toEqual({ - visibility: 'archive', - ids: [assetToArchive.id], - }); - await page.getByRole('link').getByText('Archive').click(); - await thumbnailUtils.expectInViewport(page, assetToArchive.id); - await thumbnailUtils.expectThumbnailIsNotArchive(page, assetToArchive.id); - await thumbnailUtils.withAssetId(page, assetToArchive.id).hover(); - await thumbnailUtils.selectButton(page, assetToArchive.id).click(); - const unarchiveRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.visibility !== 'timeline') { - return await route.continue(); - } - changes.assetArchivals = changes.assetArchivals.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Unarchive').click(); - await expect(unarchiveRequest).resolves.toEqual({ - visibility: 'timeline', - ids: [assetToArchive.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToArchive.id)).toHaveCount(0); - await thumbnailUtils.expectThumbnailIsNotArchive(page, assetToArchive.id); - }); - test('Open album, favorite photo, open /favorites, remove favorite, Open album', async ({ page }) => { - const album = timelineRestData.album; - await pageUtils.openAlbumPage(page, album.id); - const assetToFavorite = getAsset(timelineRestData, album.assetIds[0])!; - - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - const favorite = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - const isFavorite = requestJson.isFavorite; - if (isFavorite) { - changes.assetFavorites.push(...requestJson.ids); - } - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Favorite').click(); - await expect(favorite).resolves.toEqual({ - isFavorite: true, - ids: [assetToFavorite.id], - }); - // ensure thumbnail still exists and has favorite icon - await thumbnailUtils.expectThumbnailIsFavorite(page, assetToFavorite.id); - await page.locator('#asset-selection-app-bar').getByLabel('Close').click(); - await page.getByRole('link').getByText('Favorites').click(); - await timelineUtils.waitForTimelineLoad(page); - await pageUtils.goToAsset(page, assetToFavorite.fileCreatedAt); - await thumbnailUtils.expectInViewport(page, assetToFavorite.id); - await thumbnailUtils.withAssetId(page, assetToFavorite.id).hover(); - await thumbnailUtils.selectButton(page, assetToFavorite.id).click(); - const unFavoriteRequest = pageRoutePromise(page, '**/api/assets', async (route, request) => { - const requestJson = request.postDataJSON(); - if (requestJson.isFavorite === undefined) { - return await route.continue(); - } - changes.assetFavorites = changes.assetFavorites.filter((id) => !requestJson.ids.includes(id)); - await route.fulfill({ - status: 204, - }); - }); - await page.getByLabel('Remove from favorites').click(); - await expect(unFavoriteRequest).resolves.toEqual({ - isFavorite: false, - ids: [assetToFavorite.id], - }); - await expect(thumbnailUtils.withAssetId(page, assetToFavorite.id)).toHaveCount(0); - await pageUtils.openAlbumPage(page, album.id); - await thumbnailUtils.expectInViewport(page, assetToFavorite.id); - }); - }); -}); - -const getYearMonth = (assets: TimelineAssetConfig[], assetId: string) => { - const mockAsset = assets.find((mockAsset) => mockAsset.id === assetId)!; - const dateTime = DateTime.fromISO(mockAsset.fileCreatedAt!); - return dateTime.year + '-' + dateTime.month; -}; diff --git a/e2e/src/web/specs/timeline/utils.ts b/e2e/src/web/specs/timeline/utils.ts deleted file mode 100644 index 0f04bf9361..0000000000 --- a/e2e/src/web/specs/timeline/utils.ts +++ /dev/null @@ -1,228 +0,0 @@ -import { BrowserContext, expect, Page } from '@playwright/test'; -import { DateTime } from 'luxon'; -import { TimelineAssetConfig } from 'src/generators/timeline'; - -export const sleep = (ms: number) => { - return new Promise((resolve) => setTimeout(resolve, ms)); -}; - -export const padYearMonth = (yearMonth: string) => { - const [year, month] = yearMonth.split('-'); - return `${year}-${month.padStart(2, '0')}`; -}; - -export async function throttlePage(context: BrowserContext, page: Page) { - const session = await context.newCDPSession(page); - await session.send('Network.emulateNetworkConditions', { - offline: false, - downloadThroughput: (1.5 * 1024 * 1024) / 8, - uploadThroughput: (750 * 1024) / 8, - latency: 40, - connectionType: 'cellular3g', - }); - await session.send('Emulation.setCPUThrottlingRate', { rate: 10 }); -} - -export const poll = async ( - page: Page, - query: () => Promise, - callback?: (result: Awaited | undefined) => boolean, -) => { - let result; - const timeout = Date.now() + 10_000; - - const terminate = callback || ((result: Awaited | undefined) => !!result); - while (!terminate(result) && Date.now() < timeout) { - try { - result = await query(); - } catch { - // ignore - } - if (page.isClosed()) { - return; - } - try { - await page.waitForTimeout(50); - } catch { - return; - } - } - if (!result) { - // rerun to trigger error if any - result = await query(); - } - return result; -}; - -export const thumbnailUtils = { - locator(page: Page) { - return page.locator('[data-thumbnail-focus-container]'); - }, - withAssetId(page: Page, assetId: string) { - return page.locator(`[data-thumbnail-focus-container][data-asset="${assetId}"]`); - }, - selectButton(page: Page, assetId: string) { - return page.locator(`[data-thumbnail-focus-container][data-asset="${assetId}"] button`); - }, - selectedAsset(page: Page) { - return page.locator('[data-thumbnail-focus-container]:has(button[aria-checked])'); - }, - async clickAssetId(page: Page, assetId: string) { - await thumbnailUtils.withAssetId(page, assetId).click(); - }, - async queryThumbnailInViewport(page: Page, collector: (assetId: string) => boolean) { - const assetIds: string[] = []; - for (const thumb of await this.locator(page).all()) { - const box = await thumb.boundingBox(); - if (box) { - const assetId = await thumb.evaluate((e) => e.dataset.asset); - if (collector?.(assetId!)) { - return [assetId!]; - } - assetIds.push(assetId!); - } - } - return assetIds; - }, - async getFirstInViewport(page: Page) { - return await poll(page, () => thumbnailUtils.queryThumbnailInViewport(page, () => true)); - }, - async getAllInViewport(page: Page, collector: (assetId: string) => boolean) { - return await poll(page, () => thumbnailUtils.queryThumbnailInViewport(page, collector)); - }, - async expectThumbnailIsFavorite(page: Page, assetId: string) { - await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-favorite]')).toHaveCount(1); - }, - async expectThumbnailIsNotFavorite(page: Page, assetId: string) { - await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-favorite]')).toHaveCount(0); - }, - async expectThumbnailIsArchive(page: Page, assetId: string) { - await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-archive]')).toHaveCount(1); - }, - async expectThumbnailIsNotArchive(page: Page, assetId: string) { - await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-archive]')).toHaveCount(0); - }, - async expectSelectedReadonly(page: Page, assetId: string) { - // todo - need a data attribute for selected - await expect( - page.locator( - `[data-thumbnail-focus-container][data-asset="${assetId}"] > .group.cursor-not-allowed > .rounded-xl`, - ), - ).toBeVisible(); - }, - async expectTimelineHasOnScreenAssets(page: Page) { - const first = await thumbnailUtils.getFirstInViewport(page); - if (page.isClosed()) { - return; - } - expect(first).toBeTruthy(); - }, - async expectInViewport(page: Page, assetId: string) { - const box = await poll(page, () => thumbnailUtils.withAssetId(page, assetId).boundingBox()); - if (page.isClosed()) { - return; - } - expect(box).toBeTruthy(); - }, - async expectBottomIsTimelineBottom(page: Page, assetId: string) { - const box = await thumbnailUtils.withAssetId(page, assetId).boundingBox(); - const gridBox = await timelineUtils.locator(page).boundingBox(); - if (page.isClosed()) { - return; - } - expect(box!.y + box!.height).toBeCloseTo(gridBox!.y + gridBox!.height, 0); - }, - async expectTopIsTimelineTop(page: Page, assetId: string) { - const box = await thumbnailUtils.withAssetId(page, assetId).boundingBox(); - const gridBox = await timelineUtils.locator(page).boundingBox(); - if (page.isClosed()) { - return; - } - expect(box!.y).toBeCloseTo(gridBox!.y, 0); - }, -}; -export const timelineUtils = { - locator(page: Page) { - return page.locator('#asset-grid'); - }, - async waitForTimelineLoad(page: Page) { - await expect(timelineUtils.locator(page)).toBeInViewport(); - await expect.poll(() => thumbnailUtils.locator(page).count()).toBeGreaterThan(0); - }, - async getScrollTop(page: Page) { - const queryTop = () => - page.evaluate(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return document.querySelector('#asset-grid').scrollTop; - }); - await expect.poll(queryTop).toBeGreaterThan(0); - return await queryTop(); - }, -}; - -export const assetViewerUtils = { - locator(page: Page) { - return page.locator('#immich-asset-viewer'); - }, - async waitForViewerLoad(page: Page, asset: TimelineAssetConfig) { - await page - .locator( - `img[draggable="false"][src="/api/assets/${asset.id}/thumbnail?size=preview&c=${asset.thumbhash}&edited=true"]`, - ) - .or( - page.locator(`video[poster="/api/assets/${asset.id}/thumbnail?size=preview&c=${asset.thumbhash}&edited=true"]`), - ) - .waitFor(); - }, - async expectActiveAssetToBe(page: Page, assetId: string) { - const activeElement = () => - page.evaluate(() => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return document.activeElement?.dataset?.asset; - }); - await expect(poll(page, activeElement, (result) => result === assetId)).resolves.toBe(assetId); - }, -}; -export const pageUtils = { - async deepLinkPhotosPage(page: Page, assetId: string) { - await page.goto(`/photos?at=${assetId}`); - await timelineUtils.waitForTimelineLoad(page); - }, - async openPhotosPage(page: Page) { - await page.goto(`/photos`); - await timelineUtils.waitForTimelineLoad(page); - }, - async openFavorites(page: Page) { - await page.goto(`/favorites`); - await timelineUtils.waitForTimelineLoad(page); - }, - async openAlbumPage(page: Page, albumId: string) { - await page.goto(`/albums/${albumId}`); - await timelineUtils.waitForTimelineLoad(page); - }, - async openArchivePage(page: Page) { - await page.goto(`/archive`); - await timelineUtils.waitForTimelineLoad(page); - }, - async deepLinkAlbumPage(page: Page, albumId: string, assetId: string) { - await page.goto(`/albums/${albumId}?at=${assetId}`); - await timelineUtils.waitForTimelineLoad(page); - }, - async goToAsset(page: Page, assetDate: string) { - await timelineUtils.locator(page).hover(); - const stringDate = DateTime.fromISO(assetDate).toFormat('MMddyyyy,hh:mm:ss.SSSa'); - await page.keyboard.press('g'); - await page.locator('#datetime').pressSequentially(stringDate); - await page.getByText('Confirm').click(); - }, - async selectDay(page: Page, day: string) { - await page.getByTitle(day).hover(); - await page.locator('[data-group] .w-8').click(); - }, - async pauseTestDebug() { - console.log('NOTE: pausing test indefinately for debug'); - await new Promise(() => void 0); - }, -}; diff --git a/e2e/src/web/specs/user-admin.e2e-spec.ts b/e2e/src/web/specs/user-admin.e2e-spec.ts deleted file mode 100644 index 67a537ba9d..0000000000 --- a/e2e/src/web/specs/user-admin.e2e-spec.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { getUserAdmin } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { asBearerAuth, utils } from 'src/utils'; - -test.describe('User Administration', () => { - test.beforeAll(() => { - utils.initSdk(); - }); - - test.beforeEach(async () => { - await utils.resetDatabase(); - }); - - test('validate admin/users link', async ({ context, page }) => { - const admin = await utils.adminSetup(); - await utils.setAuthCookies(context, admin.accessToken); - - // Navigate to user management page and verify title and header - await page.goto(`/admin/users`); - await expect(page).toHaveTitle(/User Management/); - await expect(page.getByText('User Management')).toBeVisible(); - }); - - test('create user', async ({ context, page }) => { - const admin = await utils.adminSetup(); - await utils.setAuthCookies(context, admin.accessToken); - - // Create a new user - await page.goto('/admin/users'); - await page.getByRole('button', { name: 'Create user' }).click(); - await page.getByLabel('Email').fill('user@immich.cloud'); - await page.getByLabel('Password', { exact: true }).fill('password'); - await page.getByLabel('Confirm Password').fill('password'); - await page.getByLabel('Name').fill('Immich User'); - await page.getByRole('button', { name: 'Create', exact: true }).click(); - - // Verify the user exists in the user list - await page.getByRole('row', { name: 'user@immich.cloud' }); - }); - - test('promote to admin', async ({ context, page }) => { - const admin = await utils.adminSetup(); - await utils.setAuthCookies(context, admin.accessToken); - - const user = await utils.userSetup(admin.accessToken, { - name: 'Admin 2', - email: 'admin2@immich.cloud', - password: 'password', - }); - - expect(user.isAdmin).toBe(false); - - await page.goto(`/admin/users/${user.userId}`); - - await page.getByRole('button', { name: 'Edit' }).click(); - await expect(page.getByLabel('Admin User')).not.toBeChecked(); - await page.getByLabel('Admin User').click(); - await expect(page.getByLabel('Admin User')).toBeChecked(); - await page.getByRole('button', { name: 'Save' }).click(); - - await expect - .poll(async () => { - const userAdmin = await getUserAdmin({ id: user.userId }, { headers: asBearerAuth(admin.accessToken) }); - return userAdmin.isAdmin; - }) - .toBe(true); - }); - - test('revoke admin access', async ({ context, page }) => { - const admin = await utils.adminSetup(); - await utils.setAuthCookies(context, admin.accessToken); - - const user = await utils.userSetup(admin.accessToken, { - name: 'Admin 2', - email: 'admin2@immich.cloud', - password: 'password', - isAdmin: true, - }); - - expect(user.isAdmin).toBe(true); - - await page.goto(`/admin/users/${user.userId}`); - - await page.getByRole('button', { name: 'Edit' }).click(); - await expect(page.getByLabel('Admin User')).toBeChecked(); - await page.getByLabel('Admin User').click(); - await expect(page.getByLabel('Admin User')).not.toBeChecked(); - await page.getByRole('button', { name: 'Save' }).click(); - - await expect - .poll(async () => { - const userAdmin = await getUserAdmin({ id: user.userId }, { headers: asBearerAuth(admin.accessToken) }); - return userAdmin.isAdmin; - }) - .toBe(false); - }); -}); diff --git a/e2e/src/web/specs/websocket.e2e-spec.ts b/e2e/src/web/specs/websocket.e2e-spec.ts deleted file mode 100644 index a929c6467f..0000000000 --- a/e2e/src/web/specs/websocket.e2e-spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { LoginResponseDto } from '@immich/sdk'; -import { expect, test } from '@playwright/test'; -import { utils } from 'src/utils'; - -test.describe('Websocket', () => { - let admin: LoginResponseDto; - - test.beforeAll(async () => { - utils.initSdk(); - await utils.resetDatabase(); - admin = await utils.adminSetup(); - }); - - test('connects using ipv4', async ({ page, context }) => { - await utils.setAuthCookies(context, admin.accessToken); - await page.goto('http://127.0.0.1:2285/'); - await expect(page.locator('#sidebar')).toContainText('Server Online'); - }); - - test('connects using ipv6', async ({ page, context }) => { - await utils.setAuthCookies(context, admin.accessToken, '[::1]'); - await page.goto('http://[::1]:2285/'); - await expect(page.locator('#sidebar')).toContainText('Server Online'); - }); -}); diff --git a/i18n/af.json b/i18n/af.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/af.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ar.json b/i18n/ar.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ar.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/az.json b/i18n/az.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/az.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/be.json b/i18n/be.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/be.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/bg.json b/i18n/bg.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/bg.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/bi.json b/i18n/bi.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/bi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/bn.json b/i18n/bn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/bn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/br.json b/i18n/br.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/br.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ca.json b/i18n/ca.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ca.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/cs.json b/i18n/cs.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/cs.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/cv.json b/i18n/cv.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/cv.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/da.json b/i18n/da.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/da.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/de.json b/i18n/de.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/de.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/de_CH.json b/i18n/de_CH.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/de_CH.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/el.json b/i18n/el.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/el.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/en.json b/i18n/en.json index a51467ab6d..dedbea1bfe 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,4 +1,2410 @@ { + "about": "About", + "account": "Account", + "account_settings": "Account Settings", + "acknowledge": "Acknowledge", + "action": "Action", + "action_common_update": "Update", + "action_description": "A set of action to perform on the filtered assets", + "actions": "Actions", + "active": "Active", + "active_count": "Active: {count}", + "activity": "Activity", + "activity_changed": "Activity is {enabled, select, true {enabled} other {disabled}}", + "add": "Add", + "add_a_description": "Add a description", + "add_a_location": "Add a location", + "add_a_name": "Add a name", + "add_a_title": "Add a title", + "add_action": "Add action", + "add_action_description": "Click to add an action to perform", + "add_assets": "Add assets", + "add_birthday": "Add a birthday", + "add_endpoint": "Add endpoint", + "add_exclusion_pattern": "Add exclusion pattern", + "add_filter": "Add filter", + "add_filter_description": "Click to add a filter condition", + "add_location": "Add location", + "add_more_users": "Add more users", + "add_partner": "Add partner", + "add_path": "Add path", + "add_photos": "Add photos", + "add_tag": "Add tag", + "add_to": "Add to…", + "add_to_album": "Add to album", + "add_to_album_bottom_sheet_added": "Added to {album}", + "add_to_album_bottom_sheet_already_exists": "Already in {album}", + "add_to_album_bottom_sheet_some_local_assets": "Some local assets could not be added to album", + "add_to_album_toggle": "Toggle selection for {album}", + "add_to_albums": "Add to albums", + "add_to_albums_count": "Add to albums ({count})", + "add_to_bottom_bar": "Add to", + "add_to_shared_album": "Add to shared album", + "add_upload_to_stack": "Add upload to stack", + "add_url": "Add URL", + "add_workflow_step": "Add workflow step", + "added_to_archive": "Added to archive", + "added_to_favorites": "Added to favorites", + "added_to_favorites_count": "Added {count, number} to favorites", + "admin": { + "add_exclusion_pattern_description": "Add exclusion patterns. Globbing using *, **, and ? is supported. To ignore all files in any directory named \"Raw\", use \"**/Raw/**\". To ignore all files ending in \".tif\", use \"**/*.tif\". To ignore an absolute path, use \"/path/to/ignore/**\".", + "admin_user": "Admin User", + "asset_offline_description": "This external library asset is no longer found on disk and has been moved to trash. If the file was moved within the library, check your timeline for the new corresponding asset. To restore this asset, please ensure that the file path below can be accessed by Immich and scan the library.", + "authentication_settings": "Authentication Settings", + "authentication_settings_description": "Manage password, OAuth, and other authentication settings", + "authentication_settings_disable_all": "Are you sure you want to disable all login methods? Login will be completely disabled.", + "authentication_settings_reenable": "To re-enable, use a Server Command.", + "background_task_job": "Background Tasks", + "backup_database": "Create Database Dump", + "backup_database_enable_description": "Enable database dumps", + "backup_keep_last_amount": "Amount of previous dumps to keep", + "backup_onboarding_1_description": "offsite copy in the cloud or at another physical location.", + "backup_onboarding_2_description": "local copies on different devices. This includes the main files and a backup of those files locally.", + "backup_onboarding_3_description": "total copies of your data, including the original files. This includes 1 offsite copy and 2 local copies.", + "backup_onboarding_description": "A 3-2-1 backup strategy is recommended to protect your data. You should keep copies of your uploaded photos/videos as well as the Immich database for a comprehensive backup solution.", + "backup_onboarding_footer": "For more information about backing up Immich, please refer to the documentation.", + "backup_onboarding_parts_title": "A 3-2-1 backup includes:", + "backup_onboarding_title": "Backups", + "backup_settings": "Database Dump Settings", + "backup_settings_description": "Manage database dump settings.", + "cleared_jobs": "Cleared jobs for: {job}", + "config_set_by_file": "Config is currently set by a config file", + "confirm_delete_library": "Are you sure you want to delete {library} library?", + "confirm_delete_library_assets": "Are you sure you want to delete this library? This will delete {count, plural, one {# contained asset} other {all # contained assets}} from Immich and cannot be undone. Files will remain on disk.", + "confirm_email_below": "To confirm, type \"{email}\" below", + "confirm_reprocess_all_faces": "Are you sure you want to reprocess all faces? This will also clear named people.", + "confirm_user_password_reset": "Are you sure you want to reset {user}'s password?", + "confirm_user_pin_code_reset": "Are you sure you want to reset {user}'s PIN code?", + "copy_config_to_clipboard_description": "Copy the current system config as a JSON object to the clipboard", + "create_job": "Create job", + "cron_expression": "Cron expression", + "cron_expression_description": "Set the scanning interval using the cron format. For more information please refer to e.g. Crontab Guru", + "cron_expression_presets": "Cron expression presets", + "disable_login": "Disable login", + "duplicate_detection_job_description": "Run machine learning on assets to detect similar images. Relies on Smart Search", + "exclusion_pattern_description": "Exclusion patterns lets you ignore files and folders when scanning your library. This is useful if you have folders that contain files you don't want to import, such as RAW files.", + "export_config_as_json_description": "Download the current system config as a JSON file", + "external_libraries_page_description": "Admin external library page", + "face_detection": "Face detection", + "face_detection_description": "Detect the faces in assets using machine learning. For videos, only the thumbnail is considered. \"Refresh\" (re-)processes all assets. \"Reset\" additionally clears all current face data. \"Missing\" queues assets that haven't been processed yet. Detected faces will be queued for Facial Recognition after Face Detection is complete, grouping them into existing or new people.", + "facial_recognition_job_description": "Group detected faces into people. This step runs after Face Detection is complete. \"Reset\" (re-)clusters all faces. \"Missing\" queues faces that don't have a person assigned.", + "failed_job_command": "Command {command} failed for job: {job}", + "force_delete_user_warning": "WARNING: This will immediately remove the user and all assets. This cannot be undone and the files cannot be recovered.", + "image_format": "Format", + "image_format_description": "WebP produces smaller files than JPEG, but is slower to encode.", + "image_fullsize_description": "Full-size image with stripped metadata, used when zoomed in", + "image_fullsize_enabled": "Enable full-size image generation", + "image_fullsize_enabled_description": "Generate full-size image for non-web-friendly formats. When \"Prefer embedded preview\" is enabled, embedded previews are used directly without conversion. Does not affect web-friendly formats like JPEG.", + "image_fullsize_quality_description": "Full-size image quality from 1-100. Higher is better, but produces larger files.", + "image_fullsize_title": "Full-size Image Settings", + "image_prefer_embedded_preview": "Prefer embedded preview", + "image_prefer_embedded_preview_setting_description": "Use embedded previews in RAW photos as the input to image processing and when available. This can produce more accurate colors for some images, but the quality of the preview is camera-dependent and the image may have more compression artifacts.", + "image_prefer_wide_gamut": "Prefer wide gamut", + "image_prefer_wide_gamut_setting_description": "Use Display P3 for thumbnails. This better preserves the vibrance of images with wide colorspaces, but images may appear differently on old devices with an old browser version. sRGB images are kept as sRGB to avoid color shifts.", + "image_preview_description": "Medium-size image with stripped metadata, used when viewing a single asset and for machine learning", + "image_preview_quality_description": "Preview quality from 1-100. Higher is better, but produces larger files and can reduce app responsiveness. Setting a low value may affect machine learning quality.", + "image_preview_title": "Preview Settings", + "image_progressive": "Progressive", + "image_progressive_description": "Encode JPEG images progressively for gradual loading display. This has no effect on WebP images.", + "image_quality": "Quality", + "image_resolution": "Resolution", + "image_resolution_description": "Higher resolutions can preserve more detail but take longer to encode, have larger file sizes and can reduce app responsiveness.", + "image_settings": "Image Settings", + "image_settings_description": "Manage the quality and resolution of generated images", + "image_thumbnail_description": "Small thumbnail with stripped metadata, used when viewing groups of photos like the main timeline", + "image_thumbnail_quality_description": "Thumbnail quality from 1-100. Higher is better, but produces larger files and can reduce app responsiveness.", + "image_thumbnail_title": "Thumbnail Settings", + "import_config_from_json_description": "Import system config by uploading a JSON config file", + "job_concurrency": "{job} concurrency", + "job_created": "Job created", + "job_not_concurrency_safe": "This job is not concurrency-safe.", + "job_settings": "Job Settings", + "job_settings_description": "Manage job concurrency", + "jobs_delayed": "{jobCount, plural, other {# delayed}}", + "jobs_failed": "{jobCount, plural, other {# failed}}", + "jobs_over_time": "Jobs over time", + "library_created": "Created library: {library}", + "library_deleted": "Library deleted", + "library_details": "Library details", + "library_folder_description": "Specify a folder to import. This folder, including subfolders, will be scanned for images and videos.", + "library_remove_exclusion_pattern_prompt": "Are you sure you want to remove this exclusion pattern?", + "library_remove_folder_prompt": "Are you sure you want to remove this import folder?", + "library_scanning": "Periodic Scanning", + "library_scanning_description": "Configure periodic library scanning", + "library_scanning_enable_description": "Enable periodic library scanning", + "library_settings": "External Library", + "library_settings_description": "Manage external library settings", + "library_tasks_description": "Scan external libraries for new and/or changed assets", + "library_updated": "Updated library", + "library_watching_enable_description": "Watch external libraries for file changes", + "library_watching_settings": "Library watching [EXPERIMENTAL]", + "library_watching_settings_description": "Automatically watch for changed files", + "logging_enable_description": "Enable logging", + "logging_level_description": "When enabled, what log level to use.", + "logging_settings": "Logging", + "machine_learning_availability_checks": "Availability checks", + "machine_learning_availability_checks_description": "Automatically detect and prefer available machine learning servers", + "machine_learning_availability_checks_enabled": "Enable availability checks", + "machine_learning_availability_checks_interval": "Check interval", + "machine_learning_availability_checks_interval_description": "Interval in milliseconds between availability checks", + "machine_learning_availability_checks_timeout": "Request timeout", + "machine_learning_availability_checks_timeout_description": "Timeout in milliseconds for availability checks", + "machine_learning_clip_model": "CLIP model", + "machine_learning_clip_model_description": "The name of a CLIP model listed here. Note that you must re-run the 'Smart Search' job for all images upon changing a model.", + "machine_learning_duplicate_detection": "Duplicate Detection", + "machine_learning_duplicate_detection_enabled": "Enable duplicate detection", + "machine_learning_duplicate_detection_enabled_description": "If disabled, exactly identical assets will still be de-duplicated.", + "machine_learning_duplicate_detection_setting_description": "Use CLIP embeddings to find likely duplicates", + "machine_learning_enabled": "Enable machine learning", + "machine_learning_enabled_description": "If disabled, all ML features will be disabled regardless of the below settings.", + "machine_learning_facial_recognition": "Facial Recognition", + "machine_learning_facial_recognition_description": "Detect, recognize and group faces in images", + "machine_learning_facial_recognition_model": "Facial recognition model", + "machine_learning_facial_recognition_model_description": "Models are listed in descending order of size. Larger models are slower and use more memory, but produce better results. Note that you must re-run the Face Detection job for all images upon changing a model.", + "machine_learning_facial_recognition_setting": "Enable facial recognition", + "machine_learning_facial_recognition_setting_description": "If disabled, images will not be encoded for facial recognition and will not populate the People section in the Explore page.", + "machine_learning_max_detection_distance": "Maximum detection distance", + "machine_learning_max_detection_distance_description": "Maximum distance between two images to consider them duplicates, ranging from 0.001-0.1. Higher values will detect more duplicates, but may result in false positives.", + "machine_learning_max_recognition_distance": "Maximum recognition distance", + "machine_learning_max_recognition_distance_description": "Maximum distance between two faces to be considered the same person, ranging from 0-2. Lowering this can prevent labeling two people as the same person, while raising it can prevent labeling the same person as two different people. Note that it is easier to merge two people than to split one person in two, so err on the side of a lower threshold when possible.", + "machine_learning_min_detection_score": "Minimum detection score", + "machine_learning_min_detection_score_description": "Minimum confidence score for a face to be detected from 0-1. Lower values will detect more faces but may result in false positives.", + "machine_learning_min_recognized_faces": "Minimum recognized faces", + "machine_learning_min_recognized_faces_description": "The minimum number of recognized faces for a person to be created. Increasing this makes Facial Recognition more precise at the cost of increasing the chance that a face is not assigned to a person.", + "machine_learning_ocr": "OCR", + "machine_learning_ocr_description": "Use machine learning to recognize text in images", + "machine_learning_ocr_enabled": "Enable OCR", + "machine_learning_ocr_enabled_description": "If disabled, images will not undergo text recognition.", + "machine_learning_ocr_max_resolution": "Maximum resolution", + "machine_learning_ocr_max_resolution_description": "Previews above this resolution will be resized while preserving aspect ratio. Higher values are more accurate, but take longer to process and use more memory.", + "machine_learning_ocr_min_detection_score": "Minimum detection score", + "machine_learning_ocr_min_detection_score_description": "Minimum confidence score for text to be detected from 0-1. Lower values will detect more text but may result in false positives.", + "machine_learning_ocr_min_recognition_score": "Minimum recognition score", + "machine_learning_ocr_min_score_recognition_description": "Minimum confidence score for detected text to be recognized from 0-1. Lower values will recognize more text but may result in false positives.", + "machine_learning_ocr_model": "OCR model", + "machine_learning_ocr_model_description": "Server models are more accurate than mobile models, but take longer to process and use more memory.", + "machine_learning_settings": "Machine Learning Settings", + "machine_learning_settings_description": "Manage machine learning features and settings", + "machine_learning_smart_search": "Smart Search", + "machine_learning_smart_search_description": "Search for images semantically using CLIP embeddings", + "machine_learning_smart_search_enabled": "Enable smart search", + "machine_learning_smart_search_enabled_description": "If disabled, images will not be encoded for smart search.", + "machine_learning_url_description": "The URL of the machine learning server. If more than one URL is provided, each server will be attempted one-at-a-time until one responds successfully, in order from first to last. Servers that don't respond will be temporarily ignored until they come back online.", + "maintenance_delete_backup": "Delete Backup", + "maintenance_delete_backup_description": "This file will be irrevocably deleted.", + "maintenance_delete_error": "Failed to delete backup.", + "maintenance_restore_backup": "Restore Backup", + "maintenance_restore_backup_description": "Immich will be wiped and restored from the chosen backup. A backup will be created before continuing.", + "maintenance_restore_backup_different_version": "This backup was created with a different version of Immich!", + "maintenance_restore_backup_unknown_version": "Couldn't determine backup version.", + "maintenance_restore_database_backup": "Restore database backup", + "maintenance_restore_database_backup_description": "Rollback to an earlier database state using a backup file", + "maintenance_settings": "Maintenance", + "maintenance_settings_description": "Put Immich into maintenance mode.", + "maintenance_start": "Switch to maintenance mode", + "maintenance_start_error": "Failed to start maintenance mode.", + "maintenance_upload_backup": "Upload database backup file", + "maintenance_upload_backup_error": "Could not upload backup, is it an .sql/.sql.gz file?", + "manage_concurrency": "Manage Concurrency", + "manage_concurrency_description": "Navigate to the jobs page to manage job concurrency", + "manage_log_settings": "Manage log settings", + "map_dark_style": "Dark style", + "map_enable_description": "Enable map features", + "map_gps_settings": "Map & GPS Settings", + "map_gps_settings_description": "Manage Map & GPS (Reverse Geocoding) Settings", + "map_implications": "The map feature relies on an external tile service (tiles.immich.cloud)", + "map_light_style": "Light style", + "map_manage_reverse_geocoding_settings": "Manage Reverse Geocoding settings", + "map_reverse_geocoding": "Reverse Geocoding", + "map_reverse_geocoding_enable_description": "Enable reverse geocoding", + "map_reverse_geocoding_settings": "Reverse Geocoding Settings", + "map_settings": "Map", + "map_settings_description": "Manage map settings", + "map_style_description": "URL to a style.json map theme", + "memory_cleanup_job": "Memory cleanup", + "memory_generate_job": "Memory generation", + "metadata_extraction_job": "Extract metadata", + "metadata_extraction_job_description": "Extract metadata information from each asset, such as GPS, faces and resolution", + "metadata_faces_import_setting": "Enable face import", + "metadata_faces_import_setting_description": "Import faces from image EXIF data and sidecar files", + "metadata_settings": "Metadata Settings", + "metadata_settings_description": "Manage metadata settings", + "migration_job": "Migration", + "migration_job_description": "Migrate thumbnails for assets and faces to the latest folder structure", + "nightly_tasks_cluster_faces_setting_description": "Run facial recognition on newly detected faces", + "nightly_tasks_cluster_new_faces_setting": "Cluster new faces", + "nightly_tasks_database_cleanup_setting": "Database cleanup tasks", + "nightly_tasks_database_cleanup_setting_description": "Clean up old, expired data from the database", + "nightly_tasks_generate_memories_setting": "Generate memories", + "nightly_tasks_generate_memories_setting_description": "Create new memories from assets", + "nightly_tasks_missing_thumbnails_setting": "Generate missing thumbnails", + "nightly_tasks_missing_thumbnails_setting_description": "Queue assets without thumbnails for thumbnail generation", + "nightly_tasks_settings": "Nightly Tasks Settings", + "nightly_tasks_settings_description": "Manage nightly tasks", + "nightly_tasks_start_time_setting": "Start time", + "nightly_tasks_start_time_setting_description": "The time at which the server starts running the nightly tasks", + "nightly_tasks_sync_quota_usage_setting": "Sync quota usage", + "nightly_tasks_sync_quota_usage_setting_description": "Update user storage quota, based on current usage", + "no_paths_added": "No paths added", + "no_pattern_added": "No pattern added", + "note_apply_storage_label_previous_assets": "Note: To apply the Storage Label to previously uploaded assets, run the", + "note_cannot_be_changed_later": "NOTE: This cannot be changed later!", + "notification_email_from_address": "From address", + "notification_email_from_address_description": "Sender email address, for example: \"Immich Photo Server \". Make sure to use an address you're allowed to send emails from.", + "notification_email_host_description": "Host of the email server (e.g. smtp.immich.app)", + "notification_email_ignore_certificate_errors": "Ignore certificate errors", + "notification_email_ignore_certificate_errors_description": "Ignore TLS certificate validation errors (not recommended)", + "notification_email_password_description": "Password to use when authenticating with the email server", + "notification_email_port_description": "Port of the email server (e.g 25, 465, or 587)", + "notification_email_secure": "SMTPS", + "notification_email_secure_description": "Use SMTPS (SMTP over TLS)", + "notification_email_sent_test_email_button": "Send test email and save", + "notification_email_setting_description": "Settings for sending email notifications", + "notification_email_test_email": "Send test email", + "notification_email_test_email_failed": "Failed to send test email, check your values", + "notification_email_test_email_sent": "A test email has been sent to {email}. Please check your inbox.", + "notification_email_username_description": "Username to use when authenticating with the email server", + "notification_enable_email_notifications": "Enable email notifications", + "notification_settings": "Notification Settings", + "notification_settings_description": "Manage notification settings, including email", + "oauth_auto_launch": "Auto launch", + "oauth_auto_launch_description": "Start the OAuth login flow automatically upon navigating to the login page", + "oauth_auto_register": "Auto register", + "oauth_auto_register_description": "Automatically register new users after signing in with OAuth", + "oauth_button_text": "Button text", + "oauth_client_secret_description": "Required for confidential client, or if PKCE (Proof Key for Code Exchange) is not supported for public client.", + "oauth_enable_description": "Login with OAuth", + "oauth_mobile_redirect_uri": "Mobile redirect URI", + "oauth_mobile_redirect_uri_override": "Mobile redirect URI override", + "oauth_mobile_redirect_uri_override_description": "Enable when OAuth provider does not allow a mobile URI, like ''{callback}''", + "oauth_role_claim": "Role Claim", + "oauth_role_claim_description": "Automatically grant admin access based on the presence of this claim. The claim may have either 'user' or 'admin'.", + "oauth_settings": "OAuth", + "oauth_settings_description": "Manage OAuth login settings", + "oauth_settings_more_details": "For more details about this feature, refer to the docs.", + "oauth_storage_label_claim": "Storage label claim", + "oauth_storage_label_claim_description": "Automatically set the user's storage label to the value of this claim.", + "oauth_storage_quota_claim": "Storage quota claim", + "oauth_storage_quota_claim_description": "Automatically set the user's storage quota to the value of this claim.", + "oauth_storage_quota_default": "Default storage quota (GiB)", + "oauth_storage_quota_default_description": "Quota in GiB to be used when no claim is provided.", + "oauth_timeout": "Request Timeout", + "oauth_timeout_description": "Timeout for requests in milliseconds", + "ocr_job_description": "Use machine learning to recognize text in images", + "password_enable_description": "Login with email and password", + "password_settings": "Password Login", + "password_settings_description": "Manage password login settings", + "paths_validated_successfully": "All paths validated successfully", + "person_cleanup_job": "Person cleanup", + "queue_details": "Queue Details", + "queues": "Job Queues", + "queues_page_description": "Admin job queues page", + "quota_size_gib": "Quota Size (GiB)", + "refreshing_all_libraries": "Refreshing all libraries", + "registration": "Admin Registration", + "registration_description": "Since you are the first user on the system, you will be assigned as the Admin and are responsible for administrative tasks, and additional users will be created by you.", + "remove_failed_jobs": "Remove failed jobs", + "require_password_change_on_login": "Require user to change password on first login", + "reset_settings_to_default": "Reset settings to default", + "reset_settings_to_recent_saved": "Reset settings to the recent saved settings", + "scanning_library": "Scanning library", + "search_jobs": "Search jobs…", + "send_welcome_email": "Send welcome email", + "server_external_domain_settings": "External domain", + "server_external_domain_settings_description": "Domain for public shared links, including http(s)://", + "server_public_users": "Public Users", + "server_public_users_description": "All users (name and email) are listed when adding a user to shared albums. When disabled, the user list will only be available to admin users.", + "server_settings": "Server Settings", + "server_settings_description": "Manage server settings", + "server_stats_page_description": "Admin server statistics page", + "server_welcome_message": "Welcome message", + "server_welcome_message_description": "A message that is displayed on the login page.", + "settings_page_description": "Admin settings page", + "sidecar_job": "Sidecar metadata", + "sidecar_job_description": "Discover or synchronize sidecar metadata from the filesystem", + "slideshow_duration_description": "Number of seconds to display each image", + "smart_search_job_description": "Run machine learning on assets to support smart search", + "storage_template_date_time_description": "Asset's creation timestamp is used for the datetime information", + "storage_template_date_time_sample": "Sample time {date}", + "storage_template_enable_description": "Enable storage template engine", + "storage_template_hash_verification_enabled": "Hash verification enabled", + "storage_template_hash_verification_enabled_description": "Enables hash verification, don't disable this unless you're certain of the implications", + "storage_template_migration": "Storage template migration", + "storage_template_migration_description": "Apply the current {template} to previously uploaded assets", + "storage_template_migration_info": "The storage template will convert all extensions to lowercase. Template changes will only apply to new assets. To retroactively apply the template to previously uploaded assets, run the {job}.", + "storage_template_migration_job": "Storage Template Migration Job", + "storage_template_more_details": "For more details about this feature, refer to the Storage Template and its implications", + "storage_template_onboarding_description_v2": "When enabled, this feature will auto-organize files based on a user-defined template. For more information, please see the documentation.", + "storage_template_path_length": "Approximate path length limit: {length, number}/{limit, number}", + "storage_template_settings": "Storage Template", + "storage_template_settings_description": "Manage the folder structure and file name of the upload asset", + "storage_template_user_label": "{label} is the user's Storage Label", + "system_settings": "System Settings", + "tag_cleanup_job": "Tag cleanup", + "template_email_available_tags": "You can use the following variables in your template: {tags}", + "template_email_if_empty": "If the template is empty, the default email will be used.", + "template_email_invite_album": "Invite Album Template", + "template_email_preview": "Preview", + "template_email_settings": "Email Templates", + "template_email_update_album": "Update Album Template", + "template_email_welcome": "Welcome email template", + "template_settings": "Notification Templates", + "template_settings_description": "Manage custom templates for notifications", + "theme_custom_css_settings": "Custom CSS", + "theme_custom_css_settings_description": "Cascading Style Sheets allow the design of Immich to be customized.", + "theme_settings": "Theme Settings", + "theme_settings_description": "Manage customization of the Immich web interface", + "thumbnail_generation_job": "Generate Thumbnails", + "thumbnail_generation_job_description": "Generate large, small and blurred thumbnails for each asset, as well as thumbnails for each person", + "transcoding_acceleration_api": "Acceleration API", + "transcoding_acceleration_api_description": "The API that will interact with your device to accelerate transcoding. This setting is 'best effort': it will fallback to software transcoding on failure. VP9 may or may not work depending on your hardware.", + "transcoding_acceleration_nvenc": "NVENC (requires NVIDIA GPU)", + "transcoding_acceleration_qsv": "Quick Sync (requires 7th gen Intel CPU or later)", + "transcoding_acceleration_rkmpp": "RKMPP (only on Rockchip SOCs)", + "transcoding_acceleration_vaapi": "VAAPI", + "transcoding_accepted_audio_codecs": "Accepted audio codecs", + "transcoding_accepted_audio_codecs_description": "Select which audio codecs do not need to be transcoded. Only used for certain transcode policies.", + "transcoding_accepted_containers": "Accepted containers", + "transcoding_accepted_containers_description": "Select which container formats do not need to be remuxed to MP4. Only used for certain transcode policies.", + "transcoding_accepted_video_codecs": "Accepted video codecs", + "transcoding_accepted_video_codecs_description": "Select which video codecs do not need to be transcoded. Only used for certain transcode policies.", + "transcoding_advanced_options_description": "Options most users should not need to change", + "transcoding_audio_codec": "Audio codec", + "transcoding_audio_codec_description": "Opus is the highest quality option, but has lower compatibility with old devices or software.", + "transcoding_bitrate_description": "Videos higher than max bitrate or not in an accepted format", + "transcoding_codecs_learn_more": "To learn more about the terminology used here, refer to FFmpeg documentation for H.264 codec, HEVC codec and VP9 codec.", + "transcoding_constant_quality_mode": "Constant quality mode", + "transcoding_constant_quality_mode_description": "ICQ is better than CQP, but some hardware acceleration devices do not support this mode. Setting this option will prefer the specified mode when using quality-based encoding. Ignored by NVENC as it does not support ICQ.", + "transcoding_constant_rate_factor": "Constant rate factor (-crf)", + "transcoding_constant_rate_factor_description": "Video quality level. Typical values are 23 for H.264, 28 for HEVC, 31 for VP9, and 35 for AV1. Lower is better, but produces larger files.", + "transcoding_disabled_description": "Don't transcode any videos, may break playback on some clients", + "transcoding_encoding_options": "Encoding Options", + "transcoding_encoding_options_description": "Set codecs, resolution, quality and other options for the encoded videos", + "transcoding_hardware_acceleration": "Hardware Acceleration", + "transcoding_hardware_acceleration_description": "Experimental: faster transcoding but may reduce quality at same bitrate", + "transcoding_hardware_decoding": "Hardware decoding", + "transcoding_hardware_decoding_setting_description": "Enables end-to-end acceleration instead of only accelerating encoding. May not work on all videos.", + "transcoding_max_b_frames": "Maximum B-frames", + "transcoding_max_b_frames_description": "Higher values improve compression efficiency, but slow down encoding. May not be compatible with hardware acceleration on older devices. 0 disables B-frames, while -1 sets this value automatically.", + "transcoding_max_bitrate": "Maximum bitrate", + "transcoding_max_bitrate_description": "Setting a max bitrate can make file sizes more predictable at a minor cost to quality. At 720p, typical values are 2600 kbit/s for VP9 or HEVC, or 4500 kbit/s for H.264. Disabled if set to 0. When no unit is specified, k (for kbit/s) is assumed; therefore 5000, 5000k, and 5M (for Mbit/s) are equivalent.", + "transcoding_max_keyframe_interval": "Maximum keyframe interval", + "transcoding_max_keyframe_interval_description": "Sets the maximum frame distance between keyframes. Lower values worsen compression efficiency, but improve seek times and may improve quality in scenes with fast movement. 0 sets this value automatically.", + "transcoding_optimal_description": "Videos higher than target resolution or not in an accepted format", + "transcoding_policy": "Transcode Policy", + "transcoding_policy_description": "Set when a video will be transcoded", + "transcoding_preferred_hardware_device": "Preferred hardware device", + "transcoding_preferred_hardware_device_description": "Applies only to VAAPI and QSV. Sets the dri node used for hardware transcoding.", + "transcoding_preset_preset": "Preset (-preset)", + "transcoding_preset_preset_description": "Compression speed. Slower presets produce smaller files, and increase quality when targeting a certain bitrate. VP9 ignores speeds above 'faster'.", + "transcoding_reference_frames": "Reference frames", + "transcoding_reference_frames_description": "The number of frames to reference when compressing a given frame. Higher values improve compression efficiency, but slow down encoding. 0 sets this value automatically.", + "transcoding_required_description": "Only videos not in an accepted format", + "transcoding_settings": "Video Transcoding Settings", + "transcoding_settings_description": "Manage which videos to transcode and how to process them", + "transcoding_target_resolution": "Target resolution", + "transcoding_target_resolution_description": "Higher resolutions can preserve more detail but take longer to encode, have larger file sizes, and can reduce app responsiveness.", + "transcoding_temporal_aq": "Temporal AQ", + "transcoding_temporal_aq_description": "Applies only to NVENC. Temporal Adaptive Quantization increases quality of high-detail, low-motion scenes. May not be compatible with older devices.", + "transcoding_threads": "Threads", + "transcoding_threads_description": "Higher values lead to faster encoding, but leave less room for the server to process other tasks while active. This value should not be more than the number of CPU cores. Maximizes utilization if set to 0.", + "transcoding_tone_mapping": "Tone-mapping", + "transcoding_tone_mapping_description": "Attempts to preserve the appearance of HDR videos when converted to SDR. Each algorithm makes different tradeoffs for color, detail and brightness. Hable preserves detail, Mobius preserves color, and Reinhard preserves brightness.", + "transcoding_transcode_policy": "Transcode policy", + "transcoding_transcode_policy_description": "Policy for when a video should be transcoded. HDR videos will always be transcoded (except if transcoding is disabled).", + "transcoding_two_pass_encoding": "Two-pass encoding", + "transcoding_two_pass_encoding_setting_description": "Transcode in two passes to produce better encoded videos. When max bitrate is enabled (required for it to work with H.264 and HEVC), this mode uses a bitrate range based on the max bitrate and ignores CRF. For VP9, CRF can be used if max bitrate is disabled.", + "transcoding_video_codec": "Video codec", + "transcoding_video_codec_description": "VP9 has high efficiency and web compatibility, but takes longer to transcode. HEVC performs similarly, but has lower web compatibility. H.264 is widely compatible and quick to transcode, but produces much larger files. AV1 is the most efficient codec but lacks support on older devices.", + "trash_enabled_description": "Enable Trash features", + "trash_number_of_days": "Number of days", + "trash_number_of_days_description": "Number of days to keep the assets in trash before permanently removing them", + "trash_settings": "Trash Settings", + "trash_settings_description": "Manage trash settings", + "unlink_all_oauth_accounts": "Unlink all OAuth accounts", + "unlink_all_oauth_accounts_description": "Remember to unlink all OAuth accounts before migrating to a new provider.", + "unlink_all_oauth_accounts_prompt": "Are you sure you want to unlink all OAuth accounts? This will reset the OAuth ID for each user and cannot be undone.", + "user_cleanup_job": "User cleanup", + "user_delete_delay": "{user}'s account and assets will be scheduled for permanent deletion in {delay, plural, one {# day} other {# days}}.", + "user_delete_delay_settings": "Delete delay", + "user_delete_delay_settings_description": "Number of days after removal to permanently delete a user's account and assets. The user deletion job runs at midnight to check for users that are ready for deletion. Changes to this setting will be evaluated at the next execution.", + "user_delete_immediately": "{user}'s account and assets will be queued for permanent deletion immediately.", + "user_delete_immediately_checkbox": "Queue user and assets for immediate deletion", + "user_details": "User Details", + "user_management": "User Management", + "user_password_has_been_reset": "The user's password has been reset:", + "user_password_reset_description": "Please provide the temporary password to the user and inform them they will need to change the password at their next login.", + "user_restore_description": "{user}'s account will be restored.", + "user_restore_scheduled_removal": "Restore user - scheduled removal on {date, date, long}", + "user_settings": "User Settings", + "user_settings_description": "Manage user settings", + "user_successfully_removed": "User {email} has been successfully removed.", + "users_page_description": "Admin users page", + "version_check_enabled_description": "Enable version check", + "version_check_implications": "The version check feature relies on periodic communication with github.com", + "version_check_settings": "Version Check", + "version_check_settings_description": "Enable/disable the new version notification", + "video_conversion_job": "Transcode videos", + "video_conversion_job_description": "Transcode videos for wider compatibility with browsers and devices" + }, + "admin_email": "Admin Email", + "admin_password": "Admin Password", + "administration": "Administration", + "advanced": "Advanced", + "advanced_settings_clear_image_cache": "Clear Image Cache", + "advanced_settings_clear_image_cache_error": "Failed to clear image cache", + "advanced_settings_clear_image_cache_success": "Successfully cleared {size}", + "advanced_settings_enable_alternate_media_filter_subtitle": "Use this option to filter media during sync based on alternate criteria. Only try this if you have issues with the app detecting all albums.", + "advanced_settings_enable_alternate_media_filter_title": "[EXPERIMENTAL] Use alternate device album sync filter", + "advanced_settings_log_level_title": "Log level: {level}", + "advanced_settings_prefer_remote_subtitle": "Some devices are painfully slow to load thumbnails from local assets. Activate this setting to load remote images instead.", + "advanced_settings_prefer_remote_title": "Prefer remote images", + "advanced_settings_proxy_headers_subtitle": "Define proxy headers Immich should send with each network request", + "advanced_settings_proxy_headers_title": "Custom proxy headers [EXPERIMENTAL]", + "advanced_settings_readonly_mode_subtitle": "Enables the read-only mode where the photos can be only viewed, things like selecting multiple images, sharing, casting, delete are all disabled. Enable/Disable read-only via user avatar from the main screen", + "advanced_settings_readonly_mode_title": "Read-only mode", + "advanced_settings_self_signed_ssl_subtitle": "Skips SSL certificate verification for the server endpoint. Required for self-signed certificates.", + "advanced_settings_self_signed_ssl_title": "Allow self-signed SSL certificates [EXPERIMENTAL]", + "advanced_settings_sync_remote_deletions_subtitle": "Automatically delete or restore an asset on this device when that action is taken on the web", + "advanced_settings_sync_remote_deletions_title": "Sync remote deletions [EXPERIMENTAL]", + "advanced_settings_tile_subtitle": "Advanced user's settings", + "advanced_settings_troubleshooting_subtitle": "Enable additional features for troubleshooting", + "advanced_settings_troubleshooting_title": "Troubleshooting", + "age_months": "Age {months, plural, one {# month} other {# months}}", + "age_year_months": "Age 1 year, {months, plural, one {# month} other {# months}}", + "age_years": "{years, plural, other {Age #}}", + "album": "Album", + "album_added": "Album added", + "album_added_notification_setting_description": "Receive an email notification when you are added to a shared album", + "album_cover_updated": "Album cover updated", + "album_delete_confirmation": "Are you sure you want to delete the album {album}?", + "album_delete_confirmation_description": "If this album is shared, other users will not be able to access it anymore.", + "album_deleted": "Album deleted", + "album_info_card_backup_album_excluded": "EXCLUDED", + "album_info_card_backup_album_included": "INCLUDED", + "album_info_updated": "Album info updated", + "album_leave": "Leave album?", + "album_leave_confirmation": "Are you sure you want to leave {album}?", + "album_name": "Album Name", + "album_options": "Album options", + "album_remove_user": "Remove user?", + "album_remove_user_confirmation": "Are you sure you want to remove {user}?", + "album_search_not_found": "No albums found matching your search", + "album_selected": "Album selected", + "album_share_no_users": "Looks like you have shared this album with all users or you don't have any user to share with.", + "album_summary": "Album summary", + "album_updated": "Album updated", + "album_updated_setting_description": "Receive an email notification when a shared album has new assets", + "album_upload_assets": "Upload assets from your computer and add to album", + "album_user_left": "Left {album}", + "album_user_removed": "Removed {user}", + "album_viewer_appbar_delete_confirm": "Are you sure you want to delete this album from your account?", + "album_viewer_appbar_share_err_delete": "Failed to delete album", + "album_viewer_appbar_share_err_leave": "Failed to leave album", + "album_viewer_appbar_share_err_remove": "There are problems in removing assets from album", + "album_viewer_appbar_share_err_title": "Failed to change album title", + "album_viewer_appbar_share_leave": "Leave album", + "album_viewer_appbar_share_to": "Share To", + "album_viewer_page_share_add_users": "Add users", + "album_with_link_access": "Let anyone with the link see photos and people in this album.", + "albums": "Albums", + "albums_count": "{count, plural, one {{count, number} Album} other {{count, number} Albums}}", + "albums_default_sort_order": "Default album sort order", + "albums_default_sort_order_description": "Initial asset sort order when creating new albums.", + "albums_feature_description": "Collections of assets that can be shared with other users.", + "albums_on_device_count": "Albums on device ({count})", + "albums_selected": "{count, plural, one {# album selected} other {# albums selected}}", + "all": "All", + "all_albums": "All albums", + "all_people": "All people", + "all_photos": "All photos", + "all_videos": "All videos", + "allow_dark_mode": "Allow dark mode", + "allow_edits": "Allow edits", + "allow_public_user_to_download": "Allow public user to download", + "allow_public_user_to_upload": "Allow public user to upload", + "allowed": "Allowed", + "alt_text_qr_code": "QR code image", + "always_keep": "Always keep", + "always_keep_photos_hint": "Free Up Space will keep all photos on this device.", + "always_keep_videos_hint": "Free Up Space will keep all videos on this device.", + "anti_clockwise": "Anti-clockwise", + "api_key": "API Key", + "api_key_description": "This value will only be shown once. Please be sure to copy it before closing the window.", + "api_key_empty": "Your API Key name shouldn't be empty", + "api_keys": "API Keys", + "app_architecture_variant": "Variant (Architecture)", + "app_bar_signout_dialog_content": "Are you sure you want to sign out?", + "app_bar_signout_dialog_ok": "Yes", + "app_bar_signout_dialog_title": "Sign out", + "app_download_links": "App Download Links", + "app_settings": "App Settings", + "app_stores": "App Stores", + "app_update_available": "App update is available", + "appears_in": "Appears in", + "apply_count": "Apply ({count, number})", + "archive": "Archive", + "archive_action_prompt": "{count} added to Archive", + "archive_or_unarchive_photo": "Archive or unarchive photo", + "archive_page_no_archived_assets": "No archived assets found", + "archive_page_title": "Archive ({count})", + "archive_size": "Archive size", + "archive_size_description": "Configure the archive size for downloads (in GiB)", + "archived": "Archived", + "archived_count": "{count, plural, other {Archived #}}", + "are_these_the_same_person": "Are these the same person?", + "are_you_sure_to_do_this": "Are you sure you want to do this?", + "array_field_not_fully_supported": "Array fields require manual JSON editing", + "asset_action_delete_err_read_only": "Cannot delete read only asset(s), skipping", + "asset_action_share_err_offline": "Cannot fetch offline asset(s), skipping", + "asset_added_to_album": "Added to album", + "asset_adding_to_album": "Adding to album…", + "asset_created": "Asset created", + "asset_description_updated": "Asset description has been updated", + "asset_filename_is_offline": "Asset {filename} is offline", + "asset_has_unassigned_faces": "Asset has unassigned faces", + "asset_hashing": "Hashing…", + "asset_list_group_by_sub_title": "Group by", + "asset_list_layout_settings_dynamic_layout_title": "Dynamic layout", + "asset_list_layout_settings_group_automatically": "Automatic", + "asset_list_layout_settings_group_by": "Group assets by", + "asset_list_layout_settings_group_by_month_day": "Month + day", + "asset_list_layout_sub_title": "Layout", + "asset_list_settings_subtitle": "Photo grid layout settings", + "asset_list_settings_title": "Photo Grid", + "asset_not_found_on_device_android": "Asset not found on device", + "asset_not_found_on_device_ios": "Asset not found on device. If you are using iCloud, the asset may be inaccessible due to bad file stored on iCloud", + "asset_not_found_on_icloud": "Asset not found on iCloud. the asset may be inaccessible due to bad file stored on iCloud", + "asset_offline": "Asset Offline", + "asset_offline_description": "This external asset is no longer found on disk. Please contact your Immich administrator for help.", + "asset_restored_successfully": "Asset restored successfully", + "asset_skipped": "Skipped", + "asset_skipped_in_trash": "In trash", + "asset_trashed": "Asset trashed", + "asset_troubleshoot": "Asset Troubleshoot", + "asset_uploaded": "Uploaded", + "asset_uploading": "Uploading…", + "asset_viewer_settings_subtitle": "Manage your gallery viewer settings", + "asset_viewer_settings_title": "Asset Viewer", + "assets": "Assets", + "assets_added_count": "Added {count, plural, one {# asset} other {# assets}}", + "assets_added_to_album_count": "Added {count, plural, one {# asset} other {# assets}} to the album", + "assets_added_to_albums_count": "Added {assetTotal, plural, one {# asset} other {# assets}} to {albumTotal, plural, one {# album} other {# albums}}", + "assets_cannot_be_added_to_album_count": "{count, plural, one {Asset} other {Assets}} cannot be added to the album", + "assets_cannot_be_added_to_albums": "{count, plural, one {Asset} other {Assets}} cannot be added to any of the albums", + "assets_count": "{count, plural, one {# asset} other {# assets}}", + "assets_deleted_permanently": "{count} asset(s) deleted permanently", + "assets_deleted_permanently_from_server": "{count} asset(s) deleted permanently from the Immich server", + "assets_downloaded_failed": "{count, plural, one {Downloaded # file - {error} file failed} other {Downloaded # files - {error} files failed}}", + "assets_downloaded_successfully": "{count, plural, one {Downloaded # file successfully} other {Downloaded # files successfully}}", + "assets_moved_to_trash_count": "Moved {count, plural, one {# asset} other {# assets}} to trash", + "assets_permanently_deleted_count": "Permanently deleted {count, plural, one {# asset} other {# assets}}", + "assets_removed_count": "Removed {count, plural, one {# asset} other {# assets}}", + "assets_removed_permanently_from_device": "{count} asset(s) removed permanently from your device", + "assets_restore_confirmation": "Are you sure you want to restore all your trashed assets? You cannot undo this action! Note that any offline assets cannot be restored this way.", + "assets_restored_count": "Restored {count, plural, one {# asset} other {# assets}}", + "assets_restored_successfully": "{count} asset(s) restored successfully", + "assets_trashed": "{count} asset(s) trashed", + "assets_trashed_count": "Trashed {count, plural, one {# asset} other {# assets}}", + "assets_trashed_from_server": "{count} asset(s) trashed from the Immich server", + "assets_were_part_of_album_count": "{count, plural, one {Asset was} other {Assets were}} already part of the album", + "assets_were_part_of_albums_count": "{count, plural, one {Asset was} other {Assets were}} already part of the albums", + "authorized_devices": "Authorized Devices", + "automatic_endpoint_switching_subtitle": "Connect locally over designated Wi-Fi when available and use alternative connections elsewhere", + "automatic_endpoint_switching_title": "Automatic URL switching", + "autoplay_slideshow": "Autoplay slideshow", + "back": "Back", + "back_close_deselect": "Back, close, or deselect", + "background_backup_running_error": "Background backup is currently running, cannot start manual backup", + "background_location_permission": "Background location permission", + "background_location_permission_content": "In order to switch networks when running in the background, Immich must *always* have precise location access so the app can read the Wi-Fi network's name", + "background_options": "Background Options", + "backup": "Backup", + "backup_album_selection_page_albums_device": "Albums on device ({count})", + "backup_album_selection_page_albums_tap": "Tap to include, double tap to exclude", + "backup_album_selection_page_assets_scatter": "Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.", + "backup_album_selection_page_select_albums": "Select albums", + "backup_album_selection_page_selection_info": "Selection Info", + "backup_album_selection_page_total_assets": "Total unique assets", + "backup_albums_sync": "Backup Albums Synchronization", + "backup_all": "All", + "backup_background_service_backup_failed_message": "Failed to backup assets. Retrying…", + "backup_background_service_complete_notification": "Asset backup complete", + "backup_background_service_connection_failed_message": "Failed to connect to the server. Retrying…", + "backup_background_service_current_upload_notification": "Uploading {filename}", + "backup_background_service_default_notification": "Checking for new assets…", + "backup_background_service_error_title": "Backup error", + "backup_background_service_in_progress_notification": "Backing up your assets…", + "backup_background_service_upload_failure_notification": "Failed to upload {filename}", + "backup_controller_page_albums": "Backup Albums", + "backup_controller_page_background_app_refresh_disabled_content": "Enable background app refresh in Settings > General > Background App Refresh in order to use background backup.", + "backup_controller_page_background_app_refresh_disabled_title": "Background app refresh disabled", + "backup_controller_page_background_app_refresh_enable_button_text": "Go to settings", + "backup_controller_page_background_battery_info_link": "Show me how", + "backup_controller_page_background_battery_info_message": "For the best background backup experience, please disable any battery optimizations restricting background activity for Immich.\n\nSince this is device-specific, please lookup the required information for your device manufacturer.", + "backup_controller_page_background_battery_info_ok": "OK", + "backup_controller_page_background_battery_info_title": "Battery optimizations", + "backup_controller_page_background_charging": "Only while charging", + "backup_controller_page_background_configure_error": "Failed to configure the background service", + "backup_controller_page_background_delay": "Delay new assets backup: {duration}", + "backup_controller_page_background_description": "Turn on the background service to automatically backup any new assets without needing to open the app", + "backup_controller_page_background_is_off": "Automatic background backup is off", + "backup_controller_page_background_is_on": "Automatic background backup is on", + "backup_controller_page_background_turn_off": "Turn off background service", + "backup_controller_page_background_turn_on": "Turn on background service", + "backup_controller_page_background_wifi": "Only on Wi-Fi", + "backup_controller_page_backup": "Backup", + "backup_controller_page_backup_selected": "Selected: ", + "backup_controller_page_backup_sub": "Backed up photos and videos", + "backup_controller_page_created": "Created on: {date}", + "backup_controller_page_desc_backup": "Turn on foreground backup to automatically upload new assets to the server when opening the app.", + "backup_controller_page_excluded": "Excluded: ", + "backup_controller_page_failed": "Failed ({count})", + "backup_controller_page_filename": "File name: {filename} [{size}]", + "backup_controller_page_id": "ID: {id}", + "backup_controller_page_info": "Backup Information", + "backup_controller_page_none_selected": "None selected", + "backup_controller_page_remainder": "Remainder", + "backup_controller_page_remainder_sub": "Remaining photos and videos to back up from selection", + "backup_controller_page_server_storage": "Server Storage", + "backup_controller_page_start_backup": "Start Backup", + "backup_controller_page_status_off": "Automatic foreground backup is off", + "backup_controller_page_status_on": "Automatic foreground backup is on", + "backup_controller_page_storage_format": "{used} of {total} used", + "backup_controller_page_to_backup": "Albums to be backed up", + "backup_controller_page_total_sub": "All unique photos and videos from selected albums", + "backup_controller_page_turn_off": "Turn off foreground backup", + "backup_controller_page_turn_on": "Turn on foreground backup", + "backup_controller_page_uploading_file_info": "Uploading file info", + "backup_err_only_album": "Cannot remove the only album", + "backup_error_sync_failed": "Sync failed. Cannot process backup.", + "backup_info_card_assets": "assets", + "backup_manual_cancelled": "Cancelled", + "backup_manual_in_progress": "Upload already in progress. Try after sometime", + "backup_manual_success": "Success", + "backup_manual_title": "Upload status", + "backup_options": "Backup Options", + "backup_options_page_title": "Backup options", + "backup_setting_subtitle": "Manage background and foreground upload settings", + "backup_settings_subtitle": "Manage upload settings", + "backup_upload_details_page_more_details": "Tap for more details", + "backward": "Backward", + "biometric_auth_enabled": "Biometric authentication enabled", + "biometric_locked_out": "You are locked out of biometric authentication", + "biometric_no_options": "No biometric options available", + "biometric_not_available": "Biometric authentication is not available on this device", + "birthdate_saved": "Date of birth saved successfully", + "birthdate_set_description": "Date of birth is used to calculate the age of this person at the time of a photo.", + "blurred_background": "Blurred background", + "bugs_and_feature_requests": "Bugs & Feature Requests", + "build": "Build", + "build_image": "Build Image", + "bulk_delete_duplicates_confirmation": "Are you sure you want to bulk delete {count, plural, one {# duplicate asset} other {# duplicate assets}}? This will keep the largest asset of each group and permanently delete all other duplicates. You cannot undo this action!", + "bulk_keep_duplicates_confirmation": "Are you sure you want to keep {count, plural, one {# duplicate asset} other {# duplicate assets}}? This will resolve all duplicate groups without deleting anything.", + "bulk_trash_duplicates_confirmation": "Are you sure you want to bulk trash {count, plural, one {# duplicate asset} other {# duplicate assets}}? This will keep the largest asset of each group and trash all other duplicates.", + "buy": "Purchase Immich", + "cache_settings_clear_cache_button": "Clear cache", + "cache_settings_clear_cache_button_title": "Clears the app's cache. This will significantly impact the app's performance until the cache has rebuilt.", + "cache_settings_duplicated_assets_clear_button": "CLEAR", + "cache_settings_duplicated_assets_subtitle": "Photos and videos that are ignore listed by the app", + "cache_settings_duplicated_assets_title": "Duplicated Assets ({count})", + "cache_settings_statistics_album": "Library thumbnails", + "cache_settings_statistics_full": "Full images", + "cache_settings_statistics_shared": "Shared album thumbnails", + "cache_settings_statistics_thumbnail": "Thumbnails", + "cache_settings_statistics_title": "Cache usage", + "cache_settings_subtitle": "Control the caching behaviour of the Immich mobile application", + "cache_settings_tile_subtitle": "Control the local storage behaviour", + "cache_settings_tile_title": "Local Storage", + "cache_settings_title": "Caching Settings", + "camera": "Camera", + "camera_brand": "Camera brand", + "camera_model": "Camera model", + "cancel": "Cancel", + "cancel_search": "Cancel search", + "canceled": "Canceled", + "canceling": "Canceling", + "cannot_merge_people": "Cannot merge people", + "cannot_undo_this_action": "You cannot undo this action!", + "cannot_update_the_description": "Cannot update the description", + "cast": "Cast", + "cast_description": "Configure available cast destinations", + "change_date": "Change date", + "change_description": "Change description", + "change_display_order": "Change display order", + "change_expiration_time": "Change expiration time", + "change_location": "Change location", + "change_name": "Change name", + "change_name_successfully": "Changed name successfully", + "change_password": "Change Password", + "change_password_description": "This is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.", + "change_password_form_confirm_password": "Confirm Password", + "change_password_form_description": "Hi {name},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.", + "change_password_form_log_out": "Log out all other devices", + "change_password_form_log_out_description": "It is recommended to log out of all other devices", + "change_password_form_new_password": "New Password", + "change_password_form_password_mismatch": "Passwords do not match", + "change_password_form_reenter_new_password": "Re-enter New Password", + "change_pin_code": "Change PIN code", + "change_trigger": "Change trigger", + "change_trigger_prompt": "Are you sure you want to change the trigger? This will remove all existing actions and filters.", + "change_your_password": "Change your password", + "changed_visibility_successfully": "Changed visibility successfully", + "charging": "Charging", + "charging_requirement_mobile_backup": "Background backup requires the device to be charging", + "check_corrupt_asset_backup": "Check for corrupt asset backups", + "check_corrupt_asset_backup_button": "Perform check", + "check_corrupt_asset_backup_description": "Run this check only over Wi-Fi and once all assets have been backed-up. The procedure might take a few minutes.", + "check_logs": "Check Logs", + "checksum": "Checksum", + "choose_matching_people_to_merge": "Choose matching people to merge", + "city": "City", + "cleanup_confirm_description": "Immich found {count} assets (created before {date}) safely backed up to the server. Remove the local copies from this device?", + "cleanup_confirm_prompt_title": "Remove from this device?", + "cleanup_deleted_assets": "Moved {count} assets to device trash", + "cleanup_deleting": "Moving to trash...", + "cleanup_found_assets": "Found {count} backed up assets", + "cleanup_found_assets_with_size": "Found {count} backed up assets ({size})", + "cleanup_icloud_shared_albums_excluded": "iCloud Shared Albums are excluded from the scan", + "cleanup_no_assets_found": "No assets found matching the criteria above. Free Up Space can only remove assets that have been backed up to the server", + "cleanup_preview_title": "Assets to remove ({count})", + "cleanup_step3_description": "Scan for backed up assets matching your date and keep settings.", + "cleanup_step4_summary": "{count} assets (created before {date}) to remove from your local device. Photos will remain accessible from the Immich app.", + "cleanup_trash_hint": "To fully reclaim storage space, open the system gallery app and empty the trash", + "clear": "Clear", + "clear_all": "Clear all", + "clear_all_recent_searches": "Clear all recent searches", + "clear_file_cache": "Clear File Cache", + "clear_message": "Clear message", + "clear_value": "Clear value", + "client_cert_dialog_msg_confirm": "OK", + "client_cert_enter_password": "Enter Password", + "client_cert_import": "Import", + "client_cert_import_success_msg": "Client certificate is imported", + "client_cert_invalid_msg": "Invalid certificate file or wrong password", + "client_cert_password_message": "Enter the password for this certificate", + "client_cert_password_title": "Certificate Password", + "client_cert_remove_msg": "Client certificate is removed", + "client_cert_subtitle": "Supports PKCS12 (.p12, .pfx) format only. Certificate import/removal is available only before login", + "client_cert_title": "SSL client certificate [EXPERIMENTAL]", + "clockwise": "Сlockwise", + "close": "Close", + "collapse": "Collapse", + "collapse_all": "Collapse all", + "color": "Color", + "color_theme": "Color theme", + "command": "Command", + "comment_deleted": "Comment deleted", + "comment_options": "Comment options", + "comments_and_likes": "Comments & likes", + "comments_are_disabled": "Comments are disabled", + "common_create_new_album": "Create new album", + "completed": "Completed", + "confirm": "Confirm", + "confirm_admin_password": "Confirm Admin Password", + "confirm_delete_face": "Are you sure you want to delete {name} face from the asset?", + "confirm_delete_shared_link": "Are you sure you want to delete this shared link?", + "confirm_keep_this_delete_others": "All other assets in the stack will be deleted except for this asset. Are you sure you want to continue?", + "confirm_new_pin_code": "Confirm new PIN code", + "confirm_password": "Confirm password", + "confirm_tag_face": "Do you want to tag this face as {name}?", + "confirm_tag_face_unnamed": "Do you want to tag this face?", + "connected_device": "Connected device", + "connected_to": "Connected to", + "contain": "Contain", + "context": "Context", + "continue": "Continue", + "control_bottom_app_bar_create_new_album": "Create new album", + "control_bottom_app_bar_delete_from_immich": "Delete from Immich", + "control_bottom_app_bar_delete_from_local": "Delete from device", + "control_bottom_app_bar_edit_location": "Edit Location", + "control_bottom_app_bar_edit_time": "Edit Date & Time", + "control_bottom_app_bar_share_link": "Share Link", + "control_bottom_app_bar_share_to": "Share To", + "control_bottom_app_bar_trash_from_immich": "Move to Trash", + "copied_image_to_clipboard": "Copied image to clipboard.", + "copied_to_clipboard": "Copied to clipboard!", + "copy_error": "Copy error", + "copy_file_path": "Copy file path", + "copy_image": "Copy Image", + "copy_link": "Copy link", + "copy_link_to_clipboard": "Copy link to clipboard", + "copy_password": "Copy password", + "copy_to_clipboard": "Copy to Clipboard", + "country": "Country", + "cover": "Cover", + "covers": "Covers", + "create": "Create", + "create_album": "Create album", + "create_album_page_untitled": "Untitled", + "create_api_key": "Create API key", + "create_first_workflow": "Create first workflow", + "create_library": "Create Library", + "create_link": "Create link", + "create_link_to_share": "Create link to share", + "create_link_to_share_description": "Let anyone with the link see the selected photo(s)", + "create_new": "CREATE NEW", + "create_new_person": "Create new person", + "create_new_person_hint": "Assign selected assets to a new person", + "create_new_user": "Create new user", + "create_shared_album_page_share_add_assets": "ADD ASSETS", + "create_shared_album_page_share_select_photos": "Select Photos", + "create_shared_link": "Create shared link", + "create_tag": "Create tag", + "create_tag_description": "Create a new tag. For nested tags, please enter the full path of the tag including forward slashes.", + "create_user": "Create user", + "create_workflow": "Create workflow", + "created": "Created", + "created_at": "Created", + "creating_linked_albums": "Creating linked albums...", + "crop": "Crop", + "crop_aspect_ratio_fixed": "Fixed", + "crop_aspect_ratio_free": "Free", + "crop_aspect_ratio_original": "Original", + "curated_object_page_title": "Things", + "current_device": "Current device", + "current_pin_code": "Current PIN code", + "current_server_address": "Current server address", + "custom_date": "Custom date", + "custom_locale": "Custom Locale", + "custom_locale_description": "Format dates and numbers based on the language and the region", + "custom_url": "Custom URL", + "cutoff_date_description": "Keep photos from the last…", + "cutoff_day": "{count, plural, one {day} other {days}}", + "cutoff_year": "{count, plural, one {year} other {years}}", + "daily_title_text_date": "E, MMM dd", + "daily_title_text_date_year": "E, MMM dd, yyyy", + "dark": "Dark", + "dark_theme": "Toggle dark theme", + "date": "Date", + "date_after": "Date after", + "date_and_time": "Date and Time", + "date_before": "Date before", + "date_format": "E, LLL d, y • h:mm a", + "date_of_birth_saved": "Date of birth saved successfully", + "date_range": "Date range", + "day": "Day", + "days": "Days", + "deduplicate_all": "Deduplicate All", + "deduplication_criteria_1": "Image size in bytes", + "deduplication_criteria_2": "Count of EXIF data", + "deduplication_info": "Deduplication Info", + "deduplication_info_description": "To automatically preselect assets and remove duplicates in bulk, we look at:", + "default_locale": "Default Locale", + "default_locale_description": "Format dates and numbers based on your browser locale", + "delete": "Delete", + "delete_action_confirmation_message": "Are you sure you want to delete this asset? This action will move the asset to the server's trash and will prompt if you want to delete it locally", + "delete_action_prompt": "{count} deleted", + "delete_album": "Delete album", + "delete_api_key_prompt": "Are you sure you want to delete this API key?", + "delete_dialog_alert": "These items will be permanently deleted from Immich and from your device", + "delete_dialog_alert_local": "These items will be permanently removed from your device but still be available on the Immich server", + "delete_dialog_alert_local_non_backed_up": "Some of the items aren't backed up to Immich and will be permanently removed from your device", + "delete_dialog_alert_remote": "These items will be permanently deleted from the Immich server", + "delete_dialog_ok_force": "Delete Anyway", + "delete_dialog_title": "Delete Permanently", + "delete_duplicates_confirmation": "Are you sure you want to permanently delete these duplicates?", + "delete_face": "Delete face", + "delete_key": "Delete key", + "delete_library": "Delete Library", + "delete_link": "Delete link", + "delete_local_action_prompt": "{count} deleted locally", + "delete_local_dialog_ok_backed_up_only": "Delete Backed Up Only", + "delete_local_dialog_ok_force": "Delete Anyway", + "delete_others": "Delete others", + "delete_permanently": "Delete permanently", + "delete_permanently_action_prompt": "{count} deleted permanently", + "delete_shared_link": "Delete shared link", + "delete_shared_link_dialog_title": "Delete Shared Link", + "delete_tag": "Delete tag", + "delete_tag_confirmation_prompt": "Are you sure you want to delete {tagName} tag?", + "delete_user": "Delete user", + "deleted_shared_link": "Deleted shared link", + "deletes_missing_assets": "Deletes assets missing from disk", + "description": "Description", + "description_input_hint_text": "Add description...", + "description_input_submit_error": "Error updating description, check the log for more details", + "deselect_all": "Deselect All", + "details": "Details", + "direction": "Direction", + "disable": "Disable", + "disabled": "Disabled", + "disallow_edits": "Disallow edits", + "discord": "Discord", + "discover": "Discover", + "discovered_devices": "Discovered devices", + "dismiss_all_errors": "Dismiss all errors", + "dismiss_error": "Dismiss error", + "display_options": "Display options", + "display_order": "Display order", + "display_original_photos": "Display original photos", + "display_original_photos_setting_description": "Prefer to display the original photo when viewing an asset rather than thumbnails when the original asset is web-compatible. This may result in slower photo display speeds.", + "do_not_show_again": "Do not show this message again", + "documentation": "Documentation", + "done": "Done", + "download": "Download", + "download_action_prompt": "Downloading {count} assets", + "download_canceled": "Download canceled", + "download_complete": "Download complete", + "download_enqueue": "Download enqueued", + "download_error": "Download Error", + "download_failed": "Download failed", + "download_finished": "Download finished", + "download_include_embedded_motion_videos": "Embedded videos", + "download_include_embedded_motion_videos_description": "Include videos embedded in motion photos as a separate file", + "download_notfound": "Download not found", + "download_original": "Download original", + "download_paused": "Download paused", + "download_settings": "Download", + "download_settings_description": "Manage settings related to asset download", + "download_started": "Download started", + "download_sucess": "Download success", + "download_sucess_android": "The media has been downloaded to DCIM/Immich", + "download_waiting_to_retry": "Waiting to retry", + "downloading": "Downloading", + "downloading_asset_filename": "Downloading asset {filename}", + "downloading_from_icloud": "Downloading from iCloud", + "downloading_media": "Downloading media", + "drop_files_to_upload": "Drop files anywhere to upload", + "duplicates": "Duplicates", + "duplicates_description": "Resolve each group by indicating which, if any, are duplicates", + "duration": "Duration", + "edit": "Edit", + "edit_album": "Edit album", + "edit_avatar": "Edit avatar", + "edit_birthday": "Edit birthday", + "edit_date": "Edit date", + "edit_date_and_time": "Edit date and time", + "edit_date_and_time_action_prompt": "{count} date and time edited", + "edit_date_and_time_by_offset": "Change date by offset", + "edit_date_and_time_by_offset_interval": "New date range: {from} - {to}", + "edit_description": "Edit description", + "edit_description_prompt": "Please select a new description:", + "edit_exclusion_pattern": "Edit exclusion pattern", + "edit_faces": "Edit faces", + "edit_key": "Edit key", + "edit_link": "Edit link", + "edit_location": "Edit location", + "edit_location_action_prompt": "{count} location edited", + "edit_location_dialog_title": "Location", + "edit_name": "Edit name", + "edit_people": "Edit people", + "edit_tag": "Edit tag", + "edit_title": "Edit Title", + "edit_user": "Edit user", + "edit_workflow": "Edit workflow", + "editor": "Editor", + "editor_close_without_save_prompt": "The changes will not be saved", + "editor_close_without_save_title": "Close editor?", + "editor_confirm_reset_all_changes": "Are you sure you want to reset all changes?", + "editor_discard_edits_confirm": "Discard edits", + "editor_discard_edits_prompt": "You have unsaved edits. Are you sure you want to discard them?", + "editor_discard_edits_title": "Discard edits?", + "editor_edits_applied_error": "Failed to apply edits", + "editor_edits_applied_success": "Edits applied successfully", + "editor_flip_horizontal": "Flip horizontal", + "editor_flip_vertical": "Flip vertical", + "editor_orientation": "Orientation", + "editor_reset_all_changes": "Reset changes", + "editor_rotate_left": "Rotate 90° counterclockwise", + "editor_rotate_right": "Rotate 90° clockwise", + "email": "Email", + "email_notifications": "Email notifications", + "empty_folder": "This folder is empty", + "empty_trash": "Empty trash", + "empty_trash_confirmation": "Are you sure you want to empty the trash? This will remove all the assets in trash permanently from Immich.\nYou cannot undo this action!", + "enable": "Enable", + "enable_backup": "Enable Backup", + "enable_biometric_auth_description": "Enter your PIN code to enable biometric authentication", + "enabled": "Enabled", + "end_date": "End date", + "enqueued": "Enqueued", + "enter_wifi_name": "Enter Wi-Fi name", + "enter_your_pin_code": "Enter your PIN code", + "enter_your_pin_code_subtitle": "Enter your PIN code to access the locked folder", + "error": "Error", + "error_change_sort_album": "Failed to change album sort order", + "error_delete_face": "Error deleting face from asset", + "error_getting_places": "Error getting places", + "error_loading_albums": "Error loading albums", + "error_loading_image": "Error loading image", + "error_loading_partners": "Error loading partners: {error}", + "error_retrieving_asset_information": "Error retrieving asset information", + "error_saving_image": "Error: {error}", + "error_tag_face_bounding_box": "Error tagging face - cannot get bounding box coordinates", + "error_title": "Error - Something went wrong", + "error_while_navigating": "Error while navigating to asset", + "errors": { + "cannot_navigate_next_asset": "Cannot navigate to the next asset", + "cannot_navigate_previous_asset": "Cannot navigate to previous asset", + "cant_apply_changes": "Can't apply changes", + "cant_change_activity": "Can't {enabled, select, true {disable} other {enable}} activity", + "cant_change_asset_favorite": "Can't change favorite for asset", + "cant_change_metadata_assets_count": "Can't change metadata of {count, plural, one {# asset} other {# assets}}", + "cant_get_faces": "Can't get faces", + "cant_get_number_of_comments": "Can't get number of comments", + "cant_search_people": "Can't search people", + "cant_search_places": "Can't search places", + "error_adding_assets_to_album": "Error adding assets to album", + "error_adding_users_to_album": "Error adding users to album", + "error_deleting_shared_user": "Error deleting shared user", + "error_downloading": "Error downloading {filename}", + "error_hiding_buy_button": "Error hiding buy button", + "error_removing_assets_from_album": "Error removing assets from album, check console for more details", + "error_selecting_all_assets": "Error selecting all assets", + "exclusion_pattern_already_exists": "This exclusion pattern already exists.", + "failed_to_create_album": "Failed to create album", + "failed_to_create_shared_link": "Failed to create shared link", + "failed_to_edit_shared_link": "Failed to edit shared link", + "failed_to_get_people": "Failed to get people", + "failed_to_keep_this_delete_others": "Failed to keep this asset and delete the other assets", + "failed_to_load_asset": "Failed to load asset", + "failed_to_load_assets": "Failed to load assets", + "failed_to_load_notifications": "Failed to load notifications", + "failed_to_load_people": "Failed to load people", + "failed_to_remove_product_key": "Failed to remove product key", + "failed_to_reset_pin_code": "Failed to reset PIN code", + "failed_to_stack_assets": "Failed to stack assets", + "failed_to_unstack_assets": "Failed to un-stack assets", + "failed_to_update_notification_status": "Failed to update notification status", + "incorrect_email_or_password": "Incorrect email or password", + "library_folder_already_exists": "This import path already exists.", + "paths_validation_failed": "{paths, plural, one {# path} other {# paths}} failed validation", + "profile_picture_transparent_pixels": "Profile pictures cannot have transparent pixels. Please zoom in and/or move the image.", + "quota_higher_than_disk_size": "You set a quota higher than the disk size", + "something_went_wrong": "Something went wrong", + "unable_to_add_album_users": "Unable to add users to album", + "unable_to_add_assets_to_shared_link": "Unable to add assets to shared link", + "unable_to_add_comment": "Unable to add comment", + "unable_to_add_exclusion_pattern": "Unable to add exclusion pattern", + "unable_to_add_partners": "Unable to add partners", + "unable_to_add_remove_archive": "Unable to {archived, select, true {remove asset from} other {add asset to}} archive", + "unable_to_add_remove_favorites": "Unable to {favorite, select, true {add asset to} other {remove asset from}} favorites", + "unable_to_archive_unarchive": "Unable to {archived, select, true {archive} other {unarchive}}", + "unable_to_change_album_user_role": "Unable to change the album user's role", + "unable_to_change_date": "Unable to change date", + "unable_to_change_description": "Unable to change description", + "unable_to_change_favorite": "Unable to change favorite for asset", + "unable_to_change_location": "Unable to change location", + "unable_to_change_password": "Unable to change password", + "unable_to_change_visibility": "Unable to change the visibility for {count, plural, one {# person} other {# people}}", + "unable_to_complete_oauth_login": "Unable to complete OAuth login", + "unable_to_connect": "Unable to connect", + "unable_to_copy_to_clipboard": "Cannot copy to clipboard, make sure you are accessing the page through https", + "unable_to_create": "Unable to create workflow", + "unable_to_create_admin_account": "Unable to create admin account", + "unable_to_create_api_key": "Unable to create a new API Key", + "unable_to_create_library": "Unable to create library", + "unable_to_create_user": "Unable to create user", + "unable_to_delete_album": "Unable to delete album", + "unable_to_delete_asset": "Unable to delete asset", + "unable_to_delete_assets": "Error deleting assets", + "unable_to_delete_exclusion_pattern": "Unable to delete exclusion pattern", + "unable_to_delete_shared_link": "Unable to delete shared link", + "unable_to_delete_user": "Unable to delete user", + "unable_to_delete_workflow": "Unable to delete workflow", + "unable_to_download_files": "Unable to download files", + "unable_to_edit_exclusion_pattern": "Unable to edit exclusion pattern", + "unable_to_empty_trash": "Unable to empty trash", + "unable_to_enter_fullscreen": "Unable to enter fullscreen", + "unable_to_exit_fullscreen": "Unable to exit fullscreen", + "unable_to_get_comments_number": "Unable to get number of comments", + "unable_to_get_shared_link": "Failed to get shared link", + "unable_to_hide_person": "Unable to hide person", + "unable_to_link_motion_video": "Unable to link motion video", + "unable_to_link_oauth_account": "Unable to link OAuth account", + "unable_to_log_out_all_devices": "Unable to log out all devices", + "unable_to_log_out_device": "Unable to log out device", + "unable_to_login_with_oauth": "Unable to login with OAuth", + "unable_to_play_video": "Unable to play video", + "unable_to_reassign_assets_existing_person": "Unable to reassign assets to {name, select, null {an existing person} other {{name}}}", + "unable_to_reassign_assets_new_person": "Unable to reassign assets to a new person", + "unable_to_refresh_user": "Unable to refresh user", + "unable_to_remove_album_users": "Unable to remove users from album", + "unable_to_remove_api_key": "Unable to remove API Key", + "unable_to_remove_assets_from_shared_link": "Unable to remove assets from shared link", + "unable_to_remove_library": "Unable to remove library", + "unable_to_remove_partner": "Unable to remove partner", + "unable_to_remove_reaction": "Unable to remove reaction", + "unable_to_reset_password": "Unable to reset password", + "unable_to_reset_pin_code": "Unable to reset PIN code", + "unable_to_resolve_duplicate": "Unable to resolve duplicate", + "unable_to_restore_assets": "Unable to restore assets", + "unable_to_restore_trash": "Unable to restore trash", + "unable_to_restore_user": "Unable to restore user", + "unable_to_save_album": "Unable to save album", + "unable_to_save_api_key": "Unable to save API Key", + "unable_to_save_date_of_birth": "Unable to save date of birth", + "unable_to_save_name": "Unable to save name", + "unable_to_save_profile": "Unable to save profile", + "unable_to_save_settings": "Unable to save settings", + "unable_to_scan_libraries": "Unable to scan libraries", + "unable_to_scan_library": "Unable to scan library", + "unable_to_set_feature_photo": "Unable to set feature photo", + "unable_to_set_profile_picture": "Unable to set profile picture", + "unable_to_set_rating": "Unable to set rating", + "unable_to_submit_job": "Unable to submit job", + "unable_to_trash_asset": "Unable to trash asset", + "unable_to_unlink_account": "Unable to unlink account", + "unable_to_unlink_motion_video": "Unable to unlink motion video", + "unable_to_update_album_cover": "Unable to update album cover", + "unable_to_update_album_info": "Unable to update album info", + "unable_to_update_library": "Unable to update library", + "unable_to_update_location": "Unable to update location", + "unable_to_update_settings": "Unable to update settings", + "unable_to_update_timeline_display_status": "Unable to update timeline display status", + "unable_to_update_user": "Unable to update user", + "unable_to_update_workflow": "Unable to update workflow", + "unable_to_upload_file": "Unable to upload file" + }, + "errors_text": "Errors", + "exclusion_pattern": "Exclusion pattern", + "exif": "Exif", + "exif_bottom_sheet_description": "Add Description...", + "exif_bottom_sheet_description_error": "Error updating description", + "exif_bottom_sheet_details": "DETAILS", + "exif_bottom_sheet_location": "LOCATION", + "exif_bottom_sheet_no_description": "No description", + "exif_bottom_sheet_people": "PEOPLE", + "exif_bottom_sheet_person_add_person": "Add name", + "exit_slideshow": "Exit Slideshow", + "expand_all": "Expand all", + "experimental_settings_new_asset_list_subtitle": "Work in progress", + "experimental_settings_new_asset_list_title": "Enable experimental photo grid", + "experimental_settings_subtitle": "Use at your own risk!", + "experimental_settings_title": "Experimental", + "expire_after": "Expire after", + "expired": "Expired", + "expires_date": "Expires {date}", + "explore": "Explore", + "explorer": "Explorer", + "export": "Export", + "export_as_json": "Export as JSON", + "export_database": "Export Database", + "export_database_description": "Export the SQLite database", + "extension": "Extension", + "external": "External", + "external_libraries": "External Libraries", + "external_network": "External network", + "external_network_sheet_info": "When not on the preferred Wi-Fi network, the app will connect to the server through the first of the below URLs it can reach, starting from top to bottom", + "face_unassigned": "Unassigned", + "failed": "Failed", + "failed_count": "Failed: {count}", + "failed_to_authenticate": "Failed to authenticate", + "failed_to_load_assets": "Failed to load assets", + "failed_to_load_folder": "Failed to load folder", + "favorite": "Favorite", + "favorite_action_prompt": "{count} added to Favorites", + "favorite_or_unfavorite_photo": "Favorite or unfavorite photo", + "favorites": "Favorites", + "favorites_page_no_favorites": "No favorite assets found", + "feature_photo_updated": "Feature photo updated", + "features": "Features", + "features_in_development": "Features in Development", + "features_setting_description": "Manage the app features", + "file_name_or_extension": "File name or extension", + "file_name_text": "File name", + "file_name_with_value": "File name: {file_name}", + "file_size": "File size", + "filename": "Filename", + "filetype": "Filetype", + "filter": "Filter", + "filter_description": "Conditions to filter the target assets", + "filter_people": "Filter people", + "filter_places": "Filter places", + "filters": "Filters", + "find_them_fast": "Find them fast by name with search", + "first": "First", + "fix_incorrect_match": "Fix incorrect match", + "folder": "Folder", + "folder_not_found": "Folder not found", + "folders": "Folders", + "folders_feature_description": "Browsing the folder view for the photos and videos on the file system", + "forgot_pin_code_question": "Forgot your PIN?", + "forward": "Forward", + "free_up_space": "Free Up Space", + "free_up_space_description": "Move backed-up photos and videos to your device's trash to free up space. Your copies on the server remain safe.", + "free_up_space_settings_subtitle": "Free up device storage", + "full_path": "Full path: {path}", + "gcast_enabled": "Google Cast", + "gcast_enabled_description": "This feature loads external resources from Google in order to work.", + "general": "General", + "geolocation_instruction_location": "Click on an asset with GPS coordinates to use its location, or select a location directly from the map", + "get_help": "Get Help", + "get_people_error": "Error getting people", + "get_wifiname_error": "Could not get Wi-Fi name. Make sure you have granted the necessary permissions and are connected to a Wi-Fi network", "getting_started": "Getting Started", - "welcome": "Welcome" + "go_back": "Go back", + "go_to_folder": "Go to folder", + "go_to_search": "Go to search", + "gps": "GPS", + "gps_missing": "No GPS", + "grant_permission": "Grant permission", + "group_albums_by": "Group albums by...", + "group_country": "Group by country", + "group_no": "No grouping", + "group_owner": "Group by owner", + "group_places_by": "Group places by...", + "group_year": "Group by year", + "haptic_feedback_switch": "Enable haptic feedback", + "haptic_feedback_title": "Haptic Feedback", + "has_quota": "Has quota", + "hash_asset": "Hash asset", + "hashed_assets": "Hashed assets", + "hashing": "Hashing", + "header_settings_add_header_tip": "Add header", + "header_settings_field_validator_msg": "Value cannot be empty", + "header_settings_header_name_input": "Header name", + "header_settings_header_value_input": "Header value", + "headers_settings_tile_title": "Custom proxy headers", + "height": "Height", + "hi_user": "Hi {name} ({email})", + "hide_all_people": "Hide all people", + "hide_gallery": "Hide gallery", + "hide_named_person": "Hide person {name}", + "hide_password": "Hide password", + "hide_person": "Hide person", + "hide_schema": "Hide schema", + "hide_text_recognition": "Hide text recognition", + "hide_unnamed_people": "Hide unnamed people", + "home_page_add_to_album_conflicts": "Added {added} assets to album {album}. {failed} assets are already in the album.", + "home_page_add_to_album_err_local": "Can not add local assets to albums yet, skipping", + "home_page_add_to_album_success": "Added {added} assets to album {album}.", + "home_page_album_err_partner": "Can not add partner assets to an album yet, skipping", + "home_page_archive_err_local": "Can not archive local assets yet, skipping", + "home_page_archive_err_partner": "Can not archive partner assets, skipping", + "home_page_building_timeline": "Building the timeline", + "home_page_delete_err_partner": "Can not delete partner assets, skipping", + "home_page_delete_remote_err_local": "Local assets in delete remote selection, skipping", + "home_page_favorite_err_local": "Can not favorite local assets yet, skipping", + "home_page_favorite_err_partner": "Can not favorite partner assets yet, skipping", + "home_page_first_time_notice": "If this is your first time using the app, please make sure to choose a backup album so that the timeline can populate photos and videos in it", + "home_page_locked_error_local": "Can not move local assets to locked folder, skipping", + "home_page_locked_error_partner": "Can not move partner assets to locked folder, skipping", + "home_page_share_err_local": "Can not share local assets via link, skipping", + "home_page_upload_err_limit": "Can only upload a maximum of 30 assets at a time, skipping", + "host": "Host", + "hour": "Hour", + "hours": "Hours", + "id": "ID", + "idle": "Idle", + "ignore_icloud_photos": "Ignore iCloud photos", + "ignore_icloud_photos_description": "Photos that are stored on iCloud will not be uploaded to the Immich server", + "image": "Image", + "image_alt_text_date": "{isVideo, select, true {Video} other {Image}} taken on {date}", + "image_alt_text_date_1_person": "{isVideo, select, true {Video} other {Image}} taken with {person1} on {date}", + "image_alt_text_date_2_people": "{isVideo, select, true {Video} other {Image}} taken with {person1} and {person2} on {date}", + "image_alt_text_date_3_people": "{isVideo, select, true {Video} other {Image}} taken with {person1}, {person2}, and {person3} on {date}", + "image_alt_text_date_4_or_more_people": "{isVideo, select, true {Video} other {Image}} taken with {person1}, {person2}, and {additionalCount, number} others on {date}", + "image_alt_text_date_place": "{isVideo, select, true {Video} other {Image}} taken in {city}, {country} on {date}", + "image_alt_text_date_place_1_person": "{isVideo, select, true {Video} other {Image}} taken in {city}, {country} with {person1} on {date}", + "image_alt_text_date_place_2_people": "{isVideo, select, true {Video} other {Image}} taken in {city}, {country} with {person1} and {person2} on {date}", + "image_alt_text_date_place_3_people": "{isVideo, select, true {Video} other {Image}} taken in {city}, {country} with {person1}, {person2}, and {person3} on {date}", + "image_alt_text_date_place_4_or_more_people": "{isVideo, select, true {Video} other {Image}} taken in {city}, {country} with {person1}, {person2}, and {additionalCount, number} others on {date}", + "image_saved_successfully": "Image saved", + "image_viewer_page_state_provider_download_started": "Download Started", + "image_viewer_page_state_provider_download_success": "Download Success", + "image_viewer_page_state_provider_share_error": "Share Error", + "immich_logo": "Immich Logo", + "immich_web_interface": "Immich Web Interface", + "import_from_json": "Import from JSON", + "import_path": "Import path", + "in_albums": "In {count, plural, one {# album} other {# albums}}", + "in_archive": "In archive", + "in_year": "In {year}", + "in_year_selector": "In", + "include_archived": "Include archived", + "include_shared_albums": "Include shared albums", + "include_shared_partner_assets": "Include shared partner assets", + "individual_share": "Individual share", + "individual_shares": "Individual shares", + "info": "Info", + "interval": { + "day_at_onepm": "Every day at 1pm", + "hours": "Every {hours, plural, one {hour} other {{hours, number} hours}}", + "night_at_midnight": "Every night at midnight", + "night_at_twoam": "Every night at 2am" + }, + "invalid_date": "Invalid date", + "invalid_date_format": "Invalid date format", + "invite_people": "Invite People", + "invite_to_album": "Invite to album", + "ios_debug_info_fetch_ran_at": "Fetch ran {dateTime}", + "ios_debug_info_last_sync_at": "Last sync {dateTime}", + "ios_debug_info_no_processes_queued": "No background processes queued", + "ios_debug_info_no_sync_yet": "No background sync job has run yet", + "ios_debug_info_processes_queued": "{count, plural, one {{count} background process queued} other {{count} background processes queued}}", + "ios_debug_info_processing_ran_at": "Processing ran {dateTime}", + "items_count": "{count, plural, one {# item} other {# items}}", + "jobs": "Jobs", + "json_editor": "JSON editor", + "json_error": "JSON error", + "keep": "Keep", + "keep_albums": "Keep albums", + "keep_albums_count": "Keeping {count} {count, plural, one {album} other {albums}}", + "keep_all": "Keep All", + "keep_description": "Choose what stays on your device when freeing up space.", + "keep_favorites": "Keep favorites", + "keep_on_device": "Keep on device", + "keep_on_device_hint": "Select items to keep on this device", + "keep_this_delete_others": "Keep this, delete others", + "keeping": "Keeping: {items}", + "kept_this_deleted_others": "Kept this asset and deleted {count, plural, one {# asset} other {# assets}}", + "keyboard_shortcuts": "Keyboard shortcuts", + "language": "Language", + "language_no_results_subtitle": "Try adjusting your search term", + "language_no_results_title": "No languages found", + "language_search_hint": "Search languages...", + "language_setting_description": "Select your preferred language", + "large_files": "Large Files", + "last": "Last", + "last_months": "{count, plural, one {Last month} other {Last # months}}", + "last_seen": "Last seen", + "latest_version": "Latest Version", + "latitude": "Latitude", + "leave": "Leave", + "leave_album": "Leave album", + "lens_model": "Lens model", + "let_others_respond": "Let others respond", + "level": "Level", + "library": "Library", + "library_add_folder": "Add folder", + "library_edit_folder": "Edit folder", + "library_options": "Library options", + "library_page_device_albums": "Albums on Device", + "library_page_new_album": "New album", + "library_page_sort_asset_count": "Number of assets", + "library_page_sort_created": "Created date", + "library_page_sort_last_modified": "Last modified", + "library_page_sort_title": "Album title", + "licenses": "Licenses", + "light": "Light", + "like": "Like", + "like_deleted": "Like deleted", + "link_motion_video": "Link motion video", + "link_to_oauth": "Link to OAuth", + "linked_oauth_account": "Linked OAuth account", + "list": "List", + "loading": "Loading", + "loading_search_results_failed": "Loading search results failed", + "local": "Local", + "local_asset_cast_failed": "Unable to cast an asset that is not uploaded to the server", + "local_assets": "Local Assets", + "local_id": "Local ID", + "local_media_summary": "Local Media Summary", + "local_network": "Local network", + "local_network_sheet_info": "The app will connect to the server through this URL when using the specified Wi-Fi network", + "location": "Location", + "location_permission": "Location permission", + "location_permission_content": "In order to use the auto-switching feature, Immich needs precise location permission so it can read the current Wi-Fi network's name", + "location_picker_choose_on_map": "Choose on map", + "location_picker_latitude_error": "Enter a valid latitude", + "location_picker_latitude_hint": "Enter your latitude here", + "location_picker_longitude_error": "Enter a valid longitude", + "location_picker_longitude_hint": "Enter your longitude here", + "lock": "Lock", + "locked_folder": "Locked Folder", + "log_detail_title": "Log Detail", + "log_out": "Log out", + "log_out_all_devices": "Log Out All Devices", + "logged_in_as": "Logged in as {user}", + "logged_out_all_devices": "Logged out all devices", + "logged_out_device": "Logged out device", + "login": "Login", + "login_disabled": "Login has been disabled", + "login_form_api_exception": "API exception. Please check the server URL and try again.", + "login_form_back_button_text": "Back", + "login_form_email_hint": "youremail@email.com", + "login_form_endpoint_hint": "http://your-server-ip:port", + "login_form_endpoint_url": "Server Endpoint URL", + "login_form_err_http": "Please specify http:// or https://", + "login_form_err_invalid_email": "Invalid Email", + "login_form_err_invalid_url": "Invalid URL", + "login_form_err_leading_whitespace": "Leading whitespace", + "login_form_err_trailing_whitespace": "Trailing whitespace", + "login_form_failed_get_oauth_server_config": "Error logging using OAuth, check server URL", + "login_form_failed_get_oauth_server_disable": "OAuth feature is not available on this server", + "login_form_failed_login": "Error logging you in, check server URL, email and password", + "login_form_handshake_exception": "There was an Handshake Exception with the server. Enable self-signed certificate support in the settings if you are using a self-signed certificate.", + "login_form_password_hint": "password", + "login_form_save_login": "Stay logged in", + "login_form_server_empty": "Enter a server URL.", + "login_form_server_error": "Could not connect to server.", + "login_has_been_disabled": "Login has been disabled.", + "login_password_changed_error": "There was an error updating your password", + "login_password_changed_success": "Password updated successfully", + "logout_all_device_confirmation": "Are you sure you want to log out all devices?", + "logout_this_device_confirmation": "Are you sure you want to log out this device?", + "logs": "Logs", + "longitude": "Longitude", + "look": "Look", + "loop_videos": "Loop videos", + "loop_videos_description": "Enable to automatically loop a video in the detail viewer.", + "main_branch_warning": "You're using a development version; we strongly recommend using a release version!", + "main_menu": "Main menu", + "maintenance_action_restore": "Restoring Database", + "maintenance_description": "Immich has been put into maintenance mode.", + "maintenance_end": "End maintenance mode", + "maintenance_end_error": "Failed to end maintenance mode.", + "maintenance_logged_in_as": "Currently logged in as {user}", + "maintenance_restore_from_backup": "Restore From Backup", + "maintenance_restore_library": "Restore Your Library", + "maintenance_restore_library_confirm": "If this looks correct, continue to restoring a backup!", + "maintenance_restore_library_description": "Restoring Database", + "maintenance_restore_library_folder_has_files": "{folder} has {count} folder(s)", + "maintenance_restore_library_folder_no_files": "{folder} is missing files!", + "maintenance_restore_library_folder_pass": "readable and writable", + "maintenance_restore_library_folder_read_fail": "not readable", + "maintenance_restore_library_folder_write_fail": "not writable", + "maintenance_restore_library_hint_missing_files": "You may be missing important files", + "maintenance_restore_library_hint_regenerate_later": "You can regenerate these later in settings", + "maintenance_restore_library_hint_storage_template_missing_files": "Using storage template? You may be missing files", + "maintenance_restore_library_loading": "Loading integrity checks and heuristics…", + "maintenance_task_backup": "Creating a backup of the existing database…", + "maintenance_task_migrations": "Running database migrations…", + "maintenance_task_restore": "Restoring the chosen backup…", + "maintenance_task_rollback": "Restore failed, rolling back to restore point…", + "maintenance_title": "Temporarily Unavailable", + "make": "Make", + "manage_geolocation": "Manage location", + "manage_media_access_rationale": "This permission is required for proper handling of moving assets to the trash and restoring them from it.", + "manage_media_access_settings": "Open settings", + "manage_media_access_subtitle": "Allow the Immich app to manage and move media files.", + "manage_media_access_title": "Media Management Access", + "manage_shared_links": "Manage shared links", + "manage_sharing_with_partners": "Manage sharing with partners", + "manage_the_app_settings": "Manage the app settings", + "manage_your_account": "Manage your account", + "manage_your_api_keys": "Manage your API keys", + "manage_your_devices": "Manage your logged-in devices", + "manage_your_oauth_connection": "Manage your OAuth connection", + "map": "Map", + "map_assets_in_bounds": "{count, plural, =0 {No photos in this area} one {# photo} other {# photos}}", + "map_cannot_get_user_location": "Cannot get user's location", + "map_location_dialog_yes": "Yes", + "map_location_picker_page_use_location": "Use this location", + "map_location_service_disabled_content": "Location service needs to be enabled to display assets from your current location. Do you want to enable it now?", + "map_location_service_disabled_title": "Location Service disabled", + "map_marker_for_images": "Map marker for images taken in {city}, {country}", + "map_marker_with_image": "Map marker with image", + "map_no_location_permission_content": "Location permission is needed to display assets from your current location. Do you want to allow it now?", + "map_no_location_permission_title": "Location Permission denied", + "map_settings": "Map settings", + "map_settings_dark_mode": "Dark mode", + "map_settings_date_range_option_day": "Past 24 hours", + "map_settings_date_range_option_days": "Past {days} days", + "map_settings_date_range_option_year": "Past year", + "map_settings_date_range_option_years": "Past {years} years", + "map_settings_dialog_title": "Map Settings", + "map_settings_include_show_archived": "Include Archived", + "map_settings_include_show_partners": "Include Partners", + "map_settings_only_show_favorites": "Show Favorite Only", + "map_settings_theme_settings": "Map Theme", + "map_zoom_to_see_photos": "Zoom out to see photos", + "mark_all_as_read": "Mark all as read", + "mark_as_read": "Mark as read", + "marked_all_as_read": "Marked all as read", + "matches": "Matches", + "matching_assets": "Matching Assets", + "media_type": "Media type", + "memories": "Memories", + "memories_all_caught_up": "All caught up", + "memories_check_back_tomorrow": "Check back tomorrow for more memories", + "memories_setting_description": "Manage what you see in your memories", + "memories_start_over": "Start Over", + "memories_swipe_to_close": "Swipe up to close", + "memory": "Memory", + "memory_lane_title": "Memory Lane {title}", + "menu": "Menu", + "merge": "Merge", + "merge_people": "Merge people", + "merge_people_limit": "You can only merge up to 5 faces at a time", + "merge_people_prompt": "Do you want to merge these people? This action is irreversible.", + "merge_people_successfully": "Merge people successfully", + "merged_people_count": "Merged {count, plural, one {# person} other {# people}}", + "minimize": "Minimize", + "minute": "Minute", + "minutes": "Minutes", + "mirror_horizontal": "Horizontal", + "mirror_vertical": "Vertical", + "missing": "Missing", + "mobile_app": "Mobile App", + "mobile_app_download_onboarding_note": "Download the companion mobile app using the following options", + "model": "Model", + "month": "Month", + "monthly_title_text_date_format": "MMMM y", + "more": "More", + "move": "Move", + "move_down": "Move down", + "move_off_locked_folder": "Move out of locked folder", + "move_to": "Move to", + "move_to_device_trash": "Move to device trash", + "move_to_lock_folder_action_prompt": "{count} added to the locked folder", + "move_to_locked_folder": "Move to locked folder", + "move_to_locked_folder_confirmation": "These photos and video will be removed from all albums, and only viewable from the locked folder", + "move_up": "Move up", + "moved_to_archive": "Moved {count, plural, one {# asset} other {# assets}} to archive", + "moved_to_library": "Moved {count, plural, one {# asset} other {# assets}} to library", + "moved_to_trash": "Moved to trash", + "multiselect_grid_edit_date_time_err_read_only": "Cannot edit date of read only asset(s), skipping", + "multiselect_grid_edit_gps_err_read_only": "Cannot edit location of read only asset(s), skipping", + "mute_memories": "Mute Memories", + "my_albums": "My albums", + "name": "Name", + "name_or_nickname": "Name or nickname", + "name_required": "Name is required", + "navigate": "Navigate", + "navigate_to_time": "Navigate to Time", + "network_requirement_photos_upload": "Use cellular data to backup photos", + "network_requirement_videos_upload": "Use cellular data to backup videos", + "network_requirements": "Network Requirements", + "network_requirements_updated": "Network requirements changed, resetting backup queue", + "networking_settings": "Networking", + "networking_subtitle": "Manage the server endpoint settings", + "never": "Never", + "new_album": "New Album", + "new_api_key": "New API Key", + "new_date_range": "New date range", + "new_password": "New password", + "new_person": "New person", + "new_pin_code": "New PIN code", + "new_pin_code_subtitle": "This is your first time accessing the locked folder. Create a PIN code to securely access this page", + "new_timeline": "New Timeline", + "new_update": "New update", + "new_user_created": "New user created", + "new_version_available": "NEW VERSION AVAILABLE", + "newest_first": "Newest first", + "next": "Next", + "next_memory": "Next memory", + "no": "No", + "no_actions_added": "No actions added yet", + "no_albums_found": "No albums found", + "no_albums_message": "Create an album to organize your photos and videos", + "no_albums_with_name_yet": "It looks like you do not have any albums with this name yet.", + "no_albums_yet": "It looks like you do not have any albums yet.", + "no_archived_assets_message": "Archive photos and videos to hide them from your Photos view", + "no_assets_message": "Click to upload your first photo", + "no_assets_to_show": "No assets to show", + "no_cast_devices_found": "No cast devices found", + "no_checksum_local": "No checksum available - cannot fetch local assets", + "no_checksum_remote": "No checksum available - cannot fetch remote asset", + "no_configuration_needed": "No configuration needed", + "no_devices": "No authorized devices", + "no_duplicates_found": "No duplicates were found.", + "no_exif_info_available": "No exif info available", + "no_explore_results_message": "Upload more photos to explore your collection.", + "no_favorites_message": "Add favorites to quickly find your best pictures and videos", + "no_filters_added": "No filters added yet", + "no_libraries_message": "Create an external library to view your photos and videos", + "no_local_assets_found": "No local assets found with this checksum", + "no_location_set": "No location set", + "no_locked_photos_message": "Photos and videos in the locked folder are hidden and won't show up as you browse or search your library.", + "no_name": "No Name", + "no_notifications": "No notifications", + "no_people_found": "No matching people found", + "no_places": "No places", + "no_remote_assets_found": "No remote assets found with this checksum", + "no_results": "No results", + "no_results_description": "Try a synonym or more general keyword", + "no_shared_albums_message": "Create an album to share photos and videos with people in your network", + "no_uploads_in_progress": "No uploads in progress", + "none": "None", + "not_allowed": "Not allowed", + "not_available": "N/A", + "not_in_any_album": "Not in any album", + "not_selected": "Not selected", + "note_apply_storage_label_to_previously_uploaded assets": "Note: To apply the Storage Label to previously uploaded assets, run the", + "notes": "Notes", + "nothing_here_yet": "Nothing here yet", + "notification_permission_dialog_content": "To enable notifications, go to Settings and select allow.", + "notification_permission_list_tile_content": "Grant permission to enable notifications.", + "notification_permission_list_tile_enable_button": "Enable Notifications", + "notification_permission_list_tile_title": "Notification Permission", + "notification_toggle_setting_description": "Enable email notifications", + "notifications": "Notifications", + "notifications_setting_description": "Manage notifications", + "oauth": "OAuth", + "obtainium_configurator": "Obtainium Configurator", + "obtainium_configurator_instructions": "Use Obtainium to install and update the Android app directly from Immich GitHub's release. Create an API key and select a variant to create your Obtainium configuration link", + "ocr": "OCR", + "official_immich_resources": "Official Immich Resources", + "offline": "Offline", + "offset": "Offset", + "ok": "Ok", + "oldest_first": "Oldest first", + "on_this_device": "On this device", + "onboarding": "Onboarding", + "onboarding_locale_description": "Select your preferred language. You can change this later in your settings.", + "onboarding_privacy_description": "The following (optional) features rely on external services, and can be disabled at any time in settings.", + "onboarding_server_welcome_description": "Let's get your instance set up with some common settings.", + "onboarding_theme_description": "Choose a color theme for your instance. You can change this later in your settings.", + "onboarding_user_welcome_description": "Let's get you started!", + "onboarding_welcome_user": "Welcome, {user}", + "online": "Online", + "only_favorites": "Only favorites", + "open": "Open", + "open_in_map_view": "Open in map view", + "open_in_openstreetmap": "Open in OpenStreetMap", + "open_the_search_filters": "Open the search filters", + "options": "Options", + "or": "or", + "organize_into_albums": "Organize into albums", + "organize_into_albums_description": "Put existing photos into albums using current sync settings", + "organize_your_library": "Organize your library", + "original": "original", + "other": "Other", + "other_devices": "Other devices", + "other_entities": "Other entities", + "other_variables": "Other variables", + "owned": "Owned", + "owner": "Owner", + "page": "Page", + "partner": "Partner", + "partner_can_access": "{partner} can access", + "partner_can_access_assets": "All your photos and videos except those in Archived and Deleted", + "partner_can_access_location": "The location where your photos were taken", + "partner_list_user_photos": "{user}'s photos", + "partner_list_view_all": "View all", + "partner_page_empty_message": "Your photos are not yet shared with any partner.", + "partner_page_no_more_users": "No more users to add", + "partner_page_partner_add_failed": "Failed to add partner", + "partner_page_select_partner": "Select partner", + "partner_page_shared_to_title": "Shared to", + "partner_page_stop_sharing_content": "{partner} will no longer be able to access your photos.", + "partner_sharing": "Partner Sharing", + "partners": "Partners", + "password": "Password", + "password_does_not_match": "Password does not match", + "password_required": "Password Required", + "password_reset_success": "Password reset success", + "past_durations": { + "days": "Past {days, plural, one {day} other {# days}}", + "hours": "Past {hours, plural, one {hour} other {# hours}}", + "years": "Past {years, plural, one {year} other {# years}}" + }, + "path": "Path", + "pattern": "Pattern", + "pause": "Pause", + "pause_memories": "Pause memories", + "paused": "Paused", + "pending": "Pending", + "people": "People", + "people_edits_count": "Edited {count, plural, one {# person} other {# people}}", + "people_feature_description": "Browsing photos and videos grouped by people", + "people_selected": "{count, plural, one {# person selected} other {# people selected}}", + "people_sidebar_description": "Display a link to People in the sidebar", + "permanent_deletion_warning": "Permanent deletion warning", + "permanent_deletion_warning_setting_description": "Show a warning when permanently deleting assets", + "permanently_delete": "Permanently delete", + "permanently_delete_assets_count": "Permanently delete {count, plural, one {asset} other {assets}}", + "permanently_delete_assets_prompt": "Are you sure you want to permanently delete {count, plural, one {this asset?} other {these # assets?}} This will also remove {count, plural, one {it from its} other {them from their}} album(s).", + "permanently_deleted_asset": "Permanently deleted asset", + "permanently_deleted_assets_count": "Permanently deleted {count, plural, one {# asset} other {# assets}}", + "permission": "Permission", + "permission_empty": "Your permission shouldn't be empty", + "permission_onboarding_back": "Back", + "permission_onboarding_continue_anyway": "Continue anyway", + "permission_onboarding_get_started": "Get started", + "permission_onboarding_go_to_settings": "Go to settings", + "permission_onboarding_permission_denied": "Permission denied. To use Immich, grant photo and video permissions in Settings.", + "permission_onboarding_permission_granted": "Permission granted! You are all set.", + "permission_onboarding_permission_limited": "Permission limited. To let Immich backup and manage your entire gallery collection, grant photo and video permissions in Settings.", + "permission_onboarding_request": "Immich requires permission to view your photos and videos.", + "person": "Person", + "person_age_months": "{months, plural, one {# month} other {# months}} old", + "person_age_year_months": "1 year, {months, plural, one {# month} other {# months}} old", + "person_age_years": "{years, plural, other {# years}} old", + "person_birthdate": "Born on {date}", + "person_hidden": "{name}{hidden, select, true { (hidden)} other {}}", + "person_recognized": "Person recognized", + "person_selected": "Person selected", + "photo_shared_all_users": "Looks like you shared your photos with all users or you don't have any user to share with.", + "photos": "Photos", + "photos_and_videos": "Photos & Videos", + "photos_count": "{count, plural, one {{count, number} Photo} other {{count, number} Photos}}", + "photos_from_previous_years": "Photos from previous years", + "photos_only": "Photos only", + "pick_a_location": "Pick a location", + "pick_custom_range": "Custom range", + "pick_date_range": "Select a date range", + "pin_code_changed_successfully": "Successfully changed PIN code", + "pin_code_reset_successfully": "Successfully reset PIN code", + "pin_code_setup_successfully": "Successfully setup a PIN code", + "pin_verification": "PIN code verification", + "place": "Place", + "places": "Places", + "places_count": "{count, plural, one {{count, number} Place} other {{count, number} Places}}", + "play": "Play", + "play_memories": "Play memories", + "play_motion_photo": "Play Motion Photo", + "play_or_pause_video": "Play or pause video", + "play_original_video": "Play original video", + "play_original_video_setting_description": "Prefer playback of original videos rather than transcoded videos. If original asset is not compatible it may not playback correctly.", + "play_transcoded_video": "Play transcoded video", + "please_auth_to_access": "Please authenticate to access", + "port": "Port", + "preferences_settings_subtitle": "Manage the app's preferences", + "preferences_settings_title": "Preferences", + "preparing": "Preparing", + "preset": "Preset", + "preview": "Preview", + "previous": "Previous", + "previous_memory": "Previous memory", + "previous_or_next_day": "Day forward/back", + "previous_or_next_month": "Month forward/back", + "previous_or_next_photo": "Photo forward/back", + "previous_or_next_year": "Year forward/back", + "primary": "Primary", + "privacy": "Privacy", + "profile": "Profile", + "profile_drawer_app_logs": "Logs", + "profile_drawer_client_server_up_to_date": "Client and Server are up-to-date", + "profile_drawer_github": "GitHub", + "profile_drawer_readonly_mode": "Read-only mode enabled. Long-press the user avatar icon to exit.", + "profile_image_of_user": "Profile image of {user}", + "profile_picture_set": "Profile picture set.", + "public_album": "Public album", + "public_share": "Public Share", + "purchase_account_info": "Supporter", + "purchase_activated_subtitle": "Thank you for supporting Immich and open-source software", + "purchase_activated_time": "Activated on {date}", + "purchase_activated_title": "Your key has been successfully activated", + "purchase_button_activate": "Activate", + "purchase_button_buy": "Buy", + "purchase_button_buy_immich": "Buy Immich", + "purchase_button_never_show_again": "Never show again", + "purchase_button_reminder": "Remind me in 30 days", + "purchase_button_remove_key": "Remove key", + "purchase_button_select": "Select", + "purchase_failed_activation": "Failed to activate! Please check your email for the correct product key!", + "purchase_individual_description_1": "For an individual", + "purchase_individual_description_2": "Supporter status", + "purchase_individual_title": "Individual", + "purchase_input_suggestion": "Have a product key? Enter the key below", + "purchase_license_subtitle": "Buy Immich to support the continued development of the service", + "purchase_lifetime_description": "Lifetime purchase", + "purchase_option_title": "PURCHASE OPTIONS", + "purchase_panel_info_1": "Building Immich takes a lot of time and effort, and we have full-time engineers working on it to make it as good as we possibly can. Our mission is for open-source software and ethical business practices to become a sustainable income source for developers and to create a privacy-respecting ecosystem with real alternatives to exploitative cloud services.", + "purchase_panel_info_2": "As we're committed not to add paywalls, this purchase will not grant you any additional features in Immich. We rely on users like you to support Immich's ongoing development.", + "purchase_panel_title": "Support the project", + "purchase_per_server": "Per server", + "purchase_per_user": "Per user", + "purchase_remove_product_key": "Remove Product Key", + "purchase_remove_product_key_prompt": "Are you sure you want to remove the product key?", + "purchase_remove_server_product_key": "Remove Server product key", + "purchase_remove_server_product_key_prompt": "Are you sure you want to remove the Server product key?", + "purchase_server_description_1": "For the whole server", + "purchase_server_description_2": "Supporter status", + "purchase_server_title": "Server", + "purchase_settings_server_activated": "The server product key is managed by the admin", + "query_asset_id": "Query Asset ID", + "queue_status": "Queuing {count}/{total}", + "rate_asset": "Rate Asset", + "rating": "Star rating", + "rating_clear": "Clear rating", + "rating_count": "{count, plural, one {# star} other {# stars}}", + "rating_description": "Display the EXIF rating in the info panel", + "rating_set": "Rating set to {rating, plural, one {# star} other {# stars}}", + "reaction_options": "Reaction options", + "read_changelog": "Read Changelog", + "readonly_mode_disabled": "Read-only mode disabled", + "readonly_mode_enabled": "Read-only mode enabled", + "ready_for_upload": "Ready for upload", + "reassign": "Reassign", + "reassigned_assets_to_existing_person": "Re-assigned {count, plural, one {# asset} other {# assets}} to {name, select, null {an existing person} other {{name}}}", + "reassigned_assets_to_new_person": "Re-assigned {count, plural, one {# asset} other {# assets}} to a new person", + "reassing_hint": "Assign selected assets to an existing person", + "recent": "Recent", + "recent-albums": "Recent albums", + "recent_searches": "Recent searches", + "recently_added": "Recently added", + "recently_added_page_title": "Recently Added", + "recently_taken": "Recently taken", + "recently_taken_page_title": "Recently Taken", + "refresh": "Refresh", + "refresh_encoded_videos": "Refresh encoded videos", + "refresh_faces": "Refresh faces", + "refresh_metadata": "Refresh metadata", + "refresh_thumbnails": "Refresh thumbnails", + "refreshed": "Refreshed", + "refreshes_every_file": "Re-reads all existing and new files", + "refreshing_encoded_video": "Refreshing encoded video", + "refreshing_faces": "Refreshing faces", + "refreshing_metadata": "Refreshing metadata", + "regenerating_thumbnails": "Regenerating thumbnails", + "remote": "Remote", + "remote_assets": "Remote Assets", + "remote_media_summary": "Remote Media Summary", + "remove": "Remove", + "remove_assets_album_confirmation": "Are you sure you want to remove {count, plural, one {# asset} other {# assets}} from the album?", + "remove_assets_shared_link_confirmation": "Are you sure you want to remove {count, plural, one {# asset} other {# assets}} from this shared link?", + "remove_assets_title": "Remove assets?", + "remove_custom_date_range": "Remove custom date range", + "remove_deleted_assets": "Remove Deleted Assets", + "remove_from_album": "Remove from album", + "remove_from_album_action_prompt": "{count} removed from the album", + "remove_from_favorites": "Remove from favorites", + "remove_from_lock_folder_action_prompt": "{count} removed from the locked folder", + "remove_from_locked_folder": "Remove from locked folder", + "remove_from_locked_folder_confirmation": "Are you sure you want to move these photos and videos out of the locked folder? They will be visible in your library.", + "remove_from_shared_link": "Remove from shared link", + "remove_memory": "Remove memory", + "remove_photo_from_memory": "Remove photo from this memory", + "remove_tag": "Remove tag", + "remove_url": "Remove URL", + "remove_user": "Remove user", + "removed_api_key": "Removed API Key: {name}", + "removed_from_archive": "Removed from archive", + "removed_from_favorites": "Removed from favorites", + "removed_from_favorites_count": "{count, plural, other {Removed #}} from favorites", + "removed_memory": "Removed memory", + "removed_photo_from_memory": "Removed photo from memory", + "removed_tagged_assets": "Removed tag from {count, plural, one {# asset} other {# assets}}", + "rename": "Rename", + "repair": "Repair", + "repair_no_results_message": "Untracked and missing files will show up here", + "replace_with_upload": "Replace with upload", + "repository": "Repository", + "require_password": "Require password", + "require_user_to_change_password_on_first_login": "Require user to change password on first login", + "rescan": "Rescan", + "reset": "Reset", + "reset_password": "Reset password", + "reset_people_visibility": "Reset people visibility", + "reset_pin_code": "Reset PIN code", + "reset_pin_code_description": "If you forgot your PIN code, you can contact the server administrator to reset it", + "reset_pin_code_success": "Successfully reset PIN code", + "reset_pin_code_with_password": "You can always reset your PIN code with your password", + "reset_sqlite": "Reset SQLite Database", + "reset_sqlite_confirmation": "Are you sure you want to reset the SQLite database? You will need to log out and log in again to resync the data", + "reset_sqlite_success": "Successfully reset the SQLite database", + "reset_to_default": "Reset to default", + "resolution": "Resolution", + "resolve_duplicates": "Resolve duplicates", + "resolved_all_duplicates": "Resolved all duplicates", + "restore": "Restore", + "restore_all": "Restore all", + "restore_trash_action_prompt": "{count} restored from trash", + "restore_user": "Restore user", + "restored_asset": "Restored asset", + "resume": "Resume", + "resume_paused_jobs": "Resume {count, plural, one {# paused job} other {# paused jobs}}", + "retry_upload": "Retry upload", + "review_duplicates": "Review duplicates", + "review_large_files": "Review large files", + "role": "Role", + "role_editor": "Editor", + "role_viewer": "Viewer", + "running": "Running", + "save": "Save", + "save_to_gallery": "Save to gallery", + "saved": "Saved", + "saved_api_key": "Saved API Key", + "saved_profile": "Saved profile", + "saved_settings": "Saved settings", + "say_something": "Say something", + "scaffold_body_error_occurred": "Error occurred", + "scan": "Scan", + "scan_all_libraries": "Scan All Libraries", + "scan_library": "Scan", + "scan_settings": "Scan Settings", + "scanning": "Scanning", + "scanning_for_album": "Scanning for album...", + "search": "Search", + "search_albums": "Search albums", + "search_by_context": "Search by context", + "search_by_description": "Search by description", + "search_by_description_example": "Hiking day in Sapa", + "search_by_filename": "Search by file name or extension", + "search_by_filename_example": "i.e. IMG_1234.JPG or PNG", + "search_by_ocr": "Search by OCR", + "search_by_ocr_example": "Latte", + "search_camera_lens_model": "Search lens model...", + "search_camera_make": "Search camera make...", + "search_camera_model": "Search camera model...", + "search_city": "Search city...", + "search_country": "Search country...", + "search_filter_apply": "Apply filter", + "search_filter_camera_title": "Select camera type", + "search_filter_date": "Date", + "search_filter_date_interval": "{start} to {end}", + "search_filter_date_title": "Select a date range", + "search_filter_display_option_not_in_album": "Not in album", + "search_filter_display_options": "Display Options", + "search_filter_filename": "Search by file name", + "search_filter_location": "Location", + "search_filter_location_title": "Select location", + "search_filter_media_type": "Media Type", + "search_filter_media_type_title": "Select media type", + "search_filter_ocr": "Search by OCR", + "search_filter_people_title": "Select people", + "search_filter_star_rating": "Star Rating", + "search_for": "Search for", + "search_for_existing_person": "Search for existing person", + "search_no_more_result": "No more results", + "search_no_people": "No people", + "search_no_people_named": "No people named \"{name}\"", + "search_no_result": "No results found, try a different search term or combination", + "search_options": "Search options", + "search_page_categories": "Categories", + "search_page_motion_photos": "Motion Photos", + "search_page_no_objects": "No Objects Info Available", + "search_page_no_places": "No Places Info Available", + "search_page_screenshots": "Screenshots", + "search_page_search_photos_videos": "Search for your photos and videos", + "search_page_selfies": "Selfies", + "search_page_things": "Things", + "search_page_view_all_button": "View all", + "search_page_your_activity": "Your activity", + "search_page_your_map": "Your Map", + "search_people": "Search people", + "search_places": "Search places", + "search_rating": "Search by rating...", + "search_result_page_new_search_hint": "New Search", + "search_settings": "Search settings", + "search_state": "Search state...", + "search_suggestion_list_smart_search_hint_1": "Smart search is enabled by default, to search for metadata use the syntax ", + "search_suggestion_list_smart_search_hint_2": "m:your-search-term", + "search_tags": "Search tags...", + "search_timezone": "Search timezone...", + "search_type": "Search type", + "search_your_photos": "Search your photos", + "searching_locales": "Searching locales...", + "second": "Second", + "see_all_people": "See all people", + "select": "Select", + "select_album": "Select album", + "select_album_cover": "Select album cover", + "select_albums": "Select albums", + "select_all": "Select all", + "select_all_duplicates": "Select all duplicates", + "select_all_in": "Select all in {group}", + "select_avatar_color": "Select avatar color", + "select_count": "{count, plural, one {Select #} other {Select #}}", + "select_cutoff_date": "Select cutoff date", + "select_face": "Select face", + "select_featured_photo": "Select featured photo", + "select_from_computer": "Select from computer", + "select_keep_all": "Select keep all", + "select_library_owner": "Select library owner", + "select_new_face": "Select new face", + "select_people": "Select people", + "select_person": "Select person", + "select_person_to_tag": "Select a person to tag", + "select_photos": "Select photos", + "select_trash_all": "Select trash all", + "select_user_for_sharing_page_err_album": "Failed to create album", + "selected": "Selected", + "selected_count": "{count, plural, other {# selected}}", + "selected_gps_coordinates": "Selected GPS Coordinates", + "send_message": "Send message", + "send_welcome_email": "Send welcome email", + "server_endpoint": "Server Endpoint", + "server_info_box_app_version": "App Version", + "server_info_box_server_url": "Server URL", + "server_offline": "Server Offline", + "server_online": "Server Online", + "server_privacy": "Server Privacy", + "server_restarting_description": "This page will refresh momentarily.", + "server_restarting_title": "Server is restarting", + "server_stats": "Server Stats", + "server_update_available": "Server update is available", + "server_version": "Server Version", + "set": "Set", + "set_as_album_cover": "Set as album cover", + "set_as_featured_photo": "Set as featured photo", + "set_as_profile_picture": "Set as profile picture", + "set_date_of_birth": "Set date of birth", + "set_profile_picture": "Set profile picture", + "set_slideshow_to_fullscreen": "Set Slideshow to fullscreen", + "set_stack_primary_asset": "Set as primary asset", + "setting_image_viewer_help": "The detail viewer loads the small thumbnail first, then loads the medium-size preview (if enabled), finally loads the original (if enabled).", + "setting_image_viewer_original_subtitle": "Enable to load the original full-resolution image (large!). Disable to reduce data usage (both network and on device cache).", + "setting_image_viewer_original_title": "Load original image", + "setting_image_viewer_preview_subtitle": "Enable to load a medium-resolution image. Disable to either directly load the original or only use the thumbnail.", + "setting_image_viewer_preview_title": "Load preview image", + "setting_image_viewer_title": "Images", + "setting_languages_apply": "Apply", + "setting_languages_subtitle": "Change the app's language", + "setting_notifications_notify_failures_grace_period": "Notify background backup failures: {duration}", + "setting_notifications_notify_hours": "{count} hours", + "setting_notifications_notify_immediately": "immediately", + "setting_notifications_notify_minutes": "{count} minutes", + "setting_notifications_notify_never": "never", + "setting_notifications_notify_seconds": "{count} seconds", + "setting_notifications_single_progress_subtitle": "Detailed upload progress information per asset", + "setting_notifications_single_progress_title": "Show background backup detail progress", + "setting_notifications_subtitle": "Adjust your notification preferences", + "setting_notifications_total_progress_subtitle": "Overall upload progress (done/total assets)", + "setting_notifications_total_progress_title": "Show background backup total progress", + "setting_video_viewer_auto_play_subtitle": "Automatically start playing videos when they are opened", + "setting_video_viewer_auto_play_title": "Auto play videos", + "setting_video_viewer_looping_title": "Looping", + "setting_video_viewer_original_video_subtitle": "When streaming a video from the server, play the original even when a transcode is available. May lead to buffering. Videos available locally are played in original quality regardless of this setting.", + "setting_video_viewer_original_video_title": "Force original video", + "settings": "Settings", + "settings_require_restart": "Please restart Immich to apply this setting", + "settings_saved": "Settings saved", + "setup_pin_code": "Setup a PIN code", + "share": "Share", + "share_action_prompt": "Shared {count} assets", + "share_add_photos": "Add photos", + "share_assets_selected": "{count} selected", + "share_dialog_preparing": "Preparing...", + "share_link": "Share Link", + "shared": "Shared", + "shared_album_activities_input_disable": "Comment is disabled", + "shared_album_activity_remove_content": "Do you want to delete this activity?", + "shared_album_activity_remove_title": "Delete Activity", + "shared_album_section_people_action_error": "Error leaving/removing from album", + "shared_album_section_people_action_leave": "Remove user from album", + "shared_album_section_people_action_remove_user": "Remove user from album", + "shared_album_section_people_title": "PEOPLE", + "shared_by": "Shared by", + "shared_by_user": "Shared by {user}", + "shared_by_you": "Shared by you", + "shared_from_partner": "Photos from {partner}", + "shared_intent_upload_button_progress_text": "{current} / {total} Uploaded", + "shared_link_app_bar_title": "Shared Links", + "shared_link_clipboard_copied_massage": "Copied to clipboard", + "shared_link_clipboard_text": "Link: {link}\nPassword: {password}", + "shared_link_create_error": "Error while creating shared link", + "shared_link_custom_url_description": "Access this shared link with a custom URL", + "shared_link_edit_description_hint": "Enter the share description", + "shared_link_edit_expire_after_option_day": "1 day", + "shared_link_edit_expire_after_option_days": "{count} days", + "shared_link_edit_expire_after_option_hour": "1 hour", + "shared_link_edit_expire_after_option_hours": "{count} hours", + "shared_link_edit_expire_after_option_minute": "1 minute", + "shared_link_edit_expire_after_option_minutes": "{count} minutes", + "shared_link_edit_expire_after_option_months": "{count} months", + "shared_link_edit_expire_after_option_year": "{count} year", + "shared_link_edit_password_hint": "Enter the share password", + "shared_link_edit_submit_button": "Update link", + "shared_link_error_server_url_fetch": "Cannot fetch the server url", + "shared_link_expires_day": "Expires in {count} day", + "shared_link_expires_days": "Expires in {count} days", + "shared_link_expires_hour": "Expires in {count} hour", + "shared_link_expires_hours": "Expires in {count} hours", + "shared_link_expires_minute": "Expires in {count} minute", + "shared_link_expires_minutes": "Expires in {count} minutes", + "shared_link_expires_never": "Expires ∞", + "shared_link_expires_second": "Expires in {count} second", + "shared_link_expires_seconds": "Expires in {count} seconds", + "shared_link_individual_shared": "Individual shared", + "shared_link_info_chip_metadata": "EXIF", + "shared_link_manage_links": "Manage Shared links", + "shared_link_options": "Shared link options", + "shared_link_password_description": "Require a password to access this shared link", + "shared_links": "Shared links", + "shared_links_description": "Share photos and videos with a link", + "shared_photos_and_videos_count": "{assetCount, plural, other {# shared photos & videos.}}", + "shared_with_me": "Shared with me", + "shared_with_partner": "Shared with {partner}", + "sharing": "Sharing", + "sharing_enter_password": "Please enter the password to view this page.", + "sharing_page_album": "Shared albums", + "sharing_page_description": "Create shared albums to share photos and videos with people in your network.", + "sharing_page_empty_list": "EMPTY LIST", + "sharing_sidebar_description": "Display a link to Sharing in the sidebar", + "sharing_silver_appbar_create_shared_album": "New shared album", + "sharing_silver_appbar_share_partner": "Share with partner", + "shift_to_permanent_delete": "press ⇧ to permanently delete asset", + "show_album_options": "Show album options", + "show_albums": "Show albums", + "show_all_people": "Show all people", + "show_and_hide_people": "Show & hide people", + "show_file_location": "Show file location", + "show_gallery": "Show gallery", + "show_hidden_people": "Show hidden people", + "show_in_timeline": "Show in timeline", + "show_in_timeline_setting_description": "Show photos and videos from this user in your timeline", + "show_keyboard_shortcuts": "Show keyboard shortcuts", + "show_metadata": "Show metadata", + "show_or_hide_info": "Show or hide info", + "show_password": "Show password", + "show_person_options": "Show person options", + "show_progress_bar": "Show Progress Bar", + "show_schema": "Show schema", + "show_search_options": "Show search options", + "show_shared_links": "Show shared links", + "show_slideshow_transition": "Show slideshow transition", + "show_supporter_badge": "Supporter badge", + "show_supporter_badge_description": "Show a supporter badge", + "show_text_recognition": "Show text recognition", + "show_text_search_menu": "Show text search menu", + "shuffle": "Shuffle", + "sidebar": "Sidebar", + "sidebar_display_description": "Display a link to the view in the sidebar", + "sign_out": "Sign Out", + "sign_up": "Sign up", + "size": "Size", + "skip_to_content": "Skip to content", + "skip_to_folders": "Skip to folders", + "skip_to_tags": "Skip to tags", + "slideshow": "Slideshow", + "slideshow_repeat": "Repeat slideshow", + "slideshow_repeat_description": "Loop back to beginning when slideshow ends", + "slideshow_settings": "Slideshow settings", + "sort_albums_by": "Sort albums by...", + "sort_created": "Date created", + "sort_items": "Number of items", + "sort_modified": "Date modified", + "sort_newest": "Newest photo", + "sort_oldest": "Oldest photo", + "sort_people_by_similarity": "Sort people by similarity", + "sort_recent": "Most recent photo", + "sort_title": "Title", + "source": "Source", + "stack": "Stack", + "stack_action_prompt": "{count} stacked", + "stack_duplicates": "Stack duplicates", + "stack_select_one_photo": "Select one main photo for the stack", + "stack_selected_photos": "Stack selected photos", + "stacked_assets_count": "Stacked {count, plural, one {# asset} other {# assets}}", + "stacktrace": "Stacktrace", + "start": "Start", + "start_date": "Start date", + "start_date_before_end_date": "Start date must be before end date", + "state": "State", + "status": "Status", + "stop_casting": "Stop casting", + "stop_motion_photo": "Stop Motion Photo", + "stop_photo_sharing": "Stop sharing your photos?", + "stop_photo_sharing_description": "{partner} will no longer be able to access your photos.", + "stop_sharing_photos_with_user": "Stop sharing your photos with this user", + "storage": "Storage space", + "storage_label": "Storage label", + "storage_quota": "Storage Quota", + "storage_usage": "{used} of {available} used", + "submit": "Submit", + "success": "Success", + "suggestions": "Suggestions", + "sunrise_on_the_beach": "Sunrise on the beach", + "support": "Support", + "support_and_feedback": "Support & Feedback", + "support_third_party_description": "Your Immich installation was packaged by a third-party. Issues you experience may be caused by that package, so please raise issues with them in the first instance using the links below.", + "swap_merge_direction": "Swap merge direction", + "sync": "Sync", + "sync_albums": "Sync albums", + "sync_albums_manual_subtitle": "Sync all uploaded videos and photos to the selected backup albums", + "sync_local": "Sync Local", + "sync_remote": "Sync Remote", + "sync_status": "Sync Status", + "sync_status_subtitle": "View and manage the sync system", + "sync_upload_album_setting_subtitle": "Create and upload your photos and videos to the selected albums on Immich", + "tag": "Tag", + "tag_assets": "Tag assets", + "tag_created": "Created tag: {tag}", + "tag_feature_description": "Browsing photos and videos grouped by logical tag topics", + "tag_not_found_question": "Cannot find a tag? Create a new tag.", + "tag_people": "Tag People", + "tag_updated": "Updated tag: {tag}", + "tagged_assets": "Tagged {count, plural, one {# asset} other {# assets}}", + "tags": "Tags", + "tap_to_run_job": "Tap to run job", + "template": "Template", + "text_recognition": "Text recognition", + "theme": "Theme", + "theme_selection": "Theme selection", + "theme_selection_description": "Automatically set the theme to light or dark based on your browser's system preference", + "theme_setting_asset_list_storage_indicator_title": "Show storage indicator on asset tiles", + "theme_setting_asset_list_tiles_per_row_title": "Number of assets per row ({count})", + "theme_setting_colorful_interface_subtitle": "Apply primary color to background surfaces.", + "theme_setting_colorful_interface_title": "Colorful interface", + "theme_setting_image_viewer_quality_subtitle": "Adjust the quality of the detail image viewer", + "theme_setting_image_viewer_quality_title": "Image viewer quality", + "theme_setting_primary_color_subtitle": "Pick a color for primary actions and accents.", + "theme_setting_primary_color_title": "Primary color", + "theme_setting_system_primary_color_title": "Use system color", + "theme_setting_system_theme_switch": "Automatic (Follow system setting)", + "theme_setting_theme_subtitle": "Choose the app's theme setting", + "theme_setting_three_stage_loading_subtitle": "Three-stage loading might increase the loading performance but causes significantly higher network load", + "theme_setting_three_stage_loading_title": "Enable three-stage loading", + "then": "Then", + "they_will_be_merged_together": "They will be merged together", + "third_party_resources": "Third-Party Resources", + "time": "Time", + "time_based_memories": "Time-based memories", + "time_based_memories_duration": "Number of seconds to display each image.", + "timeline": "Timeline", + "timezone": "Timezone", + "to_archive": "Archive", + "to_change_password": "Change password", + "to_favorite": "Favorite", + "to_login": "Login", + "to_multi_select": "to multi-select", + "to_parent": "Go to parent", + "to_select": "to select", + "to_trash": "Trash", + "toggle_settings": "Toggle settings", + "toggle_theme_description": "Toggle theme", + "total": "Total", + "total_usage": "Total usage", + "trash": "Trash", + "trash_action_prompt": "{count} moved to trash", + "trash_all": "Trash All", + "trash_count": "Trash {count, number}", + "trash_delete_asset": "Trash/Delete Asset", + "trash_emptied": "Emptied trash", + "trash_no_results_message": "Trashed photos and videos will show up here.", + "trash_page_delete_all": "Delete All", + "trash_page_empty_trash_dialog_content": "Do you want to empty your trashed assets? These items will be permanently removed from Immich", + "trash_page_info": "Trashed items will be permanently deleted after {days} days", + "trash_page_no_assets": "No trashed assets", + "trash_page_restore_all": "Restore All", + "trash_page_select_assets_btn": "Select assets", + "trash_page_title": "Trash ({count})", + "trashed_items_will_be_permanently_deleted_after": "Trashed items will be permanently deleted after {days, plural, one {# day} other {# days}}.", + "trigger": "Trigger", + "trigger_asset_uploaded": "Asset Uploaded", + "trigger_asset_uploaded_description": "Triggered when a new asset is uploaded", + "trigger_description": "An event that kicks off the workflow", + "trigger_person_recognized": "Person Recognized", + "trigger_person_recognized_description": "Triggered when a person is detected", + "trigger_type": "Trigger type", + "troubleshoot": "Troubleshoot", + "type": "Type", + "unable_to_change_pin_code": "Unable to change PIN code", + "unable_to_check_version": "Unable to check app or server version", + "unable_to_setup_pin_code": "Unable to setup PIN code", + "unarchive": "Unarchive", + "unarchive_action_prompt": "{count} removed from Archive", + "unarchived_count": "{count, plural, other {Unarchived #}}", + "undo": "Undo", + "unfavorite": "Unfavorite", + "unfavorite_action_prompt": "{count} removed from Favorites", + "unhide_person": "Unhide person", + "unknown": "Unknown", + "unknown_country": "Unknown Country", + "unknown_date": "Unknown date", + "unknown_year": "Unknown Year", + "unlimited": "Unlimited", + "unlink_motion_video": "Unlink motion video", + "unlink_oauth": "Unlink OAuth", + "unlinked_oauth_account": "Unlinked OAuth account", + "unmute_memories": "Unmute Memories", + "unnamed_album": "Unnamed Album", + "unnamed_album_delete_confirmation": "Are you sure you want to delete this album?", + "unnamed_share": "Unnamed Share", + "unsaved_change": "Unsaved change", + "unselect_all": "Unselect all", + "unselect_all_duplicates": "Unselect all duplicates", + "unselect_all_in": "Unselect all in {group}", + "unstack": "Un-stack", + "unstack_action_prompt": "{count} unstacked", + "unstacked_assets_count": "Un-stacked {count, plural, one {# asset} other {# assets}}", + "unsupported_field_type": "Unsupported field type", + "untagged": "Untagged", + "untitled_workflow": "Untitled workflow", + "up_next": "Up next", + "update_location_action_prompt": "Update the location of {count} selected assets with:", + "updated_at": "Updated", + "updated_password": "Updated password", + "upload": "Upload", + "upload_concurrency": "Upload concurrency", + "upload_details": "Upload Details", + "upload_dialog_info": "Do you want to backup the selected Asset(s) to the server?", + "upload_dialog_title": "Upload Asset", + "upload_error_with_count": "Upload error for {count, plural, one {# asset} other {# assets}}", + "upload_errors": "Upload completed with {count, plural, one {# error} other {# errors}}, refresh the page to see new upload assets.", + "upload_finished": "Upload finished", + "upload_progress": "Remaining {remaining, number} - Processed {processed, number}/{total, number}", + "upload_skipped_duplicates": "Skipped {count, plural, one {# duplicate asset} other {# duplicate assets}}", + "upload_status_duplicates": "Duplicates", + "upload_status_errors": "Errors", + "upload_status_uploaded": "Uploaded", + "upload_success": "Upload success, refresh the page to see new upload assets.", + "upload_to_immich": "Upload to Immich ({count})", + "uploading": "Uploading", + "uploading_media": "Uploading media", + "url": "URL", + "usage": "Usage", + "use_biometric": "Use biometric", + "use_current_connection": "Use current connection", + "use_custom_date_range": "Use custom date range instead", + "user": "User", + "user_has_been_deleted": "This user has been deleted.", + "user_id": "User ID", + "user_liked": "{user} liked {type, select, photo {this photo} video {this video} asset {this asset} other {it}}", + "user_pin_code_settings": "PIN Code", + "user_pin_code_settings_description": "Manage your PIN code", + "user_privacy": "User Privacy", + "user_purchase_settings": "Purchase", + "user_purchase_settings_description": "Manage your purchase", + "user_role_set": "Set {user} as {role}", + "user_usage_detail": "User usage detail", + "user_usage_stats": "Account usage statistics", + "user_usage_stats_description": "View account usage statistics", + "username": "Username", + "users": "Users", + "users_added_to_album_count": "Added {count, plural, one {# user} other {# users}} to the album", + "utilities": "Utilities", + "validate": "Validate", + "validate_endpoint_error": "Please enter a valid URL", + "validation_error": "Validation error", + "variables": "Variables", + "version": "Version", + "version_announcement_closing": "Your friend, Alex", + "version_announcement_message": "Hi there! A new version of Immich is available. Please take some time to read the release notes to ensure your setup is up-to-date to prevent any misconfigurations, especially if you use WatchTower or any mechanism that handles updating your Immich instance automatically.", + "version_history": "Version History", + "version_history_item": "Installed {version} on {date}", + "video": "Video", + "video_hover_setting": "Play video thumbnail on hover", + "video_hover_setting_description": "Play video thumbnail when mouse is hovering over item. Even when disabled, playback can be started by hovering over the play icon.", + "videos": "Videos", + "videos_count": "{count, plural, one {# Video} other {# Videos}}", + "videos_only": "Videos only", + "view": "View", + "view_album": "View Album", + "view_all": "View All", + "view_all_users": "View all users", + "view_asset_owners": "View asset owners", + "view_details": "View Details", + "view_in_timeline": "View in timeline", + "view_link": "View link", + "view_links": "View links", + "view_name": "View", + "view_next_asset": "View next asset", + "view_previous_asset": "View previous asset", + "view_qr_code": "View QR code", + "view_similar_photos": "View similar photos", + "view_stack": "View Stack", + "view_user": "View User", + "viewer_remove_from_stack": "Remove from Stack", + "viewer_stack_use_as_main_asset": "Use as Main Asset", + "viewer_unstack": "Un-Stack", + "visibility_changed": "Visibility changed for {count, plural, one {# person} other {# people}}", + "visual": "Visual", + "visual_builder": "Visual builder", + "waiting": "Waiting", + "waiting_count": "Waiting: {count}", + "warning": "Warning", + "week": "Week", + "welcome": "Welcome", + "welcome_to_immich": "Welcome to Immich", + "width": "Width", + "wifi_name": "Wi-Fi Name", + "workflow_delete_prompt": "Are you sure you want to delete this workflow?", + "workflow_deleted": "Workflow deleted", + "workflow_description": "Workflow description", + "workflow_info": "Workflow info", + "workflow_json": "Workflow JSON", + "workflow_json_help": "Edit the workflow configuration in JSON format. Changes will sync to the visual builder.", + "workflow_name": "Workflow name", + "workflow_navigation_prompt": "Are you sure you want to leave without saving your changes?", + "workflow_summary": "Workflow summary", + "workflow_update_success": "Workflow updated successfully", + "workflow_updated": "Workflow updated", + "workflows": "Workflows", + "workflows_help_text": "Workflows automate actions on your assets based on triggers and filters", + "wrong_pin_code": "Wrong PIN code", + "year": "Year", + "years_ago": "{years, plural, one {# year} other {# years}} ago", + "yes": "Yes", + "you_dont_have_any_shared_links": "You don't have any shared links", + "your_wifi_name": "Your Wi-Fi name", + "zero_to_clear_rating": "press 0 to clear asset rating", + "zoom_image": "Zoom Image", + "zoom_to_bounds": "Zoom to bounds" } diff --git a/i18n/eo.json b/i18n/eo.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/eo.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/es.json b/i18n/es.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/es.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/et.json b/i18n/et.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/et.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/eu.json b/i18n/eu.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/eu.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/fa.json b/i18n/fa.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/fa.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/fi.json b/i18n/fi.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/fi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/fil.json b/i18n/fil.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/fil.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/fr.json b/i18n/fr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/fr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ga.json b/i18n/ga.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ga.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/gl.json b/i18n/gl.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/gl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/gsw.json b/i18n/gsw.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/gsw.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/gu.json b/i18n/gu.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/gu.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/he.json b/i18n/he.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/he.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/hi.json b/i18n/hi.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/hi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/hr.json b/i18n/hr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/hr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/hu.json b/i18n/hu.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/hu.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/hy.json b/i18n/hy.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/hy.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/id.json b/i18n/id.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/id.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/is.json b/i18n/is.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/is.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/it.json b/i18n/it.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/it.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ja.json b/i18n/ja.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ja.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ka.json b/i18n/ka.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ka.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/kk.json b/i18n/kk.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/kk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/km.json b/i18n/km.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/km.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/kmr.json b/i18n/kmr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/kmr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/kn.json b/i18n/kn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/kn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ko.json b/i18n/ko.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ko.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/lb.json b/i18n/lb.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/lb.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/lt.json b/i18n/lt.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/lt.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/lv.json b/i18n/lv.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/lv.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/mfa.json b/i18n/mfa.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/mfa.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/mk.json b/i18n/mk.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/mk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ml.json b/i18n/ml.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ml.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/mn.json b/i18n/mn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/mn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/mr.json b/i18n/mr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/mr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ms.json b/i18n/ms.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ms.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/nb_NO.json b/i18n/nb_NO.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/nb_NO.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/nl.json b/i18n/nl.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/nl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/nn.json b/i18n/nn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/nn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/pa.json b/i18n/pa.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/pa.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/package.json b/i18n/package.json index cb3560bea1..fbec4e558c 100644 --- a/i18n/package.json +++ b/i18n/package.json @@ -1,6 +1,6 @@ { - "name": "immich-i18n", - "version": "2.5.5", + "name": "i18n", + "version": "0.1.0", "private": true, "scripts": { "format": "prettier --check .", diff --git a/i18n/pl.json b/i18n/pl.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/pl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/pt.json b/i18n/pt.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/pt.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/pt_BR.json b/i18n/pt_BR.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/pt_BR.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ro.json b/i18n/ro.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ro.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ru.json b/i18n/ru.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ru.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/si.json b/i18n/si.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/si.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sk.json b/i18n/sk.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sl.json b/i18n/sl.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sq.json b/i18n/sq.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sq.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sr_Cyrl.json b/i18n/sr_Cyrl.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sr_Cyrl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sr_Latn.json b/i18n/sr_Latn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sr_Latn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/sv.json b/i18n/sv.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/sv.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ta.json b/i18n/ta.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ta.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/te.json b/i18n/te.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/te.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/th.json b/i18n/th.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/th.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/tr.json b/i18n/tr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/tr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/uk.json b/i18n/uk.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/uk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/ur.json b/i18n/ur.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/ur.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/uz.json b/i18n/uz.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/uz.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/vi.json b/i18n/vi.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/vi.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/yue_Hant.json b/i18n/yue_Hant.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/yue_Hant.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/zh_Hant.json b/i18n/zh_Hant.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/zh_Hant.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/i18n/zh_SIMPLIFIED.json b/i18n/zh_SIMPLIFIED.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/i18n/zh_SIMPLIFIED.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 80c1a1c868..dfad45a709 100644 --- a/mobile/openapi/README.md +++ b/mobile/openapi/README.md @@ -1,9 +1,9 @@ # openapi -Immich API +App API This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 2.5.5 +- API version: 0.1.0 - Generator version: 7.8.0 - Build package: org.openapitools.codegen.languages.DartClientCodegen @@ -79,251 +79,24 @@ Class | Method | HTTP request | Description *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* | [**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* | [**checkExistingAssets**](doc//AssetsApi.md#checkexistingassets) | **POST** /assets/exist | Check existing assets -*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* | [**getAllUserAssetsByDeviceId**](doc//AssetsApi.md#getalluserassetsbydeviceid) | **GET** /assets/device/{deviceId} | Retrieve assets by device ID -*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* | [**getRandom**](doc//AssetsApi.md#getrandom) | **GET** /assets/random | Get random assets -*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* | [**replaceAsset**](doc//AssetsApi.md#replaceasset) | **PUT** /assets/{id}/original | Replace 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* | [**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* | [**getAllUserAssetsByDeviceId**](doc//DeprecatedApi.md#getalluserassetsbydeviceid) | **GET** /assets/device/{deviceId} | Retrieve assets by device ID -*DeprecatedApi* | [**getDeltaSync**](doc//DeprecatedApi.md#getdeltasync) | **POST** /sync/delta-sync | Get delta sync for user -*DeprecatedApi* | [**getFullSyncForUser**](doc//DeprecatedApi.md#getfullsyncforuser) | **POST** /sync/full-sync | Get full sync for user -*DeprecatedApi* | [**getQueuesLegacy**](doc//DeprecatedApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status -*DeprecatedApi* | [**getRandom**](doc//DeprecatedApi.md#getrandom) | **GET** /assets/random | Get random assets -*DeprecatedApi* | [**replaceAsset**](doc//DeprecatedApi.md#replaceasset) | **PUT** /assets/{id}/original | Replace asset -*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} | Delete a duplicate -*DuplicatesApi* | [**deleteDuplicates**](doc//DuplicatesApi.md#deleteduplicates) | **DELETE** /duplicates | Delete duplicates -*DuplicatesApi* | [**getAssetDuplicates**](doc//DuplicatesApi.md#getassetduplicates) | **GET** /duplicates | Retrieve duplicates -*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* | [**getPluginTriggers**](doc//PluginsApi.md#getplugintriggers) | **GET** /plugins/triggers | List all plugin triggers -*PluginsApi* | [**getPlugins**](doc//PluginsApi.md#getplugins) | **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* | [**getTheme**](doc//ServerApi.md#gettheme) | **GET** /server/theme | Get theme -*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* | [**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* | [**getDeltaSync**](doc//SyncApi.md#getdeltasync) | **POST** /sync/delta-sync | Get delta sync for user -*SyncApi* | [**getFullSyncForUser**](doc//SyncApi.md#getfullsyncforuser) | **POST** /sync/full-sync | Get full sync for user -*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* | [**getWorkflows**](doc//WorkflowsApi.md#getworkflows) | **GET** /workflows | List all workflows -*WorkflowsApi* | [**updateWorkflow**](doc//WorkflowsApi.md#updateworkflow) | **PUT** /workflows/{id} | Update a workflow ## Documentation For Models @@ -332,351 +105,25 @@ Class | Method | HTTP request | Description - [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md) - [APIKeyResponseDto](doc//APIKeyResponseDto.md) - [APIKeyUpdateDto](doc//APIKeyUpdateDto.md) - - [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) - - [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) - - [AssetDeltaSyncDto](doc//AssetDeltaSyncDto.md) - - [AssetDeltaSyncResponseDto](doc//AssetDeltaSyncResponseDto.md) - - [AssetEditAction](doc//AssetEditAction.md) - - [AssetEditActionCrop](doc//AssetEditActionCrop.md) - - [AssetEditActionListDto](doc//AssetEditActionListDto.md) - - [AssetEditActionListDtoEditsInner](doc//AssetEditActionListDtoEditsInner.md) - - [AssetEditActionMirror](doc//AssetEditActionMirror.md) - - [AssetEditActionRotate](doc//AssetEditActionRotate.md) - - [AssetEditsDto](doc//AssetEditsDto.md) - - [AssetFaceCreateDto](doc//AssetFaceCreateDto.md) - - [AssetFaceDeleteDto](doc//AssetFaceDeleteDto.md) - - [AssetFaceResponseDto](doc//AssetFaceResponseDto.md) - - [AssetFaceUpdateDto](doc//AssetFaceUpdateDto.md) - - [AssetFaceUpdateItem](doc//AssetFaceUpdateItem.md) - - [AssetFaceWithoutPersonResponseDto](doc//AssetFaceWithoutPersonResponseDto.md) - - [AssetFullSyncDto](doc//AssetFullSyncDto.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) - - [AssetResponseDto](doc//AssetResponseDto.md) - - [AssetStackResponseDto](doc//AssetStackResponseDto.md) - - [AssetStatsResponseDto](doc//AssetStatsResponseDto.md) - - [AssetTypeEnum](doc//AssetTypeEnum.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) - - [CheckExistingAssetsDto](doc//CheckExistingAssetsDto.md) - - [CheckExistingAssetsResponseDto](doc//CheckExistingAssetsResponseDto.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) - - [DownloadArchiveInfo](doc//DownloadArchiveInfo.md) - - [DownloadInfoDto](doc//DownloadInfoDto.md) - - [DownloadResponse](doc//DownloadResponse.md) - - [DownloadResponseDto](doc//DownloadResponseDto.md) - - [DownloadUpdate](doc//DownloadUpdate.md) - - [DuplicateDetectionConfig](doc//DuplicateDetectionConfig.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) - - [LicenseResponseDto](doc//LicenseResponseDto.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) - - [PersonWithFacesResponseDto](doc//PersonWithFacesResponseDto.md) - - [PinCodeChangeDto](doc//PinCodeChangeDto.md) - - [PinCodeResetDto](doc//PinCodeResetDto.md) - - [PinCodeSetupDto](doc//PinCodeSetupDto.md) - - [PlacesResponseDto](doc//PlacesResponseDto.md) - - [PluginActionResponseDto](doc//PluginActionResponseDto.md) - - [PluginContextType](doc//PluginContextType.md) - - [PluginFilterResponseDto](doc//PluginFilterResponseDto.md) - - [PluginResponseDto](doc//PluginResponseDto.md) - - [PluginTriggerResponseDto](doc//PluginTriggerResponseDto.md) - - [PluginTriggerType](doc//PluginTriggerType.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) - - [ServerThemeDto](doc//ServerThemeDto.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) - - [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) - - [SyncAssetDeleteV1](doc//SyncAssetDeleteV1.md) - - [SyncAssetExifV1](doc//SyncAssetExifV1.md) - - [SyncAssetFaceDeleteV1](doc//SyncAssetFaceDeleteV1.md) - - [SyncAssetFaceV1](doc//SyncAssetFaceV1.md) - - [SyncAssetMetadataDeleteV1](doc//SyncAssetMetadataDeleteV1.md) - - [SyncAssetMetadataV1](doc//SyncAssetMetadataV1.md) - - [SyncAssetV1](doc//SyncAssetV1.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) - - [WorkflowActionItemDto](doc//WorkflowActionItemDto.md) - - [WorkflowActionResponseDto](doc//WorkflowActionResponseDto.md) - - [WorkflowCreateDto](doc//WorkflowCreateDto.md) - - [WorkflowFilterItemDto](doc//WorkflowFilterItemDto.md) - - [WorkflowFilterResponseDto](doc//WorkflowFilterResponseDto.md) - - [WorkflowResponseDto](doc//WorkflowResponseDto.md) - - [WorkflowUpdateDto](doc//WorkflowUpdateDto.md) ## Documentation For Authorization diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index 90e426b547..39fd4e789a 100644 --- a/mobile/openapi/lib/api.dart +++ b/mobile/openapi/lib/api.dart @@ -31,392 +31,34 @@ part 'auth/http_basic_auth.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 'model/api_key_create_dto.dart'; part 'model/api_key_create_response_dto.dart'; part 'model/api_key_response_dto.dart'; part 'model/api_key_update_dto.dart'; -part 'model/activity_create_dto.dart'; -part 'model/activity_response_dto.dart'; -part 'model/activity_statistics_response_dto.dart'; -part 'model/add_users_dto.dart'; -part 'model/admin_onboarding_update_dto.dart'; -part 'model/album_response_dto.dart'; -part 'model/album_statistics_response_dto.dart'; -part 'model/album_user_add_dto.dart'; -part 'model/album_user_create_dto.dart'; -part 'model/album_user_response_dto.dart'; -part 'model/album_user_role.dart'; -part 'model/albums_add_assets_dto.dart'; -part 'model/albums_add_assets_response_dto.dart'; -part 'model/albums_response.dart'; -part 'model/albums_update.dart'; -part 'model/asset_bulk_delete_dto.dart'; -part 'model/asset_bulk_update_dto.dart'; -part 'model/asset_bulk_upload_check_dto.dart'; -part 'model/asset_bulk_upload_check_item.dart'; -part 'model/asset_bulk_upload_check_response_dto.dart'; -part 'model/asset_bulk_upload_check_result.dart'; -part 'model/asset_copy_dto.dart'; -part 'model/asset_delta_sync_dto.dart'; -part 'model/asset_delta_sync_response_dto.dart'; -part 'model/asset_edit_action.dart'; -part 'model/asset_edit_action_crop.dart'; -part 'model/asset_edit_action_list_dto.dart'; -part 'model/asset_edit_action_list_dto_edits_inner.dart'; -part 'model/asset_edit_action_mirror.dart'; -part 'model/asset_edit_action_rotate.dart'; -part 'model/asset_edits_dto.dart'; -part 'model/asset_face_create_dto.dart'; -part 'model/asset_face_delete_dto.dart'; -part 'model/asset_face_response_dto.dart'; -part 'model/asset_face_update_dto.dart'; -part 'model/asset_face_update_item.dart'; -part 'model/asset_face_without_person_response_dto.dart'; -part 'model/asset_full_sync_dto.dart'; -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_response_dto.dart'; -part 'model/asset_media_size.dart'; -part 'model/asset_media_status.dart'; -part 'model/asset_metadata_bulk_delete_dto.dart'; -part 'model/asset_metadata_bulk_delete_item_dto.dart'; -part 'model/asset_metadata_bulk_response_dto.dart'; -part 'model/asset_metadata_bulk_upsert_dto.dart'; -part 'model/asset_metadata_bulk_upsert_item_dto.dart'; -part 'model/asset_metadata_response_dto.dart'; -part 'model/asset_metadata_upsert_dto.dart'; -part 'model/asset_metadata_upsert_item_dto.dart'; -part 'model/asset_ocr_response_dto.dart'; -part 'model/asset_order.dart'; -part 'model/asset_response_dto.dart'; -part 'model/asset_stack_response_dto.dart'; -part 'model/asset_stats_response_dto.dart'; -part 'model/asset_type_enum.dart'; -part 'model/asset_visibility.dart'; -part 'model/audio_codec.dart'; -part 'model/auth_status_response_dto.dart'; -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/check_existing_assets_dto.dart'; -part 'model/check_existing_assets_response_dto.dart'; -part 'model/colorspace.dart'; -part 'model/contributor_count_response_dto.dart'; -part 'model/create_album_dto.dart'; -part 'model/create_library_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/download_archive_info.dart'; -part 'model/download_info_dto.dart'; -part 'model/download_response.dart'; -part 'model/download_response_dto.dart'; -part 'model/download_update.dart'; -part 'model/duplicate_detection_config.dart'; -part 'model/duplicate_response_dto.dart'; -part 'model/email_notifications_response.dart'; -part 'model/email_notifications_update.dart'; -part 'model/exif_response_dto.dart'; -part 'model/face_dto.dart'; -part 'model/facial_recognition_config.dart'; -part 'model/folders_response.dart'; -part 'model/folders_update.dart'; -part 'model/image_format.dart'; -part 'model/job_create_dto.dart'; -part 'model/job_name.dart'; -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'; part 'model/logout_response_dto.dart'; -part 'model/machine_learning_availability_checks_dto.dart'; -part 'model/maintenance_action.dart'; -part 'model/maintenance_auth_dto.dart'; -part 'model/maintenance_detect_install_response_dto.dart'; -part 'model/maintenance_detect_install_storage_folder_dto.dart'; -part 'model/maintenance_login_dto.dart'; -part 'model/maintenance_status_response_dto.dart'; -part 'model/manual_job_name.dart'; -part 'model/map_marker_response_dto.dart'; -part 'model/map_reverse_geocode_response_dto.dart'; -part 'model/memories_response.dart'; -part 'model/memories_update.dart'; -part 'model/memory_create_dto.dart'; -part 'model/memory_response_dto.dart'; -part 'model/memory_search_order.dart'; -part 'model/memory_statistics_response_dto.dart'; -part 'model/memory_type.dart'; -part 'model/memory_update_dto.dart'; -part 'model/merge_person_dto.dart'; -part 'model/metadata_search_dto.dart'; -part 'model/mirror_axis.dart'; -part 'model/mirror_parameters.dart'; -part 'model/notification_create_dto.dart'; -part 'model/notification_delete_all_dto.dart'; -part 'model/notification_dto.dart'; -part 'model/notification_level.dart'; -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_callback_dto.dart'; -part 'model/o_auth_config_dto.dart'; -part 'model/o_auth_token_endpoint_auth_method.dart'; -part 'model/ocr_config.dart'; -part 'model/on_this_day_dto.dart'; -part 'model/onboarding_dto.dart'; -part 'model/onboarding_response_dto.dart'; -part 'model/partner_create_dto.dart'; -part 'model/partner_direction.dart'; -part 'model/partner_response_dto.dart'; -part 'model/partner_update_dto.dart'; -part 'model/people_response.dart'; -part 'model/people_response_dto.dart'; -part 'model/people_update.dart'; -part 'model/people_update_dto.dart'; -part 'model/people_update_item.dart'; part 'model/permission.dart'; -part 'model/person_create_dto.dart'; -part 'model/person_response_dto.dart'; -part 'model/person_statistics_response_dto.dart'; -part 'model/person_update_dto.dart'; -part 'model/person_with_faces_response_dto.dart'; -part 'model/pin_code_change_dto.dart'; -part 'model/pin_code_reset_dto.dart'; -part 'model/pin_code_setup_dto.dart'; -part 'model/places_response_dto.dart'; -part 'model/plugin_action_response_dto.dart'; -part 'model/plugin_context_type.dart'; -part 'model/plugin_filter_response_dto.dart'; -part 'model/plugin_response_dto.dart'; -part 'model/plugin_trigger_response_dto.dart'; -part 'model/plugin_trigger_type.dart'; -part 'model/purchase_response.dart'; -part 'model/purchase_update.dart'; -part 'model/queue_command.dart'; -part 'model/queue_command_dto.dart'; -part 'model/queue_delete_dto.dart'; -part 'model/queue_job_response_dto.dart'; -part 'model/queue_job_status.dart'; -part 'model/queue_name.dart'; -part 'model/queue_response_dto.dart'; -part 'model/queue_response_legacy_dto.dart'; -part 'model/queue_statistics_dto.dart'; -part 'model/queue_status_legacy_dto.dart'; -part 'model/queue_update_dto.dart'; -part 'model/queues_response_legacy_dto.dart'; -part 'model/random_search_dto.dart'; -part 'model/ratings_response.dart'; -part 'model/ratings_update.dart'; -part 'model/reaction_level.dart'; -part 'model/reaction_type.dart'; -part 'model/reverse_geocoding_state_response_dto.dart'; -part 'model/rotate_parameters.dart'; -part 'model/search_album_response_dto.dart'; -part 'model/search_asset_response_dto.dart'; -part 'model/search_explore_item.dart'; -part 'model/search_explore_response_dto.dart'; -part 'model/search_facet_count_response_dto.dart'; -part 'model/search_facet_response_dto.dart'; -part 'model/search_response_dto.dart'; -part 'model/search_statistics_response_dto.dart'; -part 'model/search_suggestion_type.dart'; part 'model/server_about_response_dto.dart'; -part 'model/server_apk_links_dto.dart'; part 'model/server_config_dto.dart'; part 'model/server_features_dto.dart'; -part 'model/server_media_types_response_dto.dart'; part 'model/server_ping_response.dart'; -part 'model/server_stats_response_dto.dart'; -part 'model/server_storage_response_dto.dart'; -part 'model/server_theme_dto.dart'; -part 'model/server_version_history_response_dto.dart'; part 'model/server_version_response_dto.dart'; part 'model/session_create_dto.dart'; part 'model/session_create_response_dto.dart'; part 'model/session_response_dto.dart'; -part 'model/session_unlock_dto.dart'; -part 'model/session_update_dto.dart'; -part 'model/set_maintenance_mode_dto.dart'; -part 'model/shared_link_create_dto.dart'; -part 'model/shared_link_edit_dto.dart'; -part 'model/shared_link_response_dto.dart'; -part 'model/shared_link_type.dart'; -part 'model/shared_links_response.dart'; -part 'model/shared_links_update.dart'; part 'model/sign_up_dto.dart'; -part 'model/smart_search_dto.dart'; -part 'model/source_type.dart'; -part 'model/stack_create_dto.dart'; -part 'model/stack_response_dto.dart'; -part 'model/stack_update_dto.dart'; -part 'model/statistics_search_dto.dart'; -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_album_delete_v1.dart'; -part 'model/sync_album_to_asset_delete_v1.dart'; -part 'model/sync_album_to_asset_v1.dart'; -part 'model/sync_album_user_delete_v1.dart'; -part 'model/sync_album_user_v1.dart'; -part 'model/sync_album_v1.dart'; -part 'model/sync_asset_delete_v1.dart'; -part 'model/sync_asset_exif_v1.dart'; -part 'model/sync_asset_face_delete_v1.dart'; -part 'model/sync_asset_face_v1.dart'; -part 'model/sync_asset_metadata_delete_v1.dart'; -part 'model/sync_asset_metadata_v1.dart'; -part 'model/sync_asset_v1.dart'; -part 'model/sync_auth_user_v1.dart'; -part 'model/sync_entity_type.dart'; -part 'model/sync_memory_asset_delete_v1.dart'; -part 'model/sync_memory_asset_v1.dart'; -part 'model/sync_memory_delete_v1.dart'; -part 'model/sync_memory_v1.dart'; -part 'model/sync_partner_delete_v1.dart'; -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_stack_delete_v1.dart'; -part 'model/sync_stack_v1.dart'; -part 'model/sync_stream_dto.dart'; -part 'model/sync_user_delete_v1.dart'; -part 'model/sync_user_metadata_delete_v1.dart'; -part 'model/sync_user_metadata_v1.dart'; -part 'model/sync_user_v1.dart'; -part 'model/system_config_backups_dto.dart'; -part 'model/system_config_dto.dart'; -part 'model/system_config_f_fmpeg_dto.dart'; -part 'model/system_config_faces_dto.dart'; -part 'model/system_config_generated_fullsize_image_dto.dart'; -part 'model/system_config_generated_image_dto.dart'; -part 'model/system_config_image_dto.dart'; -part 'model/system_config_job_dto.dart'; -part 'model/system_config_library_dto.dart'; -part 'model/system_config_library_scan_dto.dart'; -part 'model/system_config_library_watch_dto.dart'; -part 'model/system_config_logging_dto.dart'; -part 'model/system_config_machine_learning_dto.dart'; -part 'model/system_config_map_dto.dart'; -part 'model/system_config_metadata_dto.dart'; -part 'model/system_config_new_version_check_dto.dart'; -part 'model/system_config_nightly_tasks_dto.dart'; -part 'model/system_config_notifications_dto.dart'; -part 'model/system_config_o_auth_dto.dart'; -part 'model/system_config_password_login_dto.dart'; -part 'model/system_config_reverse_geocoding_dto.dart'; -part 'model/system_config_server_dto.dart'; -part 'model/system_config_smtp_dto.dart'; -part 'model/system_config_smtp_transport_dto.dart'; -part 'model/system_config_storage_template_dto.dart'; -part 'model/system_config_template_emails_dto.dart'; -part 'model/system_config_template_storage_option_dto.dart'; -part 'model/system_config_templates_dto.dart'; -part 'model/system_config_theme_dto.dart'; -part 'model/system_config_trash_dto.dart'; -part 'model/system_config_user_dto.dart'; -part 'model/tag_bulk_assets_dto.dart'; -part 'model/tag_bulk_assets_response_dto.dart'; -part 'model/tag_create_dto.dart'; -part 'model/tag_response_dto.dart'; -part 'model/tag_update_dto.dart'; -part 'model/tag_upsert_dto.dart'; -part 'model/tags_response.dart'; -part 'model/tags_update.dart'; -part 'model/template_dto.dart'; -part 'model/template_response_dto.dart'; -part 'model/test_email_response_dto.dart'; -part 'model/time_bucket_asset_response_dto.dart'; -part 'model/time_buckets_response_dto.dart'; -part 'model/tone_mapping.dart'; -part 'model/transcode_hw_accel.dart'; -part 'model/transcode_policy.dart'; -part 'model/trash_response_dto.dart'; -part 'model/update_album_dto.dart'; -part 'model/update_album_user_dto.dart'; -part 'model/update_asset_dto.dart'; -part 'model/update_library_dto.dart'; -part 'model/usage_by_user_dto.dart'; -part 'model/user_admin_create_dto.dart'; -part 'model/user_admin_delete_dto.dart'; part 'model/user_admin_response_dto.dart'; -part 'model/user_admin_update_dto.dart'; -part 'model/user_avatar_color.dart'; -part 'model/user_license.dart'; -part 'model/user_metadata_key.dart'; -part 'model/user_preferences_response_dto.dart'; -part 'model/user_preferences_update_dto.dart'; part 'model/user_response_dto.dart'; part 'model/user_status.dart'; part 'model/user_update_me_dto.dart'; part 'model/validate_access_token_response_dto.dart'; -part 'model/validate_library_dto.dart'; -part 'model/validate_library_import_path_response_dto.dart'; -part 'model/validate_library_response_dto.dart'; -part 'model/version_check_state_response_dto.dart'; -part 'model/video_codec.dart'; -part 'model/video_container.dart'; -part 'model/workflow_action_item_dto.dart'; -part 'model/workflow_action_response_dto.dart'; -part 'model/workflow_create_dto.dart'; -part 'model/workflow_filter_item_dto.dart'; -part 'model/workflow_filter_response_dto.dart'; -part 'model/workflow_response_dto.dart'; -part 'model/workflow_update_dto.dart'; /// An [ApiClient] instance that uses the default values obtained from diff --git a/mobile/openapi/lib/api/activities_api.dart b/mobile/openapi/lib/api/activities_api.dart deleted file mode 100644 index 697598ac97..0000000000 --- a/mobile/openapi/lib/api/activities_api.dart +++ /dev/null @@ -1,291 +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 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 createActivityWithHttpInfo(ActivityCreateDto activityCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/activities'; - - // ignore: prefer_final_locals - Object? postBody = activityCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create an activity - /// - /// Create a like or a comment for an album, or an asset in an album. - /// - /// Parameters: - /// - /// * [ActivityCreateDto] activityCreateDto (required): - Future 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; - } - - /// 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 deleteActivityWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/activities/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 deleteActivity(String id,) async { - final response = await deleteActivityWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// 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. - /// - /// 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: - /// Filter by activity level - /// - /// * [ReactionType] type: - /// Filter by activity type - /// - /// * [String] userId: - /// Filter by user ID - Future getActivitiesWithHttpInfo(String albumId, { String? assetId, ReactionLevel? level, ReactionType? type, String? userId, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/activities'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'albumId', albumId)); - if (assetId != null) { - queryParams.addAll(_queryParams('', 'assetId', assetId)); - } - if (level != null) { - queryParams.addAll(_queryParams('', 'level', level)); - } - if (type != null) { - queryParams.addAll(_queryParams('', 'type', type)); - } - if (userId != null) { - queryParams.addAll(_queryParams('', 'userId', userId)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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. - /// - /// Parameters: - /// - /// * [String] albumId (required): - /// Album ID - /// - /// * [String] assetId: - /// Asset ID (if activity is for an asset) - /// - /// * [ReactionLevel] level: - /// Filter by activity level - /// - /// * [ReactionType] type: - /// Filter by activity type - /// - /// * [String] userId: - /// Filter by user ID - Future?> 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, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve activity statistics - /// - /// Returns the number of likes and comments for a given album or asset in an album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] albumId (required): - /// Album ID - /// - /// * [String] assetId: - /// Asset ID (if activity is for an asset) - Future getActivityStatisticsWithHttpInfo(String albumId, { String? assetId, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/activities/statistics'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'albumId', albumId)); - if (assetId != null) { - queryParams.addAll(_queryParams('', 'assetId', assetId)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve activity statistics - /// - /// 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 getActivityStatistics(String albumId, { String? assetId, }) async { - final response = await getActivityStatisticsWithHttpInfo(albumId, assetId: assetId, ); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/albums_api.dart b/mobile/openapi/lib/api/albums_api.dart deleted file mode 100644 index e2db95b9e0..0000000000 --- a/mobile/openapi/lib/api/albums_api.dart +++ /dev/null @@ -1,774 +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 AlbumsApi { - AlbumsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Add assets to an album - /// - /// Add multiple assets to a specific album by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future addAssetsToAlbumWithHttpInfo(String id, BulkIdsDto bulkIdsDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}/assets' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Add assets to an album - /// - /// Add multiple assets to a specific album by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future?> addAssetsToAlbum(String id, BulkIdsDto bulkIdsDto, { String? key, String? slug, }) async { - final response = await addAssetsToAlbumWithHttpInfo(id, bulkIdsDto, key: key, slug: slug, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Add assets to albums - /// - /// Send a list of asset IDs and album IDs to add each asset to each album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AlbumsAddAssetsDto] albumsAddAssetsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future addAssetsToAlbumsWithHttpInfo(AlbumsAddAssetsDto albumsAddAssetsDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/assets'; - - // ignore: prefer_final_locals - Object? postBody = albumsAddAssetsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Add assets to albums - /// - /// Send a list of asset IDs and album IDs to add each asset to each album. - /// - /// Parameters: - /// - /// * [AlbumsAddAssetsDto] albumsAddAssetsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future addAssetsToAlbums(AlbumsAddAssetsDto albumsAddAssetsDto, { String? key, String? slug, }) async { - final response = await addAssetsToAlbumsWithHttpInfo(albumsAddAssetsDto, key: key, slug: slug, ); - 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), 'AlbumsAddAssetsResponseDto',) as AlbumsAddAssetsResponseDto; - - } - return null; - } - - /// Share album with users - /// - /// Share an album with multiple users. Each user can be given a specific role in the album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AddUsersDto] addUsersDto (required): - Future addUsersToAlbumWithHttpInfo(String id, AddUsersDto addUsersDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}/users' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = addUsersDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Share album with users - /// - /// Share an album with multiple users. Each user can be given a specific role in the album. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AddUsersDto] addUsersDto (required): - Future addUsersToAlbum(String id, AddUsersDto addUsersDto,) async { - final response = await addUsersToAlbumWithHttpInfo(id, addUsersDto,); - 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), 'AlbumResponseDto',) as AlbumResponseDto; - - } - return null; - } - - /// Create an album - /// - /// Create a new album. The album can also be created with initial users and assets. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [CreateAlbumDto] createAlbumDto (required): - Future createAlbumWithHttpInfo(CreateAlbumDto createAlbumDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums'; - - // ignore: prefer_final_locals - Object? postBody = createAlbumDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create an album - /// - /// Create a new album. The album can also be created with initial users and assets. - /// - /// Parameters: - /// - /// * [CreateAlbumDto] createAlbumDto (required): - Future createAlbum(CreateAlbumDto createAlbumDto,) async { - final response = await createAlbumWithHttpInfo(createAlbumDto,); - 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), 'AlbumResponseDto',) as AlbumResponseDto; - - } - return null; - } - - /// Delete an album - /// - /// Delete a specific album by its ID. Note the album is initially trashed and then immediately scheduled for deletion, but relies on a background job to complete the process. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteAlbumWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete an album - /// - /// Delete a specific album by its ID. Note the album is initially trashed and then immediately scheduled for deletion, but relies on a background job to complete the process. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteAlbum(String id,) async { - final response = await deleteAlbumWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Retrieve an album - /// - /// Retrieve information about a specific album by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [bool] withoutAssets: - /// Exclude assets from response - Future getAlbumInfoWithHttpInfo(String id, { String? key, String? slug, bool? withoutAssets, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - if (withoutAssets != null) { - queryParams.addAll(_queryParams('', 'withoutAssets', withoutAssets)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve an album - /// - /// Retrieve information about a specific album by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [bool] withoutAssets: - /// Exclude assets from response - Future getAlbumInfo(String id, { String? key, String? slug, bool? withoutAssets, }) async { - final response = await getAlbumInfoWithHttpInfo(id, key: key, slug: slug, withoutAssets: withoutAssets, ); - 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), 'AlbumResponseDto',) as AlbumResponseDto; - - } - return null; - } - - /// Retrieve album statistics - /// - /// Returns statistics about the albums available to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - Future getAlbumStatisticsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/statistics'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve album statistics - /// - /// Returns statistics about the albums available to the authenticated user. - Future getAlbumStatistics() async { - final response = await getAlbumStatisticsWithHttpInfo(); - 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), 'AlbumStatisticsResponseDto',) as AlbumStatisticsResponseDto; - - } - return null; - } - - /// List all albums - /// - /// Retrieve a list of albums available to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] assetId: - /// Filter albums containing this asset ID (ignores shared parameter) - /// - /// * [bool] shared: - /// Filter by shared status: true = only shared, false = not shared, undefined = all owned albums - Future getAllAlbumsWithHttpInfo({ String? assetId, bool? shared, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (assetId != null) { - queryParams.addAll(_queryParams('', 'assetId', assetId)); - } - if (shared != null) { - queryParams.addAll(_queryParams('', 'shared', shared)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List all albums - /// - /// Retrieve a list of albums available to the authenticated user. - /// - /// Parameters: - /// - /// * [String] assetId: - /// Filter albums containing this asset ID (ignores shared parameter) - /// - /// * [bool] shared: - /// Filter by shared status: true = only shared, false = not shared, undefined = all owned albums - Future?> getAllAlbums({ String? assetId, bool? shared, }) async { - final response = await getAllAlbumsWithHttpInfo( assetId: assetId, shared: shared, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Remove assets from an album - /// - /// Remove multiple assets from a specific album by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future removeAssetFromAlbumWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}/assets' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Remove assets from an album - /// - /// Remove multiple assets from a specific album by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future?> removeAssetFromAlbum(String id, BulkIdsDto bulkIdsDto,) async { - final response = await removeAssetFromAlbumWithHttpInfo(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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Remove user from album - /// - /// Remove a user from an album. Use an ID of \"me\" to leave a shared album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] userId (required): - Future removeUserFromAlbumWithHttpInfo(String id, String userId,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}/user/{userId}' - .replaceAll('{id}', id) - .replaceAll('{userId}', userId); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Remove user from album - /// - /// Remove a user from an album. Use an ID of \"me\" to leave a shared album. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] userId (required): - Future removeUserFromAlbum(String id, String userId,) async { - final response = await removeUserFromAlbumWithHttpInfo(id, userId,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Update an album - /// - /// Update the information of a specific album by its ID. This endpoint can be used to update the album name, description, sort order, etc. However, it is not used to add or remove assets or users from the album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateAlbumDto] updateAlbumDto (required): - Future updateAlbumInfoWithHttpInfo(String id, UpdateAlbumDto updateAlbumDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = updateAlbumDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PATCH', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update an album - /// - /// Update the information of a specific album by its ID. This endpoint can be used to update the album name, description, sort order, etc. However, it is not used to add or remove assets or users from the album. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateAlbumDto] updateAlbumDto (required): - Future updateAlbumInfo(String id, UpdateAlbumDto updateAlbumDto,) async { - final response = await updateAlbumInfoWithHttpInfo(id, updateAlbumDto,); - 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), 'AlbumResponseDto',) as AlbumResponseDto; - - } - return null; - } - - /// Update user role - /// - /// Change the role for a specific user in a specific album. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] userId (required): - /// - /// * [UpdateAlbumUserDto] updateAlbumUserDto (required): - Future updateAlbumUserWithHttpInfo(String id, String userId, UpdateAlbumUserDto updateAlbumUserDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/albums/{id}/user/{userId}' - .replaceAll('{id}', id) - .replaceAll('{userId}', userId); - - // ignore: prefer_final_locals - Object? postBody = updateAlbumUserDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update user role - /// - /// Change the role for a specific user in a specific album. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] userId (required): - /// - /// * [UpdateAlbumUserDto] updateAlbumUserDto (required): - Future updateAlbumUser(String id, String userId, UpdateAlbumUserDto updateAlbumUserDto,) async { - final response = await updateAlbumUserWithHttpInfo(id, userId, updateAlbumUserDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/assets_api.dart b/mobile/openapi/lib/api/assets_api.dart deleted file mode 100644 index 5fda01a594..0000000000 --- a/mobile/openapi/lib/api/assets_api.dart +++ /dev/null @@ -1,1839 +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 AssetsApi { - AssetsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Check bulk upload - /// - /// Determine which assets have already been uploaded to the server based on their SHA1 checksums. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required): - Future checkBulkUploadWithHttpInfo(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/bulk-upload-check'; - - // ignore: prefer_final_locals - Object? postBody = assetBulkUploadCheckDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Check bulk upload - /// - /// Determine which assets have already been uploaded to the server based on their SHA1 checksums. - /// - /// Parameters: - /// - /// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required): - Future checkBulkUpload(AssetBulkUploadCheckDto assetBulkUploadCheckDto,) async { - final response = await checkBulkUploadWithHttpInfo(assetBulkUploadCheckDto,); - 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), 'AssetBulkUploadCheckResponseDto',) as AssetBulkUploadCheckResponseDto; - - } - return null; - } - - /// Check existing assets - /// - /// Checks if multiple assets exist on the server and returns all existing - used by background backup - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required): - Future checkExistingAssetsWithHttpInfo(CheckExistingAssetsDto checkExistingAssetsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/exist'; - - // ignore: prefer_final_locals - Object? postBody = checkExistingAssetsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Check existing assets - /// - /// Checks if multiple assets exist on the server and returns all existing - used by background backup - /// - /// Parameters: - /// - /// * [CheckExistingAssetsDto] checkExistingAssetsDto (required): - Future checkExistingAssets(CheckExistingAssetsDto checkExistingAssetsDto,) async { - final response = await checkExistingAssetsWithHttpInfo(checkExistingAssetsDto,); - 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), 'CheckExistingAssetsResponseDto',) as CheckExistingAssetsResponseDto; - - } - return null; - } - - /// Copy asset - /// - /// Copy asset information like albums, tags, etc. from one asset to another. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetCopyDto] assetCopyDto (required): - Future copyAssetWithHttpInfo(AssetCopyDto assetCopyDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/copy'; - - // ignore: prefer_final_locals - Object? postBody = assetCopyDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Copy asset - /// - /// Copy asset information like albums, tags, etc. from one asset to another. - /// - /// Parameters: - /// - /// * [AssetCopyDto] assetCopyDto (required): - Future copyAsset(AssetCopyDto assetCopyDto,) async { - final response = await copyAssetWithHttpInfo(assetCopyDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete asset metadata by key - /// - /// Delete a specific metadata key-value pair associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Asset ID - /// - /// * [String] key (required): - /// Metadata key - Future deleteAssetMetadataWithHttpInfo(String id, String key,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/metadata/{key}' - .replaceAll('{id}', id) - .replaceAll('{key}', key); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete asset metadata by key - /// - /// Delete a specific metadata key-value pair associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Asset ID - /// - /// * [String] key (required): - /// Metadata key - Future deleteAssetMetadata(String id, String key,) async { - final response = await deleteAssetMetadataWithHttpInfo(id, key,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete assets - /// - /// Deletes multiple assets at the same time. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required): - Future deleteAssetsWithHttpInfo(AssetBulkDeleteDto assetBulkDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets'; - - // ignore: prefer_final_locals - Object? postBody = assetBulkDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete assets - /// - /// Deletes multiple assets at the same time. - /// - /// Parameters: - /// - /// * [AssetBulkDeleteDto] assetBulkDeleteDto (required): - Future deleteAssets(AssetBulkDeleteDto assetBulkDeleteDto,) async { - final response = await deleteAssetsWithHttpInfo(assetBulkDeleteDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete asset metadata - /// - /// Delete metadata key-value pairs for multiple assets. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required): - Future deleteBulkAssetMetadataWithHttpInfo(AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/metadata'; - - // ignore: prefer_final_locals - Object? postBody = assetMetadataBulkDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete asset metadata - /// - /// Delete metadata key-value pairs for multiple assets. - /// - /// Parameters: - /// - /// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required): - Future deleteBulkAssetMetadata(AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto,) async { - final response = await deleteBulkAssetMetadataWithHttpInfo(assetMetadataBulkDeleteDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Download original asset - /// - /// Downloads the original file of the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [bool] edited: - /// Return edited asset if available - /// - /// * [String] key: - /// - /// * [String] slug: - Future downloadAssetWithHttpInfo(String id, { bool? edited, String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/original' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (edited != null) { - queryParams.addAll(_queryParams('', 'edited', edited)); - } - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Download original asset - /// - /// Downloads the original file of the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [bool] edited: - /// Return edited asset if available - /// - /// * [String] key: - /// - /// * [String] slug: - Future downloadAsset(String id, { bool? edited, String? key, String? slug, }) async { - final response = await downloadAssetWithHttpInfo(id, edited: edited, key: key, slug: slug, ); - 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; - } - - /// Apply edits to an existing asset - /// - /// Apply a series of edit actions (crop, rotate, mirror) to the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetEditActionListDto] assetEditActionListDto (required): - Future editAssetWithHttpInfo(String id, AssetEditActionListDto assetEditActionListDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/edits' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = assetEditActionListDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Apply edits to an existing asset - /// - /// Apply a series of edit actions (crop, rotate, mirror) to the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetEditActionListDto] assetEditActionListDto (required): - Future editAsset(String id, AssetEditActionListDto assetEditActionListDto,) async { - final response = await editAssetWithHttpInfo(id, assetEditActionListDto,); - 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), 'AssetEditsDto',) as AssetEditsDto; - - } - return null; - } - - /// Retrieve assets by device ID - /// - /// Get all asset of a device that are in the database, ID only. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] deviceId (required): - /// Device ID - Future getAllUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/device/{deviceId}' - .replaceAll('{deviceId}', deviceId); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve assets by device ID - /// - /// Get all asset of a device that are in the database, ID only. - /// - /// Parameters: - /// - /// * [String] deviceId (required): - /// Device ID - Future?> getAllUserAssetsByDeviceId(String deviceId,) async { - final response = await getAllUserAssetsByDeviceIdWithHttpInfo(deviceId,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve edits for an existing asset - /// - /// Retrieve a series of edit actions (crop, rotate, mirror) associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getAssetEditsWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/edits' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve edits for an existing asset - /// - /// Retrieve a series of edit actions (crop, rotate, mirror) associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getAssetEdits(String id,) async { - final response = await getAssetEditsWithHttpInfo(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), 'AssetEditsDto',) as AssetEditsDto; - - } - return null; - } - - /// Retrieve an asset - /// - /// Retrieve detailed information about a specific asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future getAssetInfoWithHttpInfo(String id, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve an asset - /// - /// Retrieve detailed information about a specific asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future getAssetInfo(String id, { String? key, String? slug, }) async { - final response = await getAssetInfoWithHttpInfo(id, key: key, slug: slug, ); - 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), 'AssetResponseDto',) as AssetResponseDto; - - } - return null; - } - - /// Get asset metadata - /// - /// Retrieve all metadata key-value pairs associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getAssetMetadataWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/metadata' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get asset metadata - /// - /// Retrieve all metadata key-value pairs associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - Future?> getAssetMetadata(String id,) async { - final response = await getAssetMetadataWithHttpInfo(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) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve asset metadata by key - /// - /// Retrieve the value of a specific metadata key associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Asset ID - /// - /// * [String] key (required): - /// Metadata key - Future getAssetMetadataByKeyWithHttpInfo(String id, String key,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/metadata/{key}' - .replaceAll('{id}', id) - .replaceAll('{key}', key); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve asset metadata by key - /// - /// Retrieve the value of a specific metadata key associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Asset ID - /// - /// * [String] key (required): - /// Metadata key - Future getAssetMetadataByKey(String id, String key,) async { - final response = await getAssetMetadataByKeyWithHttpInfo(id, key,); - 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), 'AssetMetadataResponseDto',) as AssetMetadataResponseDto; - - } - return null; - } - - /// Retrieve asset OCR data - /// - /// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getAssetOcrWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/ocr' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve asset OCR data - /// - /// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - Future?> getAssetOcr(String id,) async { - final response = await getAssetOcrWithHttpInfo(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) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Get asset statistics - /// - /// Retrieve various statistics about the assets owned by the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [bool] isFavorite: - /// Filter by favorite status - /// - /// * [bool] isTrashed: - /// Filter by trash status - /// - /// * [AssetVisibility] visibility: - /// Filter by visibility - Future getAssetStatisticsWithHttpInfo({ bool? isFavorite, bool? isTrashed, AssetVisibility? visibility, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/statistics'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isTrashed != null) { - queryParams.addAll(_queryParams('', 'isTrashed', isTrashed)); - } - if (visibility != null) { - queryParams.addAll(_queryParams('', 'visibility', visibility)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get asset statistics - /// - /// Retrieve various statistics about the assets owned by the authenticated user. - /// - /// Parameters: - /// - /// * [bool] isFavorite: - /// Filter by favorite status - /// - /// * [bool] isTrashed: - /// Filter by trash status - /// - /// * [AssetVisibility] visibility: - /// Filter by visibility - Future getAssetStatistics({ bool? isFavorite, bool? isTrashed, AssetVisibility? visibility, }) async { - final response = await getAssetStatisticsWithHttpInfo( 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; - } - - /// Get random assets - /// - /// Retrieve a specified number of random assets for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [num] count: - /// Number of random assets to return - Future getRandomWithHttpInfo({ num? count, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/random'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (count != null) { - queryParams.addAll(_queryParams('', 'count', count)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get random assets - /// - /// Retrieve a specified number of random assets for the authenticated user. - /// - /// Parameters: - /// - /// * [num] count: - /// Number of random assets to return - Future?> getRandom({ num? count, }) async { - final response = await getRandomWithHttpInfo( count: count, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Play asset video - /// - /// Streams the video file for the specified asset. This endpoint also supports byte range requests. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future playAssetVideoWithHttpInfo(String id, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/video/playback' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Play asset video - /// - /// Streams the video file for the specified asset. This endpoint also supports byte range requests. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future playAssetVideo(String id, { String? key, String? slug, }) async { - final response = await playAssetVideoWithHttpInfo(id, key: key, slug: slug, ); - 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; - } - - /// Remove edits from an existing asset - /// - /// Removes all edit actions (crop, rotate, mirror) associated with the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future removeAssetEditsWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/edits' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Remove edits from an existing asset - /// - /// Removes all edit actions (crop, rotate, mirror) associated with the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - Future removeAssetEdits(String id,) async { - final response = await removeAssetEditsWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Replace asset - /// - /// Replace the asset with new file, without changing its id. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - Future replaceAssetWithHttpInfo(String id, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? duration, String? filename, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/original' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['multipart/form-data']; - - bool hasFields = false; - final mp = MultipartRequest('PUT', Uri.parse(apiPath)); - if (assetData != null) { - hasFields = true; - mp.fields[r'assetData'] = assetData.field; - mp.files.add(assetData); - } - if (deviceAssetId != null) { - hasFields = true; - mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId); - } - if (deviceId != null) { - hasFields = true; - mp.fields[r'deviceId'] = parameterToString(deviceId); - } - if (duration != null) { - hasFields = true; - mp.fields[r'duration'] = parameterToString(duration); - } - if (fileCreatedAt != null) { - hasFields = true; - mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt); - } - if (fileModifiedAt != null) { - hasFields = true; - mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt); - } - if (filename != null) { - hasFields = true; - mp.fields[r'filename'] = parameterToString(filename); - } - if (hasFields) { - postBody = mp; - } - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Replace asset - /// - /// Replace the asset with new file, without changing its id. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - Future replaceAsset(String id, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? duration, String? filename, }) async { - final response = await replaceAssetWithHttpInfo(id, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, slug: slug, duration: duration, filename: 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), 'AssetMediaResponseDto',) as AssetMediaResponseDto; - - } - return null; - } - - /// Run an asset job - /// - /// Run a specific job on a set of assets. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetJobsDto] assetJobsDto (required): - Future runAssetJobsWithHttpInfo(AssetJobsDto assetJobsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/jobs'; - - // ignore: prefer_final_locals - Object? postBody = assetJobsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Run an asset job - /// - /// Run a specific job on a set of assets. - /// - /// Parameters: - /// - /// * [AssetJobsDto] assetJobsDto (required): - Future runAssetJobs(AssetJobsDto assetJobsDto,) async { - final response = await runAssetJobsWithHttpInfo(assetJobsDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Update an asset - /// - /// Update information of a specific asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateAssetDto] updateAssetDto (required): - Future updateAssetWithHttpInfo(String id, UpdateAssetDto updateAssetDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = updateAssetDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update an asset - /// - /// Update information of a specific asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateAssetDto] updateAssetDto (required): - Future updateAsset(String id, UpdateAssetDto updateAssetDto,) async { - final response = await updateAssetWithHttpInfo(id, updateAssetDto,); - 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), 'AssetResponseDto',) as AssetResponseDto; - - } - return null; - } - - /// Update asset metadata - /// - /// Update or add metadata key-value pairs for the specified asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required): - Future updateAssetMetadataWithHttpInfo(String id, AssetMetadataUpsertDto assetMetadataUpsertDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/metadata' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = assetMetadataUpsertDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update asset metadata - /// - /// Update or add metadata key-value pairs for the specified asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required): - Future?> updateAssetMetadata(String id, AssetMetadataUpsertDto assetMetadataUpsertDto,) async { - final response = await updateAssetMetadataWithHttpInfo(id, assetMetadataUpsertDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update assets - /// - /// Updates multiple assets at the same time. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required): - Future updateAssetsWithHttpInfo(AssetBulkUpdateDto assetBulkUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets'; - - // ignore: prefer_final_locals - Object? postBody = assetBulkUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update assets - /// - /// Updates multiple assets at the same time. - /// - /// Parameters: - /// - /// * [AssetBulkUpdateDto] assetBulkUpdateDto (required): - Future updateAssets(AssetBulkUpdateDto assetBulkUpdateDto,) async { - final response = await updateAssetsWithHttpInfo(assetBulkUpdateDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Upsert asset metadata - /// - /// Upsert metadata key-value pairs for multiple assets. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required): - Future updateBulkAssetMetadataWithHttpInfo(AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/metadata'; - - // ignore: prefer_final_locals - Object? postBody = assetMetadataBulkUpsertDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Upsert asset metadata - /// - /// Upsert metadata key-value pairs for multiple assets. - /// - /// Parameters: - /// - /// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required): - Future?> updateBulkAssetMetadata(AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto,) async { - final response = await updateBulkAssetMetadataWithHttpInfo(assetMetadataBulkUpsertDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Upload asset - /// - /// Uploads a new asset to the server. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] xImmichChecksum: - /// sha1 checksum that can be used for duplicate detection before the file is uploaded - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - /// - /// * [bool] isFavorite: - /// Mark as favorite - /// - /// * [String] livePhotoVideoId: - /// Live photo video ID - /// - /// * [List] metadata: - /// Asset metadata items - /// - /// * [MultipartFile] sidecarData: - /// Sidecar file data - /// - /// * [AssetVisibility] visibility: - /// Asset visibility - Future uploadAssetWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? xImmichChecksum, String? duration, String? filename, bool? isFavorite, String? livePhotoVideoId, List? metadata, MultipartFile? sidecarData, AssetVisibility? visibility, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - if (xImmichChecksum != null) { - headerParams[r'x-immich-checksum'] = parameterToString(xImmichChecksum); - } - - const contentTypes = ['multipart/form-data']; - - bool hasFields = false; - final mp = MultipartRequest('POST', Uri.parse(apiPath)); - if (assetData != null) { - hasFields = true; - mp.fields[r'assetData'] = assetData.field; - mp.files.add(assetData); - } - if (deviceAssetId != null) { - hasFields = true; - mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId); - } - if (deviceId != null) { - hasFields = true; - mp.fields[r'deviceId'] = parameterToString(deviceId); - } - if (duration != null) { - hasFields = true; - mp.fields[r'duration'] = parameterToString(duration); - } - if (fileCreatedAt != null) { - hasFields = true; - mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt); - } - if (fileModifiedAt != null) { - hasFields = true; - mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt); - } - if (filename != null) { - hasFields = true; - mp.fields[r'filename'] = parameterToString(filename); - } - if (isFavorite != null) { - hasFields = true; - mp.fields[r'isFavorite'] = parameterToString(isFavorite); - } - if (livePhotoVideoId != null) { - hasFields = true; - mp.fields[r'livePhotoVideoId'] = parameterToString(livePhotoVideoId); - } - if (metadata != null) { - hasFields = true; - mp.fields[r'metadata'] = parameterToString(metadata); - } - if (sidecarData != null) { - hasFields = true; - mp.fields[r'sidecarData'] = sidecarData.field; - mp.files.add(sidecarData); - } - if (visibility != null) { - hasFields = true; - mp.fields[r'visibility'] = parameterToString(visibility); - } - if (hasFields) { - postBody = mp; - } - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Upload asset - /// - /// Uploads a new asset to the server. - /// - /// Parameters: - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] xImmichChecksum: - /// sha1 checksum that can be used for duplicate detection before the file is uploaded - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - /// - /// * [bool] isFavorite: - /// Mark as favorite - /// - /// * [String] livePhotoVideoId: - /// Live photo video ID - /// - /// * [List] metadata: - /// Asset metadata items - /// - /// * [MultipartFile] sidecarData: - /// Sidecar file data - /// - /// * [AssetVisibility] visibility: - /// Asset visibility - Future uploadAsset(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? xImmichChecksum, String? duration, String? filename, bool? isFavorite, String? livePhotoVideoId, List? metadata, MultipartFile? sidecarData, AssetVisibility? visibility, }) async { - final response = await uploadAssetWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, slug: slug, xImmichChecksum: xImmichChecksum, duration: duration, filename: filename, isFavorite: isFavorite, livePhotoVideoId: livePhotoVideoId, metadata: metadata, sidecarData: sidecarData, 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), 'AssetMediaResponseDto',) as AssetMediaResponseDto; - - } - return null; - } - - /// View asset thumbnail - /// - /// Retrieve the thumbnail image for the specified asset. Viewing the fullsize thumbnail might redirect to downloadAsset, which requires a different permission. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [bool] edited: - /// Return edited asset if available - /// - /// * [String] key: - /// - /// * [AssetMediaSize] size: - /// Asset media size - /// - /// * [String] slug: - Future viewAssetWithHttpInfo(String id, { bool? edited, String? key, AssetMediaSize? size, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/thumbnail' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (edited != null) { - queryParams.addAll(_queryParams('', 'edited', edited)); - } - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (size != null) { - queryParams.addAll(_queryParams('', 'size', size)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// View asset thumbnail - /// - /// Retrieve the thumbnail image for the specified asset. Viewing the fullsize thumbnail might redirect to downloadAsset, which requires a different permission. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [bool] edited: - /// Return edited asset if available - /// - /// * [String] key: - /// - /// * [AssetMediaSize] size: - /// Asset media size - /// - /// * [String] slug: - Future viewAsset(String id, { bool? edited, String? key, AssetMediaSize? size, String? slug, }) async { - final response = await viewAssetWithHttpInfo(id, edited: edited, key: key, size: size, slug: slug, ); - 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; - } -} diff --git a/mobile/openapi/lib/api/authentication_admin_api.dart b/mobile/openapi/lib/api/authentication_admin_api.dart deleted file mode 100644 index 0a4b91ebc3..0000000000 --- a/mobile/openapi/lib/api/authentication_admin_api.dart +++ /dev/null @@ -1,58 +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 AuthenticationAdminApi { - AuthenticationAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Unlink all OAuth accounts - /// - /// Unlinks all OAuth accounts associated with user accounts in the system. - /// - /// Note: This method returns the HTTP [Response]. - Future unlinkAllOAuthAccountsAdminWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/auth/unlink-all'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Unlink all OAuth accounts - /// - /// Unlinks all OAuth accounts associated with user accounts in the system. - Future unlinkAllOAuthAccountsAdmin() async { - final response = await unlinkAllOAuthAccountsAdminWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/authentication_api.dart b/mobile/openapi/lib/api/authentication_api.dart index 52d46a525b..4365007056 100644 --- a/mobile/openapi/lib/api/authentication_api.dart +++ b/mobile/openapi/lib/api/authentication_api.dart @@ -72,254 +72,6 @@ class AuthenticationApi { return null; } - /// Change pin code - /// - /// Change the pin code for the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [PinCodeChangeDto] pinCodeChangeDto (required): - Future changePinCodeWithHttpInfo(PinCodeChangeDto pinCodeChangeDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/pin-code'; - - // ignore: prefer_final_locals - Object? postBody = pinCodeChangeDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Change pin code - /// - /// Change the pin code for the current user. - /// - /// Parameters: - /// - /// * [PinCodeChangeDto] pinCodeChangeDto (required): - Future changePinCode(PinCodeChangeDto pinCodeChangeDto,) async { - final response = await changePinCodeWithHttpInfo(pinCodeChangeDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Finish OAuth - /// - /// Complete the OAuth authorization process by exchanging the authorization code for a session token. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [OAuthCallbackDto] oAuthCallbackDto (required): - Future finishOAuthWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/oauth/callback'; - - // ignore: prefer_final_locals - Object? postBody = oAuthCallbackDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Finish OAuth - /// - /// Complete the OAuth authorization process by exchanging the authorization code for a session token. - /// - /// Parameters: - /// - /// * [OAuthCallbackDto] oAuthCallbackDto (required): - Future finishOAuth(OAuthCallbackDto oAuthCallbackDto,) async { - final response = await finishOAuthWithHttpInfo(oAuthCallbackDto,); - 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), 'LoginResponseDto',) as LoginResponseDto; - - } - return null; - } - - /// Retrieve auth status - /// - /// Get information about the current session, including whether the user has a password, and if the session can access locked assets. - /// - /// Note: This method returns the HTTP [Response]. - Future getAuthStatusWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/status'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve auth status - /// - /// Get information about the current session, including whether the user has a password, and if the session can access locked assets. - Future getAuthStatus() async { - final response = await getAuthStatusWithHttpInfo(); - 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), 'AuthStatusResponseDto',) as AuthStatusResponseDto; - - } - return null; - } - - /// Link OAuth account - /// - /// Link an OAuth account to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [OAuthCallbackDto] oAuthCallbackDto (required): - Future linkOAuthAccountWithHttpInfo(OAuthCallbackDto oAuthCallbackDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/oauth/link'; - - // ignore: prefer_final_locals - Object? postBody = oAuthCallbackDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Link OAuth account - /// - /// Link an OAuth account to the authenticated user. - /// - /// Parameters: - /// - /// * [OAuthCallbackDto] oAuthCallbackDto (required): - Future linkOAuthAccount(OAuthCallbackDto oAuthCallbackDto,) async { - final response = await linkOAuthAccountWithHttpInfo(oAuthCallbackDto,); - 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; - } - - /// Lock auth session - /// - /// Remove elevated access to locked assets from the current session. - /// - /// Note: This method returns the HTTP [Response]. - Future lockAuthSessionWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/session/lock'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Lock auth session - /// - /// Remove elevated access to locked assets from the current session. - Future lockAuthSession() async { - final response = await lockAuthSessionWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - /// Login /// /// Login with username and password and receive a session token. @@ -424,142 +176,6 @@ class AuthenticationApi { return null; } - /// Redirect OAuth to mobile - /// - /// Requests to this URL are automatically forwarded to the mobile app, and is used in some cases for OAuth redirecting. - /// - /// Note: This method returns the HTTP [Response]. - Future redirectOAuthToMobileWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/oauth/mobile-redirect'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Redirect OAuth to mobile - /// - /// Requests to this URL are automatically forwarded to the mobile app, and is used in some cases for OAuth redirecting. - Future redirectOAuthToMobile() async { - final response = await redirectOAuthToMobileWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Reset pin code - /// - /// Reset the pin code for the current user by providing the account password - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [PinCodeResetDto] pinCodeResetDto (required): - Future resetPinCodeWithHttpInfo(PinCodeResetDto pinCodeResetDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/pin-code'; - - // ignore: prefer_final_locals - Object? postBody = pinCodeResetDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Reset pin code - /// - /// Reset the pin code for the current user by providing the account password - /// - /// Parameters: - /// - /// * [PinCodeResetDto] pinCodeResetDto (required): - Future resetPinCode(PinCodeResetDto pinCodeResetDto,) async { - final response = await resetPinCodeWithHttpInfo(pinCodeResetDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Setup pin code - /// - /// Setup a new pin code for the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [PinCodeSetupDto] pinCodeSetupDto (required): - Future setupPinCodeWithHttpInfo(PinCodeSetupDto pinCodeSetupDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/pin-code'; - - // ignore: prefer_final_locals - Object? postBody = pinCodeSetupDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Setup pin code - /// - /// Setup a new pin code for the current user. - /// - /// Parameters: - /// - /// * [PinCodeSetupDto] pinCodeSetupDto (required): - Future setupPinCode(PinCodeSetupDto pinCodeSetupDto,) async { - final response = await setupPinCodeWithHttpInfo(pinCodeSetupDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - /// Register admin /// /// Create the first admin user in the system. @@ -616,158 +232,6 @@ class AuthenticationApi { return null; } - /// Start OAuth - /// - /// Initiate the OAuth authorization process. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [OAuthConfigDto] oAuthConfigDto (required): - Future startOAuthWithHttpInfo(OAuthConfigDto oAuthConfigDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/oauth/authorize'; - - // ignore: prefer_final_locals - Object? postBody = oAuthConfigDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Start OAuth - /// - /// Initiate the OAuth authorization process. - /// - /// Parameters: - /// - /// * [OAuthConfigDto] oAuthConfigDto (required): - Future startOAuth(OAuthConfigDto oAuthConfigDto,) async { - final response = await startOAuthWithHttpInfo(oAuthConfigDto,); - 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), 'OAuthAuthorizeResponseDto',) as OAuthAuthorizeResponseDto; - - } - return null; - } - - /// Unlink OAuth account - /// - /// Unlink the OAuth account from the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - Future unlinkOAuthAccountWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/oauth/unlink'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Unlink OAuth account - /// - /// Unlink the OAuth account from the authenticated user. - Future unlinkOAuthAccount() async { - final response = await unlinkOAuthAccountWithHttpInfo(); - 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; - } - - /// Unlock auth session - /// - /// Temporarily grant the session elevated access to locked assets by providing the correct PIN code. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SessionUnlockDto] sessionUnlockDto (required): - Future unlockAuthSessionWithHttpInfo(SessionUnlockDto sessionUnlockDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/auth/session/unlock'; - - // ignore: prefer_final_locals - Object? postBody = sessionUnlockDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Unlock auth session - /// - /// Temporarily grant the session elevated access to locked assets by providing the correct PIN code. - /// - /// Parameters: - /// - /// * [SessionUnlockDto] sessionUnlockDto (required): - Future unlockAuthSession(SessionUnlockDto sessionUnlockDto,) async { - final response = await unlockAuthSessionWithHttpInfo(sessionUnlockDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - /// Validate access token /// /// Validate the current authorization method is still valid. diff --git a/mobile/openapi/lib/api/database_backups_admin_api.dart b/mobile/openapi/lib/api/database_backups_admin_api.dart deleted file mode 100644 index fbd485f86f..0000000000 --- a/mobile/openapi/lib/api/database_backups_admin_api.dart +++ /dev/null @@ -1,269 +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 DatabaseBackupsAdminApi { - DatabaseBackupsAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Delete database backup - /// - /// Delete a backup by its filename - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [DatabaseBackupDeleteDto] databaseBackupDeleteDto (required): - Future deleteDatabaseBackupWithHttpInfo(DatabaseBackupDeleteDto databaseBackupDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/database-backups'; - - // ignore: prefer_final_locals - Object? postBody = databaseBackupDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete database backup - /// - /// Delete a backup by its filename - /// - /// Parameters: - /// - /// * [DatabaseBackupDeleteDto] databaseBackupDeleteDto (required): - Future deleteDatabaseBackup(DatabaseBackupDeleteDto databaseBackupDeleteDto,) async { - final response = await deleteDatabaseBackupWithHttpInfo(databaseBackupDeleteDto,); - 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 - /// - /// Note: This method returns the HTTP [Response]. - Future listDatabaseBackupsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/database-backups'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List database backups - /// - /// Get the list of the successful and failed backups - Future listDatabaseBackups() async { - final response = await listDatabaseBackupsWithHttpInfo(); - 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 null; - } - - /// Start database backup restore flow - /// - /// Put Immich into maintenance mode to restore a backup (Immich must not be configured) - /// - /// Note: This method returns the HTTP [Response]. - Future startDatabaseRestoreFlowWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/database-backups/start-restore'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Start database backup restore flow - /// - /// Put Immich into maintenance mode to restore a backup (Immich must not be configured) - Future startDatabaseRestoreFlow() async { - final response = await startDatabaseRestoreFlowWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Upload database backup - /// - /// Uploads .sql/.sql.gz file to restore backup from - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [MultipartFile] file: - Future uploadDatabaseBackupWithHttpInfo({ MultipartFile? file, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/database-backups/upload'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['multipart/form-data']; - - bool hasFields = false; - final mp = MultipartRequest('POST', Uri.parse(apiPath)); - if (file != null) { - hasFields = true; - mp.fields[r'file'] = file.field; - mp.files.add(file); - } - if (hasFields) { - postBody = mp; - } - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Upload database backup - /// - /// Uploads .sql/.sql.gz file to restore backup from - /// - /// Parameters: - /// - /// * [MultipartFile] file: - Future uploadDatabaseBackup({ MultipartFile? file, }) async { - final response = await uploadDatabaseBackupWithHttpInfo( file: file, ); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/deprecated_api.dart b/mobile/openapi/lib/api/deprecated_api.dart deleted file mode 100644 index 33bcaf062c..0000000000 --- a/mobile/openapi/lib/api/deprecated_api.dart +++ /dev/null @@ -1,576 +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 createPartnerDeprecatedWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 assets by device ID - /// - /// Get all asset of a device that are in the database, ID only. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] deviceId (required): - /// Device ID - Future getAllUserAssetsByDeviceIdWithHttpInfo(String deviceId,) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/device/{deviceId}' - .replaceAll('{deviceId}', deviceId); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve assets by device ID - /// - /// Get all asset of a device that are in the database, ID only. - /// - /// Parameters: - /// - /// * [String] deviceId (required): - /// Device ID - Future?> getAllUserAssetsByDeviceId(String deviceId,) async { - final response = await getAllUserAssetsByDeviceIdWithHttpInfo(deviceId,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Get delta sync for user - /// - /// Retrieve changed assets since the last sync for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetDeltaSyncDto] assetDeltaSyncDto (required): - Future getDeltaSyncWithHttpInfo(AssetDeltaSyncDto assetDeltaSyncDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/delta-sync'; - - // ignore: prefer_final_locals - Object? postBody = assetDeltaSyncDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get delta sync for user - /// - /// Retrieve changed assets since the last sync for the authenticated user. - /// - /// Parameters: - /// - /// * [AssetDeltaSyncDto] assetDeltaSyncDto (required): - Future getDeltaSync(AssetDeltaSyncDto assetDeltaSyncDto,) async { - final response = await getDeltaSyncWithHttpInfo(assetDeltaSyncDto,); - 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), 'AssetDeltaSyncResponseDto',) as AssetDeltaSyncResponseDto; - - } - return null; - } - - /// Get full sync for user - /// - /// Retrieve all assets for a full synchronization for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetFullSyncDto] assetFullSyncDto (required): - Future getFullSyncForUserWithHttpInfo(AssetFullSyncDto assetFullSyncDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/full-sync'; - - // ignore: prefer_final_locals - Object? postBody = assetFullSyncDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get full sync for user - /// - /// Retrieve all assets for a full synchronization for the authenticated user. - /// - /// Parameters: - /// - /// * [AssetFullSyncDto] assetFullSyncDto (required): - Future?> getFullSyncForUser(AssetFullSyncDto assetFullSyncDto,) async { - final response = await getFullSyncForUserWithHttpInfo(assetFullSyncDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - 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 getQueuesLegacyWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/jobs'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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; - } - - /// Get random assets - /// - /// Retrieve a specified number of random assets for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [num] count: - /// Number of random assets to return - Future getRandomWithHttpInfo({ num? count, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/random'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (count != null) { - queryParams.addAll(_queryParams('', 'count', count)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get random assets - /// - /// Retrieve a specified number of random assets for the authenticated user. - /// - /// Parameters: - /// - /// * [num] count: - /// Number of random assets to return - Future?> getRandom({ num? count, }) async { - final response = await getRandomWithHttpInfo( count: count, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Replace asset - /// - /// Replace the asset with new file, without changing its id. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - Future replaceAssetWithHttpInfo(String id, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? duration, String? filename, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/assets/{id}/original' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['multipart/form-data']; - - bool hasFields = false; - final mp = MultipartRequest('PUT', Uri.parse(apiPath)); - if (assetData != null) { - hasFields = true; - mp.fields[r'assetData'] = assetData.field; - mp.files.add(assetData); - } - if (deviceAssetId != null) { - hasFields = true; - mp.fields[r'deviceAssetId'] = parameterToString(deviceAssetId); - } - if (deviceId != null) { - hasFields = true; - mp.fields[r'deviceId'] = parameterToString(deviceId); - } - if (duration != null) { - hasFields = true; - mp.fields[r'duration'] = parameterToString(duration); - } - if (fileCreatedAt != null) { - hasFields = true; - mp.fields[r'fileCreatedAt'] = parameterToString(fileCreatedAt); - } - if (fileModifiedAt != null) { - hasFields = true; - mp.fields[r'fileModifiedAt'] = parameterToString(fileModifiedAt); - } - if (filename != null) { - hasFields = true; - mp.fields[r'filename'] = parameterToString(filename); - } - if (hasFields) { - postBody = mp; - } - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Replace asset - /// - /// Replace the asset with new file, without changing its id. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MultipartFile] assetData (required): - /// Asset file data - /// - /// * [String] deviceAssetId (required): - /// Device asset ID - /// - /// * [String] deviceId (required): - /// Device ID - /// - /// * [DateTime] fileCreatedAt (required): - /// File creation date - /// - /// * [DateTime] fileModifiedAt (required): - /// File modification date - /// - /// * [String] key: - /// - /// * [String] slug: - /// - /// * [String] duration: - /// Duration (for videos) - /// - /// * [String] filename: - /// Filename - Future replaceAsset(String id, MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? slug, String? duration, String? filename, }) async { - final response = await replaceAssetWithHttpInfo(id, assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, slug: slug, duration: duration, filename: 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), 'AssetMediaResponseDto',) as AssetMediaResponseDto; - - } - 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): - /// Queue name - /// - /// * [QueueCommandDto] queueCommandDto (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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): - /// Queue name - /// - /// * [QueueCommandDto] queueCommandDto (required): - Future 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; - } -} diff --git a/mobile/openapi/lib/api/download_api.dart b/mobile/openapi/lib/api/download_api.dart deleted file mode 100644 index 5245622753..0000000000 --- a/mobile/openapi/lib/api/download_api.dart +++ /dev/null @@ -1,160 +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 DownloadApi { - DownloadApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Download asset archive - /// - /// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the \"getDownloadInfo\" endpoint. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetIdsDto] assetIdsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future downloadArchiveWithHttpInfo(AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/download/archive'; - - // ignore: prefer_final_locals - Object? postBody = assetIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Download asset archive - /// - /// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the \"getDownloadInfo\" endpoint. - /// - /// Parameters: - /// - /// * [AssetIdsDto] assetIdsDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future downloadArchive(AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - final response = await downloadArchiveWithHttpInfo(assetIdsDto, key: key, slug: slug, ); - 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; - } - - /// 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. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [DownloadInfoDto] downloadInfoDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/download/info'; - - // ignore: prefer_final_locals - Object? postBody = downloadInfoDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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. - /// - /// Parameters: - /// - /// * [DownloadInfoDto] downloadInfoDto (required): - /// - /// * [String] key: - /// - /// * [String] slug: - Future getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, String? slug, }) async { - final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, slug: slug, ); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/duplicates_api.dart b/mobile/openapi/lib/api/duplicates_api.dart deleted file mode 100644 index 7fa7b368b5..0000000000 --- a/mobile/openapi/lib/api/duplicates_api.dart +++ /dev/null @@ -1,166 +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 DuplicatesApi { - DuplicatesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Delete a duplicate - /// - /// Delete a single duplicate asset specified by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteDuplicateWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/duplicates/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a duplicate - /// - /// Delete a single duplicate asset specified by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteDuplicate(String id,) async { - final response = await deleteDuplicateWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete duplicates - /// - /// Delete multiple duplicate assets specified by their IDs. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future deleteDuplicatesWithHttpInfo(BulkIdsDto bulkIdsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/duplicates'; - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete duplicates - /// - /// Delete multiple duplicate assets specified by their IDs. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future deleteDuplicates(BulkIdsDto bulkIdsDto,) async { - final response = await deleteDuplicatesWithHttpInfo(bulkIdsDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Retrieve duplicates - /// - /// Retrieve a list of duplicate assets available to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - Future getAssetDuplicatesWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/duplicates'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve duplicates - /// - /// Retrieve a list of duplicate assets available to the authenticated user. - Future?> getAssetDuplicates() async { - final response = await getAssetDuplicatesWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/faces_api.dart b/mobile/openapi/lib/api/faces_api.dart deleted file mode 100644 index 43d63b47b9..0000000000 --- a/mobile/openapi/lib/api/faces_api.dart +++ /dev/null @@ -1,243 +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 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 createFaceWithHttpInfo(AssetFaceCreateDto assetFaceCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/faces'; - - // ignore: prefer_final_locals - Object? postBody = assetFaceCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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 createFace(AssetFaceCreateDto assetFaceCreateDto,) async { - final response = await createFaceWithHttpInfo(assetFaceCreateDto,); - 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. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetFaceDeleteDto] assetFaceDeleteDto (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 deleteFace(String id, AssetFaceDeleteDto assetFaceDeleteDto,) async { - final response = await deleteFaceWithHttpInfo(id, assetFaceDeleteDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Retrieve faces for asset - /// - /// Retrieve all faces belonging to an asset. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Face ID - Future getFacesWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/faces'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'id', id)); - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve faces for asset - /// - /// Retrieve all faces belonging to an asset. - /// - /// Parameters: - /// - /// * [String] id (required): - /// Face ID - Future?> getFaces(String id,) async { - final response = await getFacesWithHttpInfo(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) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - 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. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [FaceDto] faceDto (required): - Future reassignFacesByIdWithHttpInfo(String id, FaceDto faceDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/faces/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = faceDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [FaceDto] faceDto (required): - Future reassignFacesById(String id, FaceDto faceDto,) async { - final response = await reassignFacesByIdWithHttpInfo(id, faceDto,); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/jobs_api.dart b/mobile/openapi/lib/api/jobs_api.dart deleted file mode 100644 index 41517f8144..0000000000 --- a/mobile/openapi/lib/api/jobs_api.dart +++ /dev/null @@ -1,177 +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 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 createJobWithHttpInfo(JobCreateDto jobCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/jobs'; - - // ignore: prefer_final_locals - Object? postBody = jobCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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 createJob(JobCreateDto jobCreateDto,) async { - final response = await createJobWithHttpInfo(jobCreateDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// 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 getQueuesLegacyWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/jobs'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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): - /// Queue name - /// - /// * [QueueCommandDto] queueCommandDto (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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): - /// Queue name - /// - /// * [QueueCommandDto] queueCommandDto (required): - Future 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; - } -} diff --git a/mobile/openapi/lib/api/libraries_api.dart b/mobile/openapi/lib/api/libraries_api.dart deleted file mode 100644 index ca59f823fe..0000000000 --- a/mobile/openapi/lib/api/libraries_api.dart +++ /dev/null @@ -1,459 +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 LibrariesApi { - LibrariesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Create a library - /// - /// Create a new external library. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [CreateLibraryDto] createLibraryDto (required): - Future createLibraryWithHttpInfo(CreateLibraryDto createLibraryDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries'; - - // ignore: prefer_final_locals - Object? postBody = createLibraryDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a library - /// - /// Create a new external library. - /// - /// Parameters: - /// - /// * [CreateLibraryDto] createLibraryDto (required): - Future createLibrary(CreateLibraryDto createLibraryDto,) async { - final response = await createLibraryWithHttpInfo(createLibraryDto,); - 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; - } - - /// Delete a library - /// - /// Delete an external library by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteLibraryWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a library - /// - /// Delete an external library by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteLibrary(String id,) async { - final response = await deleteLibraryWithHttpInfo(id,); - 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 getAllLibrariesWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve libraries - /// - /// Retrieve a list of external libraries. - Future?> 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve a library - /// - /// Retrieve an external library by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getLibraryWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve a library - /// - /// Retrieve an external library by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getLibrary(String id,) async { - final response = await getLibraryWithHttpInfo(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), '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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 scanLibrary(String id,) async { - final response = await scanLibraryWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Update a library - /// - /// Update an existing external library. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateLibraryDto] updateLibraryDto (required): - Future updateLibraryWithHttpInfo(String id, UpdateLibraryDto updateLibraryDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = updateLibraryDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a library - /// - /// Update an existing external library. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UpdateLibraryDto] updateLibraryDto (required): - Future updateLibrary(String id, UpdateLibraryDto updateLibraryDto,) async { - final response = await updateLibraryWithHttpInfo(id, updateLibraryDto,); - 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; - } - - /// Validate library settings - /// - /// Validate the settings of an external library. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [ValidateLibraryDto] validateLibraryDto (required): - Future validateWithHttpInfo(String id, ValidateLibraryDto validateLibraryDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/libraries/{id}/validate' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = validateLibraryDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Validate library settings - /// - /// Validate the settings of an external library. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [ValidateLibraryDto] validateLibraryDto (required): - Future validate(String id, ValidateLibraryDto validateLibraryDto,) async { - final response = await validateWithHttpInfo(id, validateLibraryDto,); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/maintenance_admin_api.dart b/mobile/openapi/lib/api/maintenance_admin_api.dart deleted file mode 100644 index 0f953f1634..0000000000 --- a/mobile/openapi/lib/api/maintenance_admin_api.dart +++ /dev/null @@ -1,218 +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 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 detectPriorInstallWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/maintenance/detect-install'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Detect existing install - /// - /// Collect integrity checks and other heuristics about local data. - Future 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; - } - - /// Get maintenance mode status - /// - /// Fetch information about the currently running maintenance action. - /// - /// Note: This method returns the HTTP [Response]. - Future getMaintenanceStatusWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/maintenance/status'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 maintenanceLoginWithHttpInfo(MaintenanceLoginDto maintenanceLoginDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/maintenance/login'; - - // ignore: prefer_final_locals - Object? postBody = maintenanceLoginDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 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; - } - - /// Set maintenance mode - /// - /// Put Immich into or take it out of maintenance mode - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SetMaintenanceModeDto] setMaintenanceModeDto (required): - Future setMaintenanceModeWithHttpInfo(SetMaintenanceModeDto setMaintenanceModeDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/maintenance'; - - // ignore: prefer_final_locals - Object? postBody = setMaintenanceModeDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Set maintenance mode - /// - /// Put Immich into or take it out of maintenance mode - /// - /// Parameters: - /// - /// * [SetMaintenanceModeDto] setMaintenanceModeDto (required): - Future setMaintenanceMode(SetMaintenanceModeDto setMaintenanceModeDto,) async { - final response = await setMaintenanceModeWithHttpInfo(setMaintenanceModeDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/map_api.dart b/mobile/openapi/lib/api/map_api.dart deleted file mode 100644 index 4ce62bd96c..0000000000 --- a/mobile/openapi/lib/api/map_api.dart +++ /dev/null @@ -1,198 +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 MapApi { - MapApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Retrieve map markers - /// - /// Retrieve a list of latitude and longitude coordinates for every asset with location data. - /// - /// 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 getMapMarkersWithHttpInfo({ DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, bool? isArchived, bool? isFavorite, bool? withPartners, bool? withSharedAlbums, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/map/markers'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (fileCreatedAfter != null) { - queryParams.addAll(_queryParams('', 'fileCreatedAfter', fileCreatedAfter)); - } - if (fileCreatedBefore != null) { - queryParams.addAll(_queryParams('', 'fileCreatedBefore', fileCreatedBefore)); - } - if (isArchived != null) { - queryParams.addAll(_queryParams('', 'isArchived', isArchived)); - } - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (withPartners != null) { - queryParams.addAll(_queryParams('', 'withPartners', withPartners)); - } - if (withSharedAlbums != null) { - queryParams.addAll(_queryParams('', 'withSharedAlbums', withSharedAlbums)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve map markers - /// - /// 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?> 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, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Reverse geocode coordinates - /// - /// Retrieve location information (e.g., city, country) for given latitude and longitude coordinates. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [double] lat (required): - /// Latitude (-90 to 90) - /// - /// * [double] lon (required): - /// Longitude (-180 to 180) - Future reverseGeocodeWithHttpInfo(double lat, double lon,) async { - // ignore: prefer_const_declarations - final apiPath = r'/map/reverse-geocode'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'lat', lat)); - queryParams.addAll(_queryParams('', 'lon', lon)); - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Reverse geocode coordinates - /// - /// 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?> reverseGeocode(double lat, double lon,) async { - final response = await reverseGeocodeWithHttpInfo(lat, lon,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/memories_api.dart b/mobile/openapi/lib/api/memories_api.dart deleted file mode 100644 index 913205428e..0000000000 --- a/mobile/openapi/lib/api/memories_api.dart +++ /dev/null @@ -1,586 +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 MemoriesApi { - MemoriesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Add assets to a memory - /// - /// Add a list of asset IDs to a specific memory. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future addMemoryAssetsWithHttpInfo(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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Add assets to a memory - /// - /// Add a list of asset IDs to a specific memory. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future?> addMemoryAssets(String id, BulkIdsDto bulkIdsDto,) async { - final response = await addMemoryAssetsWithHttpInfo(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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Create a memory - /// - /// Create a new memory by providing a name, description, and a list of asset IDs to include in the memory. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [MemoryCreateDto] memoryCreateDto (required): - Future createMemoryWithHttpInfo(MemoryCreateDto memoryCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories'; - - // ignore: prefer_final_locals - Object? postBody = memoryCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a memory - /// - /// 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 createMemory(MemoryCreateDto memoryCreateDto,) async { - final response = await createMemoryWithHttpInfo(memoryCreateDto,); - 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; - } - - /// Delete a memory - /// - /// Delete a specific memory by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteMemoryWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 getMemoryWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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; - } - - /// Retrieve memories statistics - /// - /// Retrieve statistics about memories, such as total count and other relevant metrics. - /// - /// 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: - /// Sort order - /// - /// * [int] size: - /// Number of memories to return - /// - /// * [MemoryType] type: - /// Memory type - Future memoriesStatisticsWithHttpInfo({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories/statistics'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - 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 = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve memories statistics - /// - /// 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: - /// Sort order - /// - /// * [int] size: - /// Number of memories to return - /// - /// * [MemoryType] type: - /// Memory type - Future 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Remove assets from a memory - /// - /// Remove a list of asset IDs from a specific memory. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future?> 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve memories - /// - /// 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. - /// - /// 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: - /// Sort order - /// - /// * [int] size: - /// Number of memories to return - /// - /// * [MemoryType] type: - /// Memory type - Future searchMemoriesWithHttpInfo({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - 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 = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve memories - /// - /// 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: - /// - /// * [DateTime] for_: - /// Filter by date - /// - /// * [bool] isSaved: - /// Filter by saved status - /// - /// * [bool] isTrashed: - /// Include trashed memories - /// - /// * [MemorySearchOrder] order: - /// Sort order - /// - /// * [int] size: - /// Number of memories to return - /// - /// * [MemoryType] type: - /// Memory type - Future?> 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, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update a memory - /// - /// Update an existing memory by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MemoryUpdateDto] memoryUpdateDto (required): - Future updateMemoryWithHttpInfo(String id, MemoryUpdateDto memoryUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/memories/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = memoryUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a memory - /// - /// Update an existing memory by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MemoryUpdateDto] memoryUpdateDto (required): - Future updateMemory(String id, MemoryUpdateDto memoryUpdateDto,) async { - final response = await updateMemoryWithHttpInfo(id, memoryUpdateDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api/notifications_admin_api.dart b/mobile/openapi/lib/api/notifications_admin_api.dart deleted file mode 100644 index 7821553d30..0000000000 --- a/mobile/openapi/lib/api/notifications_admin_api.dart +++ /dev/null @@ -1,191 +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 NotificationsAdminApi { - NotificationsAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Create a notification - /// - /// Create a new notification for a specific user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [NotificationCreateDto] notificationCreateDto (required): - Future createNotificationWithHttpInfo(NotificationCreateDto notificationCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/notifications'; - - // ignore: prefer_final_locals - Object? postBody = notificationCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a notification - /// - /// Create a new notification for a specific user. - /// - /// Parameters: - /// - /// * [NotificationCreateDto] notificationCreateDto (required): - Future createNotification(NotificationCreateDto notificationCreateDto,) async { - final response = await createNotificationWithHttpInfo(notificationCreateDto,); - 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; - } - - /// Render email template - /// - /// Retrieve a preview of the provided email template. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] name (required): - /// - /// * [TemplateDto] templateDto (required): - Future getNotificationTemplateAdminWithHttpInfo(String name, TemplateDto templateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/notifications/templates/{name}' - .replaceAll('{name}', name); - - // ignore: prefer_final_locals - Object? postBody = templateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Render email template - /// - /// Retrieve a preview of the provided email template. - /// - /// Parameters: - /// - /// * [String] name (required): - /// - /// * [TemplateDto] templateDto (required): - Future getNotificationTemplateAdmin(String name, TemplateDto templateDto,) async { - final response = await getNotificationTemplateAdminWithHttpInfo(name, templateDto,); - 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 null; - } - - /// Send test email - /// - /// Send a test email using the provided SMTP configuration. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SystemConfigSmtpDto] systemConfigSmtpDto (required): - Future sendTestEmailAdminWithHttpInfo(SystemConfigSmtpDto systemConfigSmtpDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/notifications/test-email'; - - // ignore: prefer_final_locals - Object? postBody = systemConfigSmtpDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Send test email - /// - /// Send a test email using the provided SMTP configuration. - /// - /// Parameters: - /// - /// * [SystemConfigSmtpDto] systemConfigSmtpDto (required): - Future sendTestEmailAdmin(SystemConfigSmtpDto systemConfigSmtpDto,) async { - final response = await sendTestEmailAdminWithHttpInfo(systemConfigSmtpDto,); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/notifications_api.dart b/mobile/openapi/lib/api/notifications_api.dart deleted file mode 100644 index d4e2b1d80f..0000000000 --- a/mobile/openapi/lib/api/notifications_api.dart +++ /dev/null @@ -1,373 +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 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 deleteNotificationWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/notifications/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a notification - /// - /// Delete a specific notification. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteNotification(String id,) async { - final response = await deleteNotificationWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete notifications - /// - /// Delete a list of notifications at once. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [NotificationDeleteAllDto] notificationDeleteAllDto (required): - Future deleteNotificationsWithHttpInfo(NotificationDeleteAllDto notificationDeleteAllDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/notifications'; - - // ignore: prefer_final_locals - Object? postBody = notificationDeleteAllDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete notifications - /// - /// Delete a list of notifications at once. - /// - /// Parameters: - /// - /// * [NotificationDeleteAllDto] notificationDeleteAllDto (required): - Future deleteNotifications(NotificationDeleteAllDto notificationDeleteAllDto,) async { - final response = await deleteNotificationsWithHttpInfo(notificationDeleteAllDto,); - 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 getNotificationWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/notifications/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id: - /// Filter by notification ID - /// - /// * [NotificationLevel] level: - /// Filter by notification level - /// - /// * [NotificationType] type: - /// Filter by notification type - /// - /// * [bool] unread: - /// Filter by unread status - Future getNotificationsWithHttpInfo({ String? id, NotificationLevel? level, NotificationType? type, bool? unread, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/notifications'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (id != null) { - queryParams.addAll(_queryParams('', 'id', id)); - } - if (level != null) { - queryParams.addAll(_queryParams('', 'level', level)); - } - if (type != null) { - queryParams.addAll(_queryParams('', 'type', type)); - } - if (unread != null) { - queryParams.addAll(_queryParams('', 'unread', unread)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve notifications - /// - /// Retrieve a list of notifications. - /// - /// Parameters: - /// - /// * [String] id: - /// Filter by notification ID - /// - /// * [NotificationLevel] level: - /// Filter by notification level - /// - /// * [NotificationType] type: - /// Filter by notification type - /// - /// * [bool] unread: - /// Filter by unread status - Future?> getNotifications({ String? id, NotificationLevel? level, NotificationType? type, bool? unread, }) async { - final response = await getNotificationsWithHttpInfo( id: id, level: level, type: type, unread: unread, ); - 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') as List) - .cast() - .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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 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; - } - - /// Update notifications - /// - /// Update a list of notifications. Allows to bulk-set the read status of notifications. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [NotificationUpdateAllDto] notificationUpdateAllDto (required): - Future updateNotificationsWithHttpInfo(NotificationUpdateAllDto notificationUpdateAllDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/notifications'; - - // ignore: prefer_final_locals - Object? postBody = notificationUpdateAllDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update notifications - /// - /// Update a list of notifications. Allows to bulk-set the read status of notifications. - /// - /// Parameters: - /// - /// * [NotificationUpdateAllDto] notificationUpdateAllDto (required): - Future updateNotifications(NotificationUpdateAllDto notificationUpdateAllDto,) async { - final response = await updateNotificationsWithHttpInfo(notificationUpdateAllDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/partners_api.dart b/mobile/openapi/lib/api/partners_api.dart deleted file mode 100644 index 3b15b90909..0000000000 --- a/mobile/openapi/lib/api/partners_api.dart +++ /dev/null @@ -1,304 +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 PartnersApi { - PartnersApi([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: - /// - /// * [PartnerCreateDto] partnerCreateDto (required): - Future createPartnerWithHttpInfo(PartnerCreateDto partnerCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners'; - - // ignore: prefer_final_locals - Object? postBody = partnerCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - 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: - /// - /// * [PartnerCreateDto] partnerCreateDto (required): - Future createPartner(PartnerCreateDto partnerCreateDto,) async { - final response = await createPartnerWithHttpInfo(partnerCreateDto,); - 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; - } - - /// Create a partner - /// - /// Create a new partner to share assets with. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future createPartnerDeprecatedWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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): - /// Partner direction - Future getPartnersWithHttpInfo(PartnerDirection direction,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'direction', direction)); - - const contentTypes = []; - - - 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): - /// Partner direction - Future?> 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Remove a partner - /// - /// Stop sharing assets with a partner. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future removePartnerWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Remove a partner - /// - /// Stop sharing assets with a partner. - /// - /// Parameters: - /// - /// * [String] id (required): - Future removePartner(String id,) async { - final response = await removePartnerWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Update a partner - /// - /// Specify whether a partner's assets should appear in the user's timeline. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [PartnerUpdateDto] partnerUpdateDto (required): - Future updatePartnerWithHttpInfo(String id, PartnerUpdateDto partnerUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/partners/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = partnerUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a partner - /// - /// Specify whether a partner's assets should appear in the user's timeline. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [PartnerUpdateDto] partnerUpdateDto (required): - Future updatePartner(String id, PartnerUpdateDto partnerUpdateDto,) async { - final response = await updatePartnerWithHttpInfo(id, partnerUpdateDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api/people_api.dart b/mobile/openapi/lib/api/people_api.dart deleted file mode 100644 index c8c1821423..0000000000 --- a/mobile/openapi/lib/api/people_api.dart +++ /dev/null @@ -1,688 +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 PeopleApi { - PeopleApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Create a person - /// - /// Create a new person that can have multiple faces assigned to them. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [PersonCreateDto] personCreateDto (required): - Future createPersonWithHttpInfo(PersonCreateDto personCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people'; - - // ignore: prefer_final_locals - Object? postBody = personCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a person - /// - /// Create a new person that can have multiple faces assigned to them. - /// - /// Parameters: - /// - /// * [PersonCreateDto] personCreateDto (required): - Future createPerson(PersonCreateDto personCreateDto,) async { - final response = await createPersonWithHttpInfo(personCreateDto,); - 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 null; - } - - /// Delete people - /// - /// Bulk delete a list of people at once. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future deletePeopleWithHttpInfo(BulkIdsDto bulkIdsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people'; - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete people - /// - /// Bulk delete a list of people at once. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future deletePeople(BulkIdsDto bulkIdsDto,) async { - final response = await deletePeopleWithHttpInfo(bulkIdsDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete person - /// - /// Delete an individual person. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deletePersonWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete person - /// - /// Delete an individual person. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deletePerson(String id,) async { - final response = await deletePersonWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Get all people - /// - /// Retrieve a list of all people. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] closestAssetId: - /// Closest asset ID for similarity search - /// - /// * [String] closestPersonId: - /// Closest person ID for similarity search - /// - /// * [num] page: - /// Page number for pagination - /// - /// * [num] size: - /// Number of items per page - /// - /// * [bool] withHidden: - /// Include hidden people - Future getAllPeopleWithHttpInfo({ String? closestAssetId, String? closestPersonId, num? page, num? size, bool? withHidden, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/people'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (closestAssetId != null) { - queryParams.addAll(_queryParams('', 'closestAssetId', closestAssetId)); - } - if (closestPersonId != null) { - queryParams.addAll(_queryParams('', 'closestPersonId', closestPersonId)); - } - if (page != null) { - queryParams.addAll(_queryParams('', 'page', page)); - } - if (size != null) { - queryParams.addAll(_queryParams('', 'size', size)); - } - if (withHidden != null) { - queryParams.addAll(_queryParams('', 'withHidden', withHidden)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get all people - /// - /// Retrieve a list of all people. - /// - /// Parameters: - /// - /// * [String] closestAssetId: - /// Closest asset ID for similarity search - /// - /// * [String] closestPersonId: - /// Closest person ID for similarity search - /// - /// * [num] page: - /// Page number for pagination - /// - /// * [num] size: - /// Number of items per page - /// - /// * [bool] withHidden: - /// Include hidden people - Future getAllPeople({ String? closestAssetId, String? closestPersonId, num? page, num? size, bool? withHidden, }) async { - final response = await getAllPeopleWithHttpInfo( closestAssetId: closestAssetId, closestPersonId: closestPersonId, page: page, size: size, withHidden: withHidden, ); - 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), 'PeopleResponseDto',) as PeopleResponseDto; - - } - return null; - } - - /// Get a person - /// - /// Retrieve a person by id. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPersonWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get a person - /// - /// Retrieve a person by id. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPerson(String id,) async { - final response = await getPersonWithHttpInfo(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), 'PersonResponseDto',) as PersonResponseDto; - - } - return null; - } - - /// Get person statistics - /// - /// Retrieve statistics about a specific person. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPersonStatisticsWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}/statistics' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get person statistics - /// - /// Retrieve statistics about a specific person. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPersonStatistics(String id,) async { - final response = await getPersonStatisticsWithHttpInfo(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), 'PersonStatisticsResponseDto',) as PersonStatisticsResponseDto; - - } - return null; - } - - /// Get person thumbnail - /// - /// Retrieve the thumbnail file for a person. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPersonThumbnailWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}/thumbnail' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get person thumbnail - /// - /// Retrieve the thumbnail file for a person. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPersonThumbnail(String id,) async { - final response = await getPersonThumbnailWithHttpInfo(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), 'MultipartFile',) as MultipartFile; - - } - return null; - } - - /// Merge people - /// - /// Merge a list of people into the person specified in the path parameter. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MergePersonDto] mergePersonDto (required): - Future mergePersonWithHttpInfo(String id, MergePersonDto mergePersonDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}/merge' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = mergePersonDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Merge people - /// - /// Merge a list of people into the person specified in the path parameter. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [MergePersonDto] mergePersonDto (required): - Future?> mergePerson(String id, MergePersonDto mergePersonDto,) async { - final response = await mergePersonWithHttpInfo(id, mergePersonDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Reassign faces - /// - /// Bulk reassign a list of faces to a different person. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetFaceUpdateDto] assetFaceUpdateDto (required): - Future reassignFacesWithHttpInfo(String id, AssetFaceUpdateDto assetFaceUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}/reassign' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = assetFaceUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Reassign faces - /// - /// Bulk reassign a list of faces to a different person. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [AssetFaceUpdateDto] assetFaceUpdateDto (required): - Future?> reassignFaces(String id, AssetFaceUpdateDto assetFaceUpdateDto,) async { - final response = await reassignFacesWithHttpInfo(id, assetFaceUpdateDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update people - /// - /// Bulk update multiple people at once. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [PeopleUpdateDto] peopleUpdateDto (required): - Future updatePeopleWithHttpInfo(PeopleUpdateDto peopleUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people'; - - // ignore: prefer_final_locals - Object? postBody = peopleUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update people - /// - /// Bulk update multiple people at once. - /// - /// Parameters: - /// - /// * [PeopleUpdateDto] peopleUpdateDto (required): - Future?> updatePeople(PeopleUpdateDto peopleUpdateDto,) async { - final response = await updatePeopleWithHttpInfo(peopleUpdateDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update person - /// - /// Update an individual person. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [PersonUpdateDto] personUpdateDto (required): - Future updatePersonWithHttpInfo(String id, PersonUpdateDto personUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/people/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = personUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update person - /// - /// Update an individual person. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [PersonUpdateDto] personUpdateDto (required): - Future updatePerson(String id, PersonUpdateDto personUpdateDto,) async { - final response = await updatePersonWithHttpInfo(id, personUpdateDto,); - 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 null; - } -} diff --git a/mobile/openapi/lib/api/plugins_api.dart b/mobile/openapi/lib/api/plugins_api.dart deleted file mode 100644 index 5735fba379..0000000000 --- a/mobile/openapi/lib/api/plugins_api.dart +++ /dev/null @@ -1,177 +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 PluginsApi { - PluginsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Retrieve a plugin - /// - /// Retrieve information about a specific plugin by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPluginWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/plugins/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve a plugin - /// - /// Retrieve information about a specific plugin by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getPlugin(String id,) async { - final response = await getPluginWithHttpInfo(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), 'PluginResponseDto',) as PluginResponseDto; - - } - return null; - } - - /// List all plugin triggers - /// - /// Retrieve a list of all available plugin triggers. - /// - /// Note: This method returns the HTTP [Response]. - Future getPluginTriggersWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/plugins/triggers'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List all plugin triggers - /// - /// Retrieve a list of all available plugin triggers. - Future?> getPluginTriggers() async { - final response = await getPluginTriggersWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// List all plugins - /// - /// Retrieve a list of plugins available to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - Future getPluginsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/plugins'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List all plugins - /// - /// Retrieve a list of plugins available to the authenticated user. - Future?> getPlugins() async { - final response = await getPluginsWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/queues_api.dart b/mobile/openapi/lib/api/queues_api.dart deleted file mode 100644 index ecb556e434..0000000000 --- a/mobile/openapi/lib/api/queues_api.dart +++ /dev/null @@ -1,318 +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 QueuesApi { - QueuesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Empty a queue - /// - /// Removes all jobs from the specified queue. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [QueueName] name (required): - /// Queue name - /// - /// * [QueueDeleteDto] queueDeleteDto (required): - Future emptyQueueWithHttpInfo(QueueName name, QueueDeleteDto queueDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/queues/{name}/jobs' - .replaceAll('{name}', name.toString()); - - // ignore: prefer_final_locals - Object? postBody = queueDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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): - /// Queue name - /// - /// * [QueueDeleteDto] queueDeleteDto (required): - Future 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): - /// Queue name - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve a queue - /// - /// Retrieves a specific queue by its name. - /// - /// Parameters: - /// - /// * [QueueName] name (required): - /// Queue name - Future getQueue(QueueName name,) async { - final response = await getQueueWithHttpInfo(name,); - 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; - } - - /// Retrieve queue jobs - /// - /// Retrieves a list of queue jobs from the specified queue. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [QueueName] name (required): - /// Queue name - /// - /// * [List] status: - /// Filter jobs by status - Future getQueueJobsWithHttpInfo(QueueName name, { List? status, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/queues/{name}/jobs' - .replaceAll('{name}', name.toString()); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (status != null) { - queryParams.addAll(_queryParams('multi', 'status', status)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve queue jobs - /// - /// Retrieves a list of queue jobs from the specified queue. - /// - /// Parameters: - /// - /// * [QueueName] name (required): - /// Queue name - /// - /// * [List] status: - /// Filter jobs by status - Future?> getQueueJobs(QueueName name, { List? status, }) async { - final response = await getQueueJobsWithHttpInfo(name, status: status, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// List all queues - /// - /// Retrieves a list of queues. - /// - /// Note: This method returns the HTTP [Response]. - Future getQueuesWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/queues'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List all queues - /// - /// Retrieves a list of queues. - Future?> 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') as List) - .cast() - .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): - /// Queue name - /// - /// * [QueueUpdateDto] queueUpdateDto (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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): - /// Queue name - /// - /// * [QueueUpdateDto] queueUpdateDto (required): - Future 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; - } -} diff --git a/mobile/openapi/lib/api/search_api.dart b/mobile/openapi/lib/api/search_api.dart deleted file mode 100644 index 1b8ed3d9e4..0000000000 --- a/mobile/openapi/lib/api/search_api.dart +++ /dev/null @@ -1,943 +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 SearchApi { - SearchApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Retrieve assets by city - /// - /// Retrieve a list of assets with each asset belonging to a different city. This endpoint is used on the places pages to show a single thumbnail for each city the user has assets in. - /// - /// Note: This method returns the HTTP [Response]. - Future getAssetsByCityWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/search/cities'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve assets by city - /// - /// Retrieve a list of assets with each asset belonging to a different city. This endpoint is used on the places pages to show a single thumbnail for each city the user has assets in. - Future?> getAssetsByCity() async { - final response = await getAssetsByCityWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve explore data - /// - /// Retrieve data for the explore section, such as popular people and places. - /// - /// Note: This method returns the HTTP [Response]. - Future getExploreDataWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/search/explore'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve explore data - /// - /// Retrieve data for the explore section, such as popular people and places. - Future?> getExploreData() async { - final response = await getExploreDataWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve search suggestions - /// - /// Retrieve search suggestions based on partial input. This endpoint is used for typeahead search features. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SearchSuggestionType] type (required): - /// Suggestion type - /// - /// * [String] country: - /// Filter by country - /// - /// * [bool] includeNull: - /// Include null values in suggestions - /// - /// * [String] lensModel: - /// Filter by lens model - /// - /// * [String] make: - /// Filter by camera make - /// - /// * [String] model: - /// Filter by camera model - /// - /// * [String] state: - /// Filter by state/province - Future getSearchSuggestionsWithHttpInfo(SearchSuggestionType type, { String? country, bool? includeNull, String? lensModel, String? make, String? model, String? state, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/suggestions'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (country != null) { - queryParams.addAll(_queryParams('', 'country', country)); - } - if (includeNull != null) { - queryParams.addAll(_queryParams('', 'includeNull', includeNull)); - } - if (lensModel != null) { - queryParams.addAll(_queryParams('', 'lensModel', lensModel)); - } - if (make != null) { - queryParams.addAll(_queryParams('', 'make', make)); - } - if (model != null) { - queryParams.addAll(_queryParams('', 'model', model)); - } - if (state != null) { - queryParams.addAll(_queryParams('', 'state', state)); - } - queryParams.addAll(_queryParams('', 'type', type)); - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve search suggestions - /// - /// Retrieve search suggestions based on partial input. This endpoint is used for typeahead search features. - /// - /// Parameters: - /// - /// * [SearchSuggestionType] type (required): - /// Suggestion type - /// - /// * [String] country: - /// Filter by country - /// - /// * [bool] includeNull: - /// Include null values in suggestions - /// - /// * [String] lensModel: - /// Filter by lens model - /// - /// * [String] make: - /// Filter by camera make - /// - /// * [String] model: - /// Filter by camera model - /// - /// * [String] state: - /// Filter by state/province - Future?> getSearchSuggestions(SearchSuggestionType type, { String? country, bool? includeNull, String? lensModel, String? make, String? model, String? state, }) async { - final response = await getSearchSuggestionsWithHttpInfo(type, country: country, includeNull: includeNull, lensModel: lensModel, make: make, model: model, state: state, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Search asset statistics - /// - /// Retrieve statistical data about assets based on search criteria, such as the total matching count. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [StatisticsSearchDto] statisticsSearchDto (required): - Future searchAssetStatisticsWithHttpInfo(StatisticsSearchDto statisticsSearchDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/statistics'; - - // ignore: prefer_final_locals - Object? postBody = statisticsSearchDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search asset statistics - /// - /// Retrieve statistical data about assets based on search criteria, such as the total matching count. - /// - /// Parameters: - /// - /// * [StatisticsSearchDto] statisticsSearchDto (required): - Future searchAssetStatistics(StatisticsSearchDto statisticsSearchDto,) async { - final response = await searchAssetStatisticsWithHttpInfo(statisticsSearchDto,); - 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), 'SearchStatisticsResponseDto',) as SearchStatisticsResponseDto; - - } - return null; - } - - /// Search assets by metadata - /// - /// Search for assets based on various metadata criteria. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [MetadataSearchDto] metadataSearchDto (required): - Future searchAssetsWithHttpInfo(MetadataSearchDto metadataSearchDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/metadata'; - - // ignore: prefer_final_locals - Object? postBody = metadataSearchDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search assets by metadata - /// - /// Search for assets based on various metadata criteria. - /// - /// Parameters: - /// - /// * [MetadataSearchDto] metadataSearchDto (required): - Future searchAssets(MetadataSearchDto metadataSearchDto,) async { - final response = await searchAssetsWithHttpInfo(metadataSearchDto,); - 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), 'SearchResponseDto',) as SearchResponseDto; - - } - return null; - } - - /// Search large assets - /// - /// Search for assets that are considered large based on specified criteria. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [List] albumIds: - /// Filter by album IDs - /// - /// * [String] city: - /// Filter by city name - /// - /// * [String] country: - /// Filter by country name - /// - /// * [DateTime] createdAfter: - /// Filter by creation date (after) - /// - /// * [DateTime] createdBefore: - /// Filter by creation date (before) - /// - /// * [String] deviceId: - /// Device ID to filter by - /// - /// * [bool] isEncoded: - /// Filter by encoded status - /// - /// * [bool] isFavorite: - /// Filter by favorite status - /// - /// * [bool] isMotion: - /// Filter by motion photo status - /// - /// * [bool] isNotInAlbum: - /// Filter assets not in any album - /// - /// * [bool] isOffline: - /// Filter by offline status - /// - /// * [String] lensModel: - /// Filter by lens model - /// - /// * [String] libraryId: - /// Library ID to filter by - /// - /// * [String] make: - /// Filter by camera make - /// - /// * [int] minFileSize: - /// Minimum file size in bytes - /// - /// * [String] model: - /// Filter by camera model - /// - /// * [String] ocr: - /// Filter by OCR text content - /// - /// * [List] personIds: - /// Filter by person IDs - /// - /// * [num] rating: - /// Filter by rating - /// - /// * [num] size: - /// Number of results to return - /// - /// * [String] state: - /// Filter by state/province name - /// - /// * [List] tagIds: - /// Filter by tag IDs - /// - /// * [DateTime] takenAfter: - /// Filter by taken date (after) - /// - /// * [DateTime] takenBefore: - /// Filter by taken date (before) - /// - /// * [DateTime] trashedAfter: - /// Filter by trash date (after) - /// - /// * [DateTime] trashedBefore: - /// Filter by trash date (before) - /// - /// * [AssetTypeEnum] type: - /// Asset type filter - /// - /// * [DateTime] updatedAfter: - /// Filter by update date (after) - /// - /// * [DateTime] updatedBefore: - /// Filter by update date (before) - /// - /// * [AssetVisibility] visibility: - /// Filter by visibility - /// - /// * [bool] withDeleted: - /// Include deleted assets - /// - /// * [bool] withExif: - /// Include EXIF data in response - Future searchLargeAssetsWithHttpInfo({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, String? ocr, List? personIds, num? rating, num? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/large-assets'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (albumIds != null) { - queryParams.addAll(_queryParams('multi', 'albumIds', albumIds)); - } - if (city != null) { - queryParams.addAll(_queryParams('', 'city', city)); - } - if (country != null) { - queryParams.addAll(_queryParams('', 'country', country)); - } - if (createdAfter != null) { - queryParams.addAll(_queryParams('', 'createdAfter', createdAfter)); - } - if (createdBefore != null) { - queryParams.addAll(_queryParams('', 'createdBefore', createdBefore)); - } - if (deviceId != null) { - queryParams.addAll(_queryParams('', 'deviceId', deviceId)); - } - if (isEncoded != null) { - queryParams.addAll(_queryParams('', 'isEncoded', isEncoded)); - } - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isMotion != null) { - queryParams.addAll(_queryParams('', 'isMotion', isMotion)); - } - if (isNotInAlbum != null) { - queryParams.addAll(_queryParams('', 'isNotInAlbum', isNotInAlbum)); - } - if (isOffline != null) { - queryParams.addAll(_queryParams('', 'isOffline', isOffline)); - } - if (lensModel != null) { - queryParams.addAll(_queryParams('', 'lensModel', lensModel)); - } - if (libraryId != null) { - queryParams.addAll(_queryParams('', 'libraryId', libraryId)); - } - if (make != null) { - queryParams.addAll(_queryParams('', 'make', make)); - } - if (minFileSize != null) { - queryParams.addAll(_queryParams('', 'minFileSize', minFileSize)); - } - if (model != null) { - queryParams.addAll(_queryParams('', 'model', model)); - } - if (ocr != null) { - queryParams.addAll(_queryParams('', 'ocr', ocr)); - } - if (personIds != null) { - queryParams.addAll(_queryParams('multi', 'personIds', personIds)); - } - if (rating != null) { - queryParams.addAll(_queryParams('', 'rating', rating)); - } - if (size != null) { - queryParams.addAll(_queryParams('', 'size', size)); - } - if (state != null) { - queryParams.addAll(_queryParams('', 'state', state)); - } - if (tagIds != null) { - queryParams.addAll(_queryParams('multi', 'tagIds', tagIds)); - } - if (takenAfter != null) { - queryParams.addAll(_queryParams('', 'takenAfter', takenAfter)); - } - if (takenBefore != null) { - queryParams.addAll(_queryParams('', 'takenBefore', takenBefore)); - } - if (trashedAfter != null) { - queryParams.addAll(_queryParams('', 'trashedAfter', trashedAfter)); - } - if (trashedBefore != null) { - queryParams.addAll(_queryParams('', 'trashedBefore', trashedBefore)); - } - if (type != null) { - queryParams.addAll(_queryParams('', 'type', type)); - } - if (updatedAfter != null) { - queryParams.addAll(_queryParams('', 'updatedAfter', updatedAfter)); - } - if (updatedBefore != null) { - queryParams.addAll(_queryParams('', 'updatedBefore', updatedBefore)); - } - if (visibility != null) { - queryParams.addAll(_queryParams('', 'visibility', visibility)); - } - if (withDeleted != null) { - queryParams.addAll(_queryParams('', 'withDeleted', withDeleted)); - } - if (withExif != null) { - queryParams.addAll(_queryParams('', 'withExif', withExif)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search large assets - /// - /// Search for assets that are considered large based on specified criteria. - /// - /// Parameters: - /// - /// * [List] albumIds: - /// Filter by album IDs - /// - /// * [String] city: - /// Filter by city name - /// - /// * [String] country: - /// Filter by country name - /// - /// * [DateTime] createdAfter: - /// Filter by creation date (after) - /// - /// * [DateTime] createdBefore: - /// Filter by creation date (before) - /// - /// * [String] deviceId: - /// Device ID to filter by - /// - /// * [bool] isEncoded: - /// Filter by encoded status - /// - /// * [bool] isFavorite: - /// Filter by favorite status - /// - /// * [bool] isMotion: - /// Filter by motion photo status - /// - /// * [bool] isNotInAlbum: - /// Filter assets not in any album - /// - /// * [bool] isOffline: - /// Filter by offline status - /// - /// * [String] lensModel: - /// Filter by lens model - /// - /// * [String] libraryId: - /// Library ID to filter by - /// - /// * [String] make: - /// Filter by camera make - /// - /// * [int] minFileSize: - /// Minimum file size in bytes - /// - /// * [String] model: - /// Filter by camera model - /// - /// * [String] ocr: - /// Filter by OCR text content - /// - /// * [List] personIds: - /// Filter by person IDs - /// - /// * [num] rating: - /// Filter by rating - /// - /// * [num] size: - /// Number of results to return - /// - /// * [String] state: - /// Filter by state/province name - /// - /// * [List] tagIds: - /// Filter by tag IDs - /// - /// * [DateTime] takenAfter: - /// Filter by taken date (after) - /// - /// * [DateTime] takenBefore: - /// Filter by taken date (before) - /// - /// * [DateTime] trashedAfter: - /// Filter by trash date (after) - /// - /// * [DateTime] trashedBefore: - /// Filter by trash date (before) - /// - /// * [AssetTypeEnum] type: - /// Asset type filter - /// - /// * [DateTime] updatedAfter: - /// Filter by update date (after) - /// - /// * [DateTime] updatedBefore: - /// Filter by update date (before) - /// - /// * [AssetVisibility] visibility: - /// Filter by visibility - /// - /// * [bool] withDeleted: - /// Include deleted assets - /// - /// * [bool] withExif: - /// Include EXIF data in response - Future?> searchLargeAssets({ List? albumIds, String? city, String? country, DateTime? createdAfter, DateTime? createdBefore, String? deviceId, bool? isEncoded, bool? isFavorite, bool? isMotion, bool? isNotInAlbum, bool? isOffline, String? lensModel, String? libraryId, String? make, int? minFileSize, String? model, String? ocr, List? personIds, num? rating, num? size, String? state, List? tagIds, DateTime? takenAfter, DateTime? takenBefore, DateTime? trashedAfter, DateTime? trashedBefore, AssetTypeEnum? type, DateTime? updatedAfter, DateTime? updatedBefore, AssetVisibility? visibility, bool? withDeleted, bool? withExif, }) async { - final response = await searchLargeAssetsWithHttpInfo( albumIds: albumIds, city: city, country: country, createdAfter: createdAfter, createdBefore: createdBefore, deviceId: deviceId, isEncoded: isEncoded, isFavorite: isFavorite, isMotion: isMotion, isNotInAlbum: isNotInAlbum, isOffline: isOffline, lensModel: lensModel, libraryId: libraryId, make: make, minFileSize: minFileSize, model: model, ocr: ocr, personIds: personIds, rating: rating, size: size, state: state, tagIds: tagIds, takenAfter: takenAfter, takenBefore: takenBefore, trashedAfter: trashedAfter, trashedBefore: trashedBefore, type: type, updatedAfter: updatedAfter, updatedBefore: updatedBefore, visibility: visibility, withDeleted: withDeleted, withExif: withExif, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Search people - /// - /// Search for people by name. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] name (required): - /// Person name to search for - /// - /// * [bool] withHidden: - /// Include hidden people - Future searchPersonWithHttpInfo(String name, { bool? withHidden, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/person'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'name', name)); - if (withHidden != null) { - queryParams.addAll(_queryParams('', 'withHidden', withHidden)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search people - /// - /// Search for people by name. - /// - /// Parameters: - /// - /// * [String] name (required): - /// Person name to search for - /// - /// * [bool] withHidden: - /// Include hidden people - Future?> searchPerson(String name, { bool? withHidden, }) async { - final response = await searchPersonWithHttpInfo(name, withHidden: withHidden, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Search places - /// - /// Search for places by name. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] name (required): - /// Place name to search for - Future searchPlacesWithHttpInfo(String name,) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/places'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'name', name)); - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search places - /// - /// Search for places by name. - /// - /// Parameters: - /// - /// * [String] name (required): - /// Place name to search for - Future?> searchPlaces(String name,) async { - final response = await searchPlacesWithHttpInfo(name,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Search random assets - /// - /// Retrieve a random selection of assets based on the provided criteria. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [RandomSearchDto] randomSearchDto (required): - Future searchRandomWithHttpInfo(RandomSearchDto randomSearchDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/random'; - - // ignore: prefer_final_locals - Object? postBody = randomSearchDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Search random assets - /// - /// Retrieve a random selection of assets based on the provided criteria. - /// - /// Parameters: - /// - /// * [RandomSearchDto] randomSearchDto (required): - Future?> searchRandom(RandomSearchDto randomSearchDto,) async { - final response = await searchRandomWithHttpInfo(randomSearchDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Smart asset search - /// - /// Perform a smart search for assets by using machine learning vectors to determine relevance. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SmartSearchDto] smartSearchDto (required): - Future searchSmartWithHttpInfo(SmartSearchDto smartSearchDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/search/smart'; - - // ignore: prefer_final_locals - Object? postBody = smartSearchDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Smart asset search - /// - /// Perform a smart search for assets by using machine learning vectors to determine relevance. - /// - /// Parameters: - /// - /// * [SmartSearchDto] smartSearchDto (required): - Future searchSmart(SmartSearchDto smartSearchDto,) async { - final response = await searchSmartWithHttpInfo(smartSearchDto,); - 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), 'SearchResponseDto',) as SearchResponseDto; - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/server_api.dart b/mobile/openapi/lib/api/server_api.dart index f5b70a9ea4..fe0126b414 100644 --- a/mobile/openapi/lib/api/server_api.dart +++ b/mobile/openapi/lib/api/server_api.dart @@ -16,46 +16,6 @@ class ServerApi { final ApiClient apiClient; - /// Delete server product key - /// - /// Delete the currently set server product key. - /// - /// Note: This method returns the HTTP [Response]. - Future deleteServerLicenseWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/license'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete server product key - /// - /// Delete the currently set server product key. - Future deleteServerLicense() async { - final response = await deleteServerLicenseWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - /// Get server information /// /// Retrieve a list of information about the server. @@ -104,54 +64,6 @@ class ServerApi { return null; } - /// Get APK links - /// - /// Retrieve links to the APKs for the current server version. - /// - /// Note: This method returns the HTTP [Response]. - Future getApkLinksWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/apk-links'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get APK links - /// - /// Retrieve links to the APKs for the current server version. - Future getApkLinks() async { - final response = await getApkLinksWithHttpInfo(); - 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), 'ServerApkLinksDto',) as ServerApkLinksDto; - - } - return null; - } - /// Get config /// /// Retrieve the current server configuration. @@ -248,102 +160,6 @@ class ServerApi { return null; } - /// Get product key - /// - /// Retrieve information about whether the server currently has a product key registered. - /// - /// Note: This method returns the HTTP [Response]. - Future getServerLicenseWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/license'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get product key - /// - /// Retrieve information about whether the server currently has a product key registered. - Future getServerLicense() async { - final response = await getServerLicenseWithHttpInfo(); - 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), 'LicenseResponseDto',) as LicenseResponseDto; - - } - return null; - } - - /// Get statistics - /// - /// Retrieve statistics about the entire Immich instance such as asset counts. - /// - /// Note: This method returns the HTTP [Response]. - Future getServerStatisticsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/statistics'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get statistics - /// - /// Retrieve statistics about the entire Immich instance such as asset counts. - Future getServerStatistics() async { - final response = await getServerStatisticsWithHttpInfo(); - 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), 'ServerStatsResponseDto',) as ServerStatsResponseDto; - - } - return null; - } - /// Get server version /// /// Retrieve the current server version in semantic versioning (semver) format. @@ -392,249 +208,6 @@ class ServerApi { return null; } - /// Get storage - /// - /// Retrieve the current storage utilization information of the server. - /// - /// Note: This method returns the HTTP [Response]. - Future getStorageWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/storage'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get storage - /// - /// Retrieve the current storage utilization information of the server. - Future getStorage() async { - final response = await getStorageWithHttpInfo(); - 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), 'ServerStorageResponseDto',) as ServerStorageResponseDto; - - } - return null; - } - - /// Get supported media types - /// - /// Retrieve all media types supported by the server. - /// - /// Note: This method returns the HTTP [Response]. - Future getSupportedMediaTypesWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/media-types'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get supported media types - /// - /// Retrieve all media types supported by the server. - Future getSupportedMediaTypes() async { - final response = await getSupportedMediaTypesWithHttpInfo(); - 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), 'ServerMediaTypesResponseDto',) as ServerMediaTypesResponseDto; - - } - return null; - } - - /// Get theme - /// - /// Retrieve the custom CSS, if existent. - /// - /// Note: This method returns the HTTP [Response]. - Future getThemeWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/theme'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get theme - /// - /// Retrieve the custom CSS, if existent. - Future getTheme() async { - final response = await getThemeWithHttpInfo(); - 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), 'ServerThemeDto',) as ServerThemeDto; - - } - return null; - } - - /// Get version check status - /// - /// Retrieve information about the last time the version check ran. - /// - /// Note: This method returns the HTTP [Response]. - Future getVersionCheckWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/version-check'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get version check status - /// - /// Retrieve information about the last time the version check ran. - Future getVersionCheck() async { - final response = await getVersionCheckWithHttpInfo(); - 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; - } - - /// Get version history - /// - /// Retrieve a list of past versions the server has been on. - /// - /// Note: This method returns the HTTP [Response]. - Future getVersionHistoryWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/server/version-history'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get version history - /// - /// Retrieve a list of past versions the server has been on. - Future?> getVersionHistory() async { - final response = await getVersionHistoryWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - /// Ping /// /// Pong @@ -682,60 +255,4 @@ class ServerApi { } return null; } - - /// Set server product key - /// - /// Validate and set the server product key if successful. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [LicenseKeyDto] licenseKeyDto (required): - Future setServerLicenseWithHttpInfo(LicenseKeyDto licenseKeyDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/server/license'; - - // ignore: prefer_final_locals - Object? postBody = licenseKeyDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Set server product key - /// - /// Validate and set the server product key if successful. - /// - /// Parameters: - /// - /// * [LicenseKeyDto] licenseKeyDto (required): - Future setServerLicense(LicenseKeyDto licenseKeyDto,) async { - final response = await setServerLicenseWithHttpInfo(licenseKeyDto,); - 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), 'LicenseResponseDto',) as LicenseResponseDto; - - } - return null; - } } diff --git a/mobile/openapi/lib/api/sessions_api.dart b/mobile/openapi/lib/api/sessions_api.dart index da508059bc..685814c89b 100644 --- a/mobile/openapi/lib/api/sessions_api.dart +++ b/mobile/openapi/lib/api/sessions_api.dart @@ -211,114 +211,4 @@ class SessionsApi { } return null; } - - /// Lock a session - /// - /// Lock a specific session by id. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 lockSession(String id,) async { - final response = await lockSessionWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Update a session - /// - /// Update a specific session identified by id. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [SessionUpdateDto] sessionUpdateDto (required): - Future updateSessionWithHttpInfo(String id, SessionUpdateDto sessionUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sessions/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = sessionUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a session - /// - /// Update a specific session identified by id. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [SessionUpdateDto] sessionUpdateDto (required): - Future updateSession(String id, SessionUpdateDto sessionUpdateDto,) async { - final response = await updateSessionWithHttpInfo(id, sessionUpdateDto,); - 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 null; - } } diff --git a/mobile/openapi/lib/api/shared_links_api.dart b/mobile/openapi/lib/api/shared_links_api.dart deleted file mode 100644 index 7f11db76d3..0000000000 --- a/mobile/openapi/lib/api/shared_links_api.dart +++ /dev/null @@ -1,558 +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 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): - /// - /// * [String] key: - /// - /// * [String] slug: - Future addSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links/{id}/assets' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = assetIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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): - /// - /// * [String] key: - /// - /// * [String] slug: - Future?> addSharedLinkAssets(String id, AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - final response = await addSharedLinkAssetsWithHttpInfo(id, assetIdsDto, key: key, slug: slug, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Create a shared link - /// - /// Create a new shared link. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SharedLinkCreateDto] sharedLinkCreateDto (required): - Future createSharedLinkWithHttpInfo(SharedLinkCreateDto sharedLinkCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links'; - - // ignore: prefer_final_locals - Object? postBody = sharedLinkCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a shared link - /// - /// Create a new shared link. - /// - /// Parameters: - /// - /// * [SharedLinkCreateDto] sharedLinkCreateDto (required): - Future 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; - } - - /// Retrieve all shared links - /// - /// Retrieve a list of all shared links. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] albumId: - /// Filter by album ID - /// - /// * [String] id: - /// Filter by shared link ID - Future getAllSharedLinksWithHttpInfo({ String? albumId, String? id, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (albumId != null) { - queryParams.addAll(_queryParams('', 'albumId', albumId)); - } - if (id != null) { - queryParams.addAll(_queryParams('', 'id', id)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve all shared links - /// - /// Retrieve a list of all shared links. - /// - /// Parameters: - /// - /// * [String] albumId: - /// Filter by album ID - /// - /// * [String] id: - /// Filter by shared link ID - Future?> getAllSharedLinks({ String? albumId, String? id, }) async { - final response = await getAllSharedLinksWithHttpInfo( albumId: albumId, id: 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) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve current shared link - /// - /// Retrieve the current shared link associated with authentication method. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] key: - /// - /// * [String] password: - /// Link password - /// - /// * [String] slug: - /// - /// * [String] token: - /// Access token - Future getMySharedLinkWithHttpInfo({ String? key, String? password, String? slug, String? token, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links/me'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (password != null) { - queryParams.addAll(_queryParams('', 'password', password)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - if (token != null) { - queryParams.addAll(_queryParams('', 'token', token)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve current shared link - /// - /// Retrieve the current shared link associated with authentication method. - /// - /// Parameters: - /// - /// * [String] key: - /// - /// * [String] password: - /// Link password - /// - /// * [String] slug: - /// - /// * [String] token: - /// Access token - Future getMySharedLink({ String? key, String? password, String? slug, String? token, }) async { - final response = await getMySharedLinkWithHttpInfo( key: key, password: password, slug: slug, token: token, ); - 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; - } - - /// Retrieve a shared link - /// - /// Retrieve a specific shared link by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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): - /// - /// * [String] key: - /// - /// * [String] slug: - Future removeSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links/{id}/assets' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = assetIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - - const contentTypes = ['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): - /// - /// * [String] key: - /// - /// * [String] slug: - Future?> removeSharedLinkAssets(String id, AssetIdsDto assetIdsDto, { String? key, String? slug, }) async { - final response = await removeSharedLinkAssetsWithHttpInfo(id, assetIdsDto, key: key, slug: slug, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update a shared link - /// - /// Update an existing shared link by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [SharedLinkEditDto] sharedLinkEditDto (required): - Future updateSharedLinkWithHttpInfo(String id, SharedLinkEditDto sharedLinkEditDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/shared-links/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = sharedLinkEditDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PATCH', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a shared link - /// - /// Update an existing shared link by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [SharedLinkEditDto] sharedLinkEditDto (required): - Future updateSharedLink(String id, SharedLinkEditDto sharedLinkEditDto,) async { - final response = await updateSharedLinkWithHttpInfo(id, sharedLinkEditDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api/stacks_api.dart b/mobile/openapi/lib/api/stacks_api.dart deleted file mode 100644 index a691af2a7d..0000000000 --- a/mobile/openapi/lib/api/stacks_api.dart +++ /dev/null @@ -1,408 +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 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 createStackWithHttpInfo(StackCreateDto stackCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks'; - - // ignore: prefer_final_locals - Object? postBody = stackCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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 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; - } - - /// Delete a stack - /// - /// Delete a specific stack by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteStackWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a stack - /// - /// Delete a specific stack by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteStack(String id,) async { - final response = await deleteStackWithHttpInfo(id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete stacks - /// - /// Delete multiple stacks by providing a list of stack IDs. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future deleteStacksWithHttpInfo(BulkIdsDto bulkIdsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks'; - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete stacks - /// - /// Delete multiple stacks by providing a list of stack IDs. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future 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 getStackWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 removeAssetFromStack(String assetId, String id,) async { - final response = await removeAssetFromStackWithHttpInfo(assetId, id,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Retrieve stacks - /// - /// Retrieve a list of stacks. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] primaryAssetId: - /// Filter by primary asset ID - Future searchStacksWithHttpInfo({ String? primaryAssetId, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (primaryAssetId != null) { - queryParams.addAll(_queryParams('', 'primaryAssetId', primaryAssetId)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve stacks - /// - /// Retrieve a list of stacks. - /// - /// Parameters: - /// - /// * [String] primaryAssetId: - /// Filter by primary asset ID - Future?> searchStacks({ String? primaryAssetId, }) async { - final response = await searchStacksWithHttpInfo( primaryAssetId: primaryAssetId, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Update a stack - /// - /// Update an existing stack by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [StackUpdateDto] stackUpdateDto (required): - Future updateStackWithHttpInfo(String id, StackUpdateDto stackUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/stacks/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = stackUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update a stack - /// - /// Update an existing stack by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [StackUpdateDto] stackUpdateDto (required): - Future updateStack(String id, StackUpdateDto stackUpdateDto,) async { - final response = await updateStackWithHttpInfo(id, stackUpdateDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api/sync_api.dart b/mobile/openapi/lib/api/sync_api.dart deleted file mode 100644 index 6194fd0f89..0000000000 --- a/mobile/openapi/lib/api/sync_api.dart +++ /dev/null @@ -1,328 +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 SyncApi { - SyncApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Delete acknowledgements - /// - /// Delete specific synchronization acknowledgments. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SyncAckDeleteDto] syncAckDeleteDto (required): - Future deleteSyncAckWithHttpInfo(SyncAckDeleteDto syncAckDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/ack'; - - // ignore: prefer_final_locals - Object? postBody = syncAckDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete acknowledgements - /// - /// Delete specific synchronization acknowledgments. - /// - /// Parameters: - /// - /// * [SyncAckDeleteDto] syncAckDeleteDto (required): - Future deleteSyncAck(SyncAckDeleteDto syncAckDeleteDto,) async { - final response = await deleteSyncAckWithHttpInfo(syncAckDeleteDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Get delta sync for user - /// - /// Retrieve changed assets since the last sync for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetDeltaSyncDto] assetDeltaSyncDto (required): - Future getDeltaSyncWithHttpInfo(AssetDeltaSyncDto assetDeltaSyncDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/delta-sync'; - - // ignore: prefer_final_locals - Object? postBody = assetDeltaSyncDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get delta sync for user - /// - /// Retrieve changed assets since the last sync for the authenticated user. - /// - /// Parameters: - /// - /// * [AssetDeltaSyncDto] assetDeltaSyncDto (required): - Future getDeltaSync(AssetDeltaSyncDto assetDeltaSyncDto,) async { - final response = await getDeltaSyncWithHttpInfo(assetDeltaSyncDto,); - 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), 'AssetDeltaSyncResponseDto',) as AssetDeltaSyncResponseDto; - - } - return null; - } - - /// Get full sync for user - /// - /// Retrieve all assets for a full synchronization for the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AssetFullSyncDto] assetFullSyncDto (required): - Future getFullSyncForUserWithHttpInfo(AssetFullSyncDto assetFullSyncDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/full-sync'; - - // ignore: prefer_final_locals - Object? postBody = assetFullSyncDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get full sync for user - /// - /// Retrieve all assets for a full synchronization for the authenticated user. - /// - /// Parameters: - /// - /// * [AssetFullSyncDto] assetFullSyncDto (required): - Future?> getFullSyncForUser(AssetFullSyncDto assetFullSyncDto,) async { - final response = await getFullSyncForUserWithHttpInfo(assetFullSyncDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve acknowledgements - /// - /// Retrieve the synchronization acknowledgments for the current session. - /// - /// Note: This method returns the HTTP [Response]. - Future getSyncAckWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/ack'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve acknowledgements - /// - /// Retrieve the synchronization acknowledgments for the current session. - Future?> getSyncAck() async { - final response = await getSyncAckWithHttpInfo(); - 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') as List) - .cast() - .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 getSyncStreamWithHttpInfo(SyncStreamDto syncStreamDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/stream'; - - // ignore: prefer_final_locals - Object? postBody = syncStreamDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 getSyncStream(SyncStreamDto syncStreamDto,) async { - final response = await getSyncStreamWithHttpInfo(syncStreamDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Acknowledge changes - /// - /// Send a list of synchronization acknowledgements to confirm that the latest changes have been received. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SyncAckSetDto] syncAckSetDto (required): - Future sendSyncAckWithHttpInfo(SyncAckSetDto syncAckSetDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/sync/ack'; - - // ignore: prefer_final_locals - Object? postBody = syncAckSetDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Acknowledge changes - /// - /// Send a list of synchronization acknowledgements to confirm that the latest changes have been received. - /// - /// Parameters: - /// - /// * [SyncAckSetDto] syncAckSetDto (required): - Future sendSyncAck(SyncAckSetDto syncAckSetDto,) async { - final response = await sendSyncAckWithHttpInfo(syncAckSetDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/system_config_api.dart b/mobile/openapi/lib/api/system_config_api.dart deleted file mode 100644 index b04da71273..0000000000 --- a/mobile/openapi/lib/api/system_config_api.dart +++ /dev/null @@ -1,218 +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 SystemConfigApi { - SystemConfigApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Get system configuration - /// - /// Retrieve the current system configuration. - /// - /// Note: This method returns the HTTP [Response]. - Future getConfigWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-config'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get system configuration - /// - /// Retrieve the current system configuration. - Future getConfig() async { - final response = await getConfigWithHttpInfo(); - 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 system configuration defaults - /// - /// Retrieve the default values for the system configuration. - /// - /// Note: This method returns the HTTP [Response]. - Future getConfigDefaultsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-config/defaults'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 getStorageTemplateOptionsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-config/storage-template-options'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get storage template options - /// - /// Retrieve exemplary storage template options. - Future 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; - } - - /// Update system configuration - /// - /// Update the system configuration with a new system configuration. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [SystemConfigDto] systemConfigDto (required): - Future updateConfigWithHttpInfo(SystemConfigDto systemConfigDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/system-config'; - - // ignore: prefer_final_locals - Object? postBody = systemConfigDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update system configuration - /// - /// Update the system configuration with a new system configuration. - /// - /// Parameters: - /// - /// * [SystemConfigDto] systemConfigDto (required): - Future updateConfig(SystemConfigDto systemConfigDto,) async { - final response = await updateConfigWithHttpInfo(systemConfigDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api/system_metadata_api.dart b/mobile/openapi/lib/api/system_metadata_api.dart deleted file mode 100644 index 63fd7628ec..0000000000 --- a/mobile/openapi/lib/api/system_metadata_api.dart +++ /dev/null @@ -1,210 +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 SystemMetadataApi { - SystemMetadataApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Retrieve admin onboarding - /// - /// Retrieve the current admin onboarding status. - /// - /// Note: This method returns the HTTP [Response]. - Future getAdminOnboardingWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-metadata/admin-onboarding'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve admin onboarding - /// - /// Retrieve the current admin onboarding status. - Future getAdminOnboarding() async { - final response = await getAdminOnboardingWithHttpInfo(); - 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 null; - } - - /// Retrieve reverse geocoding state - /// - /// Retrieve the current state of the reverse geocoding import. - /// - /// Note: This method returns the HTTP [Response]. - Future getReverseGeocodingStateWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-metadata/reverse-geocoding-state'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 getVersionCheckStateWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/system-metadata/version-check-state'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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; - } - - /// Update admin onboarding - /// - /// Update the admin onboarding status. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [AdminOnboardingUpdateDto] adminOnboardingUpdateDto (required): - Future updateAdminOnboardingWithHttpInfo(AdminOnboardingUpdateDto adminOnboardingUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/system-metadata/admin-onboarding'; - - // ignore: prefer_final_locals - Object? postBody = adminOnboardingUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update admin onboarding - /// - /// Update the admin onboarding status. - /// - /// Parameters: - /// - /// * [AdminOnboardingUpdateDto] adminOnboardingUpdateDto (required): - Future updateAdminOnboarding(AdminOnboardingUpdateDto adminOnboardingUpdateDto,) async { - final response = await updateAdminOnboardingWithHttpInfo(adminOnboardingUpdateDto,); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } -} diff --git a/mobile/openapi/lib/api/tags_api.dart b/mobile/openapi/lib/api/tags_api.dart deleted file mode 100644 index a6840f9483..0000000000 --- a/mobile/openapi/lib/api/tags_api.dart +++ /dev/null @@ -1,535 +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 TagsApi { - TagsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Tag assets - /// - /// Add multiple tags to multiple assets in a single request. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [TagBulkAssetsDto] tagBulkAssetsDto (required): - Future bulkTagAssetsWithHttpInfo(TagBulkAssetsDto tagBulkAssetsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/tags/assets'; - - // ignore: prefer_final_locals - Object? postBody = tagBulkAssetsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Tag assets - /// - /// Add multiple tags to multiple assets in a single request. - /// - /// Parameters: - /// - /// * [TagBulkAssetsDto] tagBulkAssetsDto (required): - Future bulkTagAssets(TagBulkAssetsDto tagBulkAssetsDto,) async { - final response = await bulkTagAssetsWithHttpInfo(tagBulkAssetsDto,); - 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; - - } - return null; - } - - /// Create a tag - /// - /// Create a new tag by providing a name and optional color. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [TagCreateDto] tagCreateDto (required): - Future createTagWithHttpInfo(TagCreateDto tagCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/tags'; - - // ignore: prefer_final_locals - Object? postBody = tagCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a tag - /// - /// Create a new tag by providing a name and optional color. - /// - /// Parameters: - /// - /// * [TagCreateDto] tagCreateDto (required): - Future createTag(TagCreateDto tagCreateDto,) async { - final response = await createTagWithHttpInfo(tagCreateDto,); - 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; - } - - /// Delete a tag - /// - /// Delete a specific tag by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteTagWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/tags/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 getAllTagsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/tags'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve tags - /// - /// Retrieve a list of all tags. - Future?> 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') as List) - .cast() - .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 getTagByIdWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/tags/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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?> 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') as List) - .cast() - .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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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?> 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') as List) - .cast() - .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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 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; - } - - /// Upsert tags - /// - /// Create or update multiple tags in a single request. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [TagUpsertDto] tagUpsertDto (required): - Future upsertTagsWithHttpInfo(TagUpsertDto tagUpsertDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/tags'; - - // ignore: prefer_final_locals - Object? postBody = tagUpsertDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Upsert tags - /// - /// Create or update multiple tags in a single request. - /// - /// Parameters: - /// - /// * [TagUpsertDto] tagUpsertDto (required): - Future?> upsertTags(TagUpsertDto tagUpsertDto,) async { - final response = await upsertTagsWithHttpInfo(tagUpsertDto,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/timeline_api.dart b/mobile/openapi/lib/api/timeline_api.dart deleted file mode 100644 index 2afcea20ff..0000000000 --- a/mobile/openapi/lib/api/timeline_api.dart +++ /dev/null @@ -1,360 +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 TimelineApi { - TimelineApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Get time bucket - /// - /// Retrieve a string of all asset ids in a given time bucket. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] timeBucket (required): - /// Time bucket identifier in YYYY-MM-DD format (e.g., \"2024-01-01\" for January 2024) - /// - /// * [String] albumId: - /// Filter assets belonging to a specific album - /// - /// * [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) - /// - /// * [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 getTimeBucketWithHttpInfo(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/timeline/bucket'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (albumId != null) { - queryParams.addAll(_queryParams('', 'albumId', albumId)); - } - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isTrashed != null) { - queryParams.addAll(_queryParams('', 'isTrashed', isTrashed)); - } - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (order != null) { - queryParams.addAll(_queryParams('', 'order', order)); - } - if (personId != null) { - queryParams.addAll(_queryParams('', 'personId', personId)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - if (tagId != null) { - queryParams.addAll(_queryParams('', 'tagId', tagId)); - } - queryParams.addAll(_queryParams('', 'timeBucket', timeBucket)); - if (userId != null) { - queryParams.addAll(_queryParams('', 'userId', userId)); - } - if (visibility != null) { - queryParams.addAll(_queryParams('', 'visibility', visibility)); - } - if (withCoordinates != null) { - queryParams.addAll(_queryParams('', 'withCoordinates', withCoordinates)); - } - if (withPartners != null) { - queryParams.addAll(_queryParams('', 'withPartners', withPartners)); - } - if (withStacked != null) { - queryParams.addAll(_queryParams('', 'withStacked', withStacked)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get time bucket - /// - /// Retrieve a string of all asset ids in a given time bucket. - /// - /// Parameters: - /// - /// * [String] timeBucket (required): - /// Time bucket identifier in YYYY-MM-DD format (e.g., \"2024-01-01\" for January 2024) - /// - /// * [String] albumId: - /// Filter assets belonging to a specific album - /// - /// * [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) - /// - /// * [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 getTimeBucket(String timeBucket, { String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async { - final response = await getTimeBucketWithHttpInfo(timeBucket, albumId: albumId, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, personId: personId, slug: slug, tagId: tagId, userId: userId, visibility: visibility, withCoordinates: withCoordinates, withPartners: withPartners, withStacked: withStacked, ); - 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 null; - } - - /// Get time buckets - /// - /// Retrieve a list of all minimal time buckets. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] albumId: - /// Filter assets belonging to a specific album - /// - /// * [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) - /// - /// * [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 getTimeBucketsWithHttpInfo({ String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/timeline/buckets'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (albumId != null) { - queryParams.addAll(_queryParams('', 'albumId', albumId)); - } - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isTrashed != null) { - queryParams.addAll(_queryParams('', 'isTrashed', isTrashed)); - } - if (key != null) { - queryParams.addAll(_queryParams('', 'key', key)); - } - if (order != null) { - queryParams.addAll(_queryParams('', 'order', order)); - } - if (personId != null) { - queryParams.addAll(_queryParams('', 'personId', personId)); - } - if (slug != null) { - queryParams.addAll(_queryParams('', 'slug', slug)); - } - if (tagId != null) { - queryParams.addAll(_queryParams('', 'tagId', tagId)); - } - if (userId != null) { - queryParams.addAll(_queryParams('', 'userId', userId)); - } - if (visibility != null) { - queryParams.addAll(_queryParams('', 'visibility', visibility)); - } - if (withCoordinates != null) { - queryParams.addAll(_queryParams('', 'withCoordinates', withCoordinates)); - } - if (withPartners != null) { - queryParams.addAll(_queryParams('', 'withPartners', withPartners)); - } - if (withStacked != null) { - queryParams.addAll(_queryParams('', 'withStacked', withStacked)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get time buckets - /// - /// Retrieve a list of all minimal time buckets. - /// - /// Parameters: - /// - /// * [String] albumId: - /// Filter assets belonging to a specific album - /// - /// * [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) - /// - /// * [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?> getTimeBuckets({ String? albumId, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async { - final response = await getTimeBucketsWithHttpInfo( albumId: albumId, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, personId: personId, slug: slug, tagId: tagId, userId: userId, visibility: visibility, withCoordinates: withCoordinates, withPartners: withPartners, withStacked: withStacked, ); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/trash_api.dart b/mobile/openapi/lib/api/trash_api.dart deleted file mode 100644 index f1dcbb8896..0000000000 --- a/mobile/openapi/lib/api/trash_api.dart +++ /dev/null @@ -1,170 +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 TrashApi { - TrashApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Empty trash - /// - /// Permanently delete all items in the trash. - /// - /// Note: This method returns the HTTP [Response]. - Future emptyTrashWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/trash/empty'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Empty trash - /// - /// Permanently delete all items in the trash. - Future emptyTrash() async { - final response = await emptyTrashWithHttpInfo(); - 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; - } - - /// Restore assets - /// - /// Restore specific assets from the trash. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/trash/restore/assets'; - - // ignore: prefer_final_locals - Object? postBody = bulkIdsDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Restore assets - /// - /// Restore specific assets from the trash. - /// - /// Parameters: - /// - /// * [BulkIdsDto] bulkIdsDto (required): - Future restoreAssets(BulkIdsDto bulkIdsDto,) async { - final response = await restoreAssetsWithHttpInfo(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) { - return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TrashResponseDto',) as TrashResponseDto; - - } - return null; - } - - /// Restore trash - /// - /// Restore all items in the trash. - /// - /// Note: This method returns the HTTP [Response]. - Future restoreTrashWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/trash/restore'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Restore trash - /// - /// Restore all items in the trash. - Future 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; - } -} diff --git a/mobile/openapi/lib/api/users_admin_api.dart b/mobile/openapi/lib/api/users_admin_api.dart deleted file mode 100644 index 59a4b60096..0000000000 --- a/mobile/openapi/lib/api/users_admin_api.dart +++ /dev/null @@ -1,647 +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 UsersAdminApi { - UsersAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Create a user - /// - /// Create a new user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [UserAdminCreateDto] userAdminCreateDto (required): - Future createUserAdminWithHttpInfo(UserAdminCreateDto userAdminCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users'; - - // ignore: prefer_final_locals - Object? postBody = userAdminCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a user - /// - /// Create a new user. - /// - /// Parameters: - /// - /// * [UserAdminCreateDto] userAdminCreateDto (required): - Future createUserAdmin(UserAdminCreateDto userAdminCreateDto,) async { - final response = await createUserAdminWithHttpInfo(userAdminCreateDto,); - 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; - } - - /// Delete a user - /// - /// Delete a user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UserAdminDeleteDto] userAdminDeleteDto (required): - Future deleteUserAdminWithHttpInfo(String id, UserAdminDeleteDto userAdminDeleteDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = userAdminDeleteDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a user - /// - /// Delete a user. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [UserAdminDeleteDto] userAdminDeleteDto (required): - Future deleteUserAdmin(String id, UserAdminDeleteDto userAdminDeleteDto,) async { - final response = await deleteUserAdminWithHttpInfo(id, userAdminDeleteDto,); - 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; - } - - /// Retrieve a user - /// - /// Retrieve a specific user by their ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getUserAdminWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve a user - /// - /// Retrieve a specific user by their ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getUserAdmin(String id,) async { - final response = await getUserAdminWithHttpInfo(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 null; - } - - /// Retrieve user preferences - /// - /// Retrieve the preferences of a specific user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getUserPreferencesAdminWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users/{id}/preferences' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user preferences - /// - /// Retrieve the preferences of a specific user. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getUserPreferencesAdmin(String id,) async { - final response = await getUserPreferencesAdminWithHttpInfo(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), 'UserPreferencesResponseDto',) as UserPreferencesResponseDto; - - } - return null; - } - - /// Retrieve user sessions - /// - /// Retrieve all sessions for a specific user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getUserSessionsAdminWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users/{id}/sessions' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user sessions - /// - /// Retrieve all sessions for a specific user. - /// - /// Parameters: - /// - /// * [String] id (required): - Future?> getUserSessionsAdmin(String id,) async { - final response = await getUserSessionsAdminWithHttpInfo(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) { - final responseBody = await _decodeBodyBytes(response); - return (await apiClient.deserializeAsync(responseBody, 'List') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve user statistics - /// - /// Retrieve asset statistics for a specific user. - /// - /// 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: - /// Filter by visibility - Future getUserStatisticsAdminWithHttpInfo(String id, { bool? isFavorite, bool? isTrashed, AssetVisibility? visibility, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users/{id}/statistics' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (isFavorite != null) { - queryParams.addAll(_queryParams('', 'isFavorite', isFavorite)); - } - if (isTrashed != null) { - queryParams.addAll(_queryParams('', 'isTrashed', isTrashed)); - } - if (visibility != null) { - queryParams.addAll(_queryParams('', 'visibility', visibility)); - } - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user statistics - /// - /// 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: - /// Filter by visibility - Future 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Restore a deleted user - /// - /// Restore a previously deleted user. - /// - /// Parameters: - /// - /// * [String] id (required): - Future 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 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 searchUsersAdminWithHttpInfo({ String? id, bool? withDeleted, }) async { - // ignore: prefer_const_declarations - final apiPath = r'/admin/users'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - if (id != null) { - queryParams.addAll(_queryParams('', 'id', id)); - } - if (withDeleted != null) { - queryParams.addAll(_queryParams('', 'withDeleted', withDeleted)); - } - - const contentTypes = []; - - - 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?> 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') as List) - .cast() - .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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 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 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 = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['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 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; - } -} diff --git a/mobile/openapi/lib/api/users_api.dart b/mobile/openapi/lib/api/users_api.dart index 7ccae02c76..015d660119 100644 --- a/mobile/openapi/lib/api/users_api.dart +++ b/mobile/openapi/lib/api/users_api.dart @@ -16,242 +16,6 @@ class UsersApi { final ApiClient apiClient; - /// Create user profile image - /// - /// Upload and set a new profile image for the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [MultipartFile] file (required): - /// Profile image file - Future createProfileImageWithHttpInfo(MultipartFile file,) async { - // ignore: prefer_const_declarations - final apiPath = r'/users/profile-image'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['multipart/form-data']; - - bool hasFields = false; - final mp = MultipartRequest('POST', Uri.parse(apiPath)); - if (file != null) { - hasFields = true; - mp.fields[r'file'] = file.field; - mp.files.add(file); - } - if (hasFields) { - postBody = mp; - } - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create user profile image - /// - /// Upload and set a new profile image for the current user. - /// - /// Parameters: - /// - /// * [MultipartFile] file (required): - /// Profile image file - Future createProfileImage(MultipartFile file,) async { - final response = await createProfileImageWithHttpInfo(file,); - 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), 'CreateProfileImageResponseDto',) as CreateProfileImageResponseDto; - - } - return null; - } - - /// Delete user profile image - /// - /// Delete the profile image of the current user. - /// - /// Note: This method returns the HTTP [Response]. - Future deleteProfileImageWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/profile-image'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete user profile image - /// - /// Delete the profile image of the current user. - Future deleteProfileImage() async { - final response = await deleteProfileImageWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete user product key - /// - /// Delete the registered product key for the current user. - /// - /// Note: This method returns the HTTP [Response]. - Future deleteUserLicenseWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/license'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete user product key - /// - /// Delete the registered product key for the current user. - Future deleteUserLicense() async { - final response = await deleteUserLicenseWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Delete user onboarding - /// - /// Delete the onboarding status of the current user. - /// - /// Note: This method returns the HTTP [Response]. - Future deleteUserOnboardingWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/onboarding'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete user onboarding - /// - /// Delete the onboarding status of the current user. - Future deleteUserOnboarding() async { - final response = await deleteUserOnboardingWithHttpInfo(); - if (response.statusCode >= HttpStatus.badRequest) { - throw ApiException(response.statusCode, await _decodeBodyBytes(response)); - } - } - - /// Get my preferences - /// - /// Retrieve the preferences for the current user. - /// - /// Note: This method returns the HTTP [Response]. - Future getMyPreferencesWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/preferences'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Get my preferences - /// - /// Retrieve the preferences for the current user. - Future getMyPreferences() async { - final response = await getMyPreferencesWithHttpInfo(); - 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; - } - /// Get current user /// /// Retrieve information about the user making the API request. @@ -300,63 +64,6 @@ class UsersApi { return null; } - /// Retrieve user profile image - /// - /// Retrieve the profile image file for a user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getProfileImageWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/users/{id}/profile-image' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user profile image - /// - /// Retrieve the profile image file for a user. - /// - /// Parameters: - /// - /// * [String] id (required): - Future getProfileImage(String id,) async { - final response = await getProfileImageWithHttpInfo(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), 'MultipartFile',) as MultipartFile; - - } - return null; - } - /// Retrieve a user /// /// Retrieve a specific user by their ID. @@ -414,102 +121,6 @@ class UsersApi { return null; } - /// Retrieve user product key - /// - /// Retrieve information about whether the current user has a registered product key. - /// - /// Note: This method returns the HTTP [Response]. - Future getUserLicenseWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/license'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user product key - /// - /// Retrieve information about whether the current user has a registered product key. - Future getUserLicense() async { - final response = await getUserLicenseWithHttpInfo(); - 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), 'LicenseResponseDto',) as LicenseResponseDto; - - } - return null; - } - - /// Retrieve user onboarding - /// - /// Retrieve the onboarding status of the current user. - /// - /// Note: This method returns the HTTP [Response]. - Future getUserOnboardingWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/onboarding'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve user onboarding - /// - /// Retrieve the onboarding status of the current user. - Future getUserOnboarding() async { - final response = await getUserOnboardingWithHttpInfo(); - 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), 'OnboardingResponseDto',) as OnboardingResponseDto; - - } - return null; - } - /// Get all users /// /// Retrieve a list of all users on the server. @@ -561,177 +172,9 @@ class UsersApi { return null; } - /// Set user product key - /// - /// Register a product key for the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [LicenseKeyDto] licenseKeyDto (required): - Future setUserLicenseWithHttpInfo(LicenseKeyDto licenseKeyDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/license'; - - // ignore: prefer_final_locals - Object? postBody = licenseKeyDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Set user product key - /// - /// Register a product key for the current user. - /// - /// Parameters: - /// - /// * [LicenseKeyDto] licenseKeyDto (required): - Future setUserLicense(LicenseKeyDto licenseKeyDto,) async { - final response = await setUserLicenseWithHttpInfo(licenseKeyDto,); - 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), 'LicenseResponseDto',) as LicenseResponseDto; - - } - return null; - } - - /// Update user onboarding - /// - /// Update the onboarding status of the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [OnboardingDto] onboardingDto (required): - Future setUserOnboardingWithHttpInfo(OnboardingDto onboardingDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/onboarding'; - - // ignore: prefer_final_locals - Object? postBody = onboardingDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update user onboarding - /// - /// Update the onboarding status of the current user. - /// - /// Parameters: - /// - /// * [OnboardingDto] onboardingDto (required): - Future setUserOnboarding(OnboardingDto onboardingDto,) async { - final response = await setUserOnboardingWithHttpInfo(onboardingDto,); - 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), 'OnboardingResponseDto',) as OnboardingResponseDto; - - } - return null; - } - - /// Update my preferences - /// - /// Update the preferences of the current user. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required): - Future updateMyPreferencesWithHttpInfo(UserPreferencesUpdateDto userPreferencesUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/users/me/preferences'; - - // ignore: prefer_final_locals - Object? postBody = userPreferencesUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Update my preferences - /// - /// Update the preferences of the current user. - /// - /// Parameters: - /// - /// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required): - Future updateMyPreferences(UserPreferencesUpdateDto userPreferencesUpdateDto,) async { - final response = await updateMyPreferencesWithHttpInfo(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; - } - /// Update current user /// - /// Update the current user making teh API request. + /// Update the current user making the API request. /// /// Note: This method returns the HTTP [Response]. /// @@ -765,7 +208,7 @@ class UsersApi { /// Update current user /// - /// Update the current user making teh API request. + /// Update the current user making the API request. /// /// Parameters: /// diff --git a/mobile/openapi/lib/api/views_api.dart b/mobile/openapi/lib/api/views_api.dart deleted file mode 100644 index a45e89d58f..0000000000 --- a/mobile/openapi/lib/api/views_api.dart +++ /dev/null @@ -1,130 +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 ViewsApi { - ViewsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; - - final ApiClient apiClient; - - /// Retrieve assets by original path - /// - /// Retrieve assets that are children of a specific folder. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] path (required): - Future getAssetsByOriginalPathWithHttpInfo(String path,) async { - // ignore: prefer_const_declarations - final apiPath = r'/view/folder'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - queryParams.addAll(_queryParams('', 'path', path)); - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve assets by original path - /// - /// Retrieve assets that are children of a specific folder. - /// - /// Parameters: - /// - /// * [String] path (required): - Future?> getAssetsByOriginalPath(String path,) async { - final response = await getAssetsByOriginalPathWithHttpInfo(path,); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// Retrieve unique paths - /// - /// Retrieve a list of unique folder paths from asset original paths. - /// - /// Note: This method returns the HTTP [Response]. - Future getUniqueOriginalPathsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/view/folder/unique-paths'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Retrieve unique paths - /// - /// Retrieve a list of unique folder paths from asset original paths. - Future?> getUniqueOriginalPaths() async { - final response = await getUniqueOriginalPathsWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } -} diff --git a/mobile/openapi/lib/api/workflows_api.dart b/mobile/openapi/lib/api/workflows_api.dart deleted file mode 100644 index c589ec9823..0000000000 --- a/mobile/openapi/lib/api/workflows_api.dart +++ /dev/null @@ -1,292 +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 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 createWorkflowWithHttpInfo(WorkflowCreateDto workflowCreateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/workflows'; - - // ignore: prefer_final_locals - Object? postBody = workflowCreateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'POST', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Create a workflow - /// - /// Create a new workflow, the workflow can also be created with empty filters and actions. - /// - /// Parameters: - /// - /// * [WorkflowCreateDto] workflowCreateDto (required): - Future 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; - } - - /// Delete a workflow - /// - /// Delete a workflow by its ID. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - Future deleteWorkflowWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/workflows/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'DELETE', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// Delete a workflow - /// - /// Delete a workflow by its ID. - /// - /// Parameters: - /// - /// * [String] id (required): - Future 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 getWorkflowWithHttpInfo(String id,) async { - // ignore: prefer_const_declarations - final apiPath = r'/workflows/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - 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 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; - } - - /// List all workflows - /// - /// Retrieve a list of workflows available to the authenticated user. - /// - /// Note: This method returns the HTTP [Response]. - Future getWorkflowsWithHttpInfo() async { - // ignore: prefer_const_declarations - final apiPath = r'/workflows'; - - // ignore: prefer_final_locals - Object? postBody; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = []; - - - return apiClient.invokeAPI( - apiPath, - 'GET', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// List all workflows - /// - /// Retrieve a list of workflows available to the authenticated user. - Future?> getWorkflows() async { - final response = await getWorkflowsWithHttpInfo(); - 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') as List) - .cast() - .toList(growable: false); - - } - return null; - } - - /// 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. - /// - /// Note: This method returns the HTTP [Response]. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [WorkflowUpdateDto] workflowUpdateDto (required): - Future updateWorkflowWithHttpInfo(String id, WorkflowUpdateDto workflowUpdateDto,) async { - // ignore: prefer_const_declarations - final apiPath = r'/workflows/{id}' - .replaceAll('{id}', id); - - // ignore: prefer_final_locals - Object? postBody = workflowUpdateDto; - - final queryParams = []; - final headerParams = {}; - final formParams = {}; - - const contentTypes = ['application/json']; - - - return apiClient.invokeAPI( - apiPath, - 'PUT', - queryParams, - postBody, - headerParams, - formParams, - contentTypes.isEmpty ? null : contentTypes.first, - ); - } - - /// 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. - /// - /// Parameters: - /// - /// * [String] id (required): - /// - /// * [WorkflowUpdateDto] workflowUpdateDto (required): - Future updateWorkflow(String id, WorkflowUpdateDto workflowUpdateDto,) async { - final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto,); - 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; - } -} diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index 7f5cd50ed4..ee47069a2e 100644 --- a/mobile/openapi/lib/api_client.dart +++ b/mobile/openapi/lib/api_client.dart @@ -190,428 +190,24 @@ class ApiClient { return APIKeyResponseDto.fromJson(value); case 'APIKeyUpdateDto': return APIKeyUpdateDto.fromJson(value); - case 'ActivityCreateDto': - return ActivityCreateDto.fromJson(value); - case 'ActivityResponseDto': - return ActivityResponseDto.fromJson(value); - case 'ActivityStatisticsResponseDto': - return ActivityStatisticsResponseDto.fromJson(value); - case 'AddUsersDto': - return AddUsersDto.fromJson(value); - case 'AdminOnboardingUpdateDto': - return AdminOnboardingUpdateDto.fromJson(value); - case 'AlbumResponseDto': - return AlbumResponseDto.fromJson(value); - case 'AlbumStatisticsResponseDto': - return AlbumStatisticsResponseDto.fromJson(value); - case 'AlbumUserAddDto': - return AlbumUserAddDto.fromJson(value); - case 'AlbumUserCreateDto': - return AlbumUserCreateDto.fromJson(value); - case 'AlbumUserResponseDto': - return AlbumUserResponseDto.fromJson(value); - case 'AlbumUserRole': - return AlbumUserRoleTypeTransformer().decode(value); - case 'AlbumsAddAssetsDto': - return AlbumsAddAssetsDto.fromJson(value); - case 'AlbumsAddAssetsResponseDto': - return AlbumsAddAssetsResponseDto.fromJson(value); - case 'AlbumsResponse': - return AlbumsResponse.fromJson(value); - case 'AlbumsUpdate': - return AlbumsUpdate.fromJson(value); - case 'AssetBulkDeleteDto': - return AssetBulkDeleteDto.fromJson(value); - case 'AssetBulkUpdateDto': - return AssetBulkUpdateDto.fromJson(value); - case 'AssetBulkUploadCheckDto': - return AssetBulkUploadCheckDto.fromJson(value); - case 'AssetBulkUploadCheckItem': - return AssetBulkUploadCheckItem.fromJson(value); - case 'AssetBulkUploadCheckResponseDto': - return AssetBulkUploadCheckResponseDto.fromJson(value); - case 'AssetBulkUploadCheckResult': - return AssetBulkUploadCheckResult.fromJson(value); - case 'AssetCopyDto': - return AssetCopyDto.fromJson(value); - case 'AssetDeltaSyncDto': - return AssetDeltaSyncDto.fromJson(value); - case 'AssetDeltaSyncResponseDto': - return AssetDeltaSyncResponseDto.fromJson(value); - case 'AssetEditAction': - return AssetEditActionTypeTransformer().decode(value); - case 'AssetEditActionCrop': - return AssetEditActionCrop.fromJson(value); - case 'AssetEditActionListDto': - return AssetEditActionListDto.fromJson(value); - case 'AssetEditActionListDtoEditsInner': - return AssetEditActionListDtoEditsInner.fromJson(value); - case 'AssetEditActionMirror': - return AssetEditActionMirror.fromJson(value); - case 'AssetEditActionRotate': - return AssetEditActionRotate.fromJson(value); - case 'AssetEditsDto': - return AssetEditsDto.fromJson(value); - case 'AssetFaceCreateDto': - return AssetFaceCreateDto.fromJson(value); - case 'AssetFaceDeleteDto': - return AssetFaceDeleteDto.fromJson(value); - case 'AssetFaceResponseDto': - return AssetFaceResponseDto.fromJson(value); - case 'AssetFaceUpdateDto': - return AssetFaceUpdateDto.fromJson(value); - case 'AssetFaceUpdateItem': - return AssetFaceUpdateItem.fromJson(value); - case 'AssetFaceWithoutPersonResponseDto': - return AssetFaceWithoutPersonResponseDto.fromJson(value); - case 'AssetFullSyncDto': - return AssetFullSyncDto.fromJson(value); - case 'AssetIdsDto': - return AssetIdsDto.fromJson(value); - case 'AssetIdsResponseDto': - return AssetIdsResponseDto.fromJson(value); - case 'AssetJobName': - return AssetJobNameTypeTransformer().decode(value); - case 'AssetJobsDto': - return AssetJobsDto.fromJson(value); - case 'AssetMediaResponseDto': - return AssetMediaResponseDto.fromJson(value); - case 'AssetMediaSize': - return AssetMediaSizeTypeTransformer().decode(value); - case 'AssetMediaStatus': - return AssetMediaStatusTypeTransformer().decode(value); - case 'AssetMetadataBulkDeleteDto': - return AssetMetadataBulkDeleteDto.fromJson(value); - case 'AssetMetadataBulkDeleteItemDto': - return AssetMetadataBulkDeleteItemDto.fromJson(value); - case 'AssetMetadataBulkResponseDto': - return AssetMetadataBulkResponseDto.fromJson(value); - case 'AssetMetadataBulkUpsertDto': - return AssetMetadataBulkUpsertDto.fromJson(value); - case 'AssetMetadataBulkUpsertItemDto': - return AssetMetadataBulkUpsertItemDto.fromJson(value); - case 'AssetMetadataResponseDto': - return AssetMetadataResponseDto.fromJson(value); - case 'AssetMetadataUpsertDto': - return AssetMetadataUpsertDto.fromJson(value); - case 'AssetMetadataUpsertItemDto': - return AssetMetadataUpsertItemDto.fromJson(value); - case 'AssetOcrResponseDto': - return AssetOcrResponseDto.fromJson(value); - case 'AssetOrder': - return AssetOrderTypeTransformer().decode(value); - case 'AssetResponseDto': - return AssetResponseDto.fromJson(value); - case 'AssetStackResponseDto': - return AssetStackResponseDto.fromJson(value); - case 'AssetStatsResponseDto': - return AssetStatsResponseDto.fromJson(value); - case 'AssetTypeEnum': - return AssetTypeEnumTypeTransformer().decode(value); - case 'AssetVisibility': - return AssetVisibilityTypeTransformer().decode(value); - case 'AudioCodec': - return AudioCodecTypeTransformer().decode(value); - case 'AuthStatusResponseDto': - return AuthStatusResponseDto.fromJson(value); - case 'AvatarUpdate': - return AvatarUpdate.fromJson(value); - case 'BulkIdErrorReason': - return BulkIdErrorReasonTypeTransformer().decode(value); - case 'BulkIdResponseDto': - return BulkIdResponseDto.fromJson(value); - case 'BulkIdsDto': - return BulkIdsDto.fromJson(value); - case 'CLIPConfig': - return CLIPConfig.fromJson(value); - case 'CQMode': - return CQModeTypeTransformer().decode(value); - case 'CastResponse': - return CastResponse.fromJson(value); - case 'CastUpdate': - return CastUpdate.fromJson(value); case 'ChangePasswordDto': return ChangePasswordDto.fromJson(value); - case 'CheckExistingAssetsDto': - return CheckExistingAssetsDto.fromJson(value); - case 'CheckExistingAssetsResponseDto': - return CheckExistingAssetsResponseDto.fromJson(value); - case 'Colorspace': - return ColorspaceTypeTransformer().decode(value); - case 'ContributorCountResponseDto': - return ContributorCountResponseDto.fromJson(value); - case 'CreateAlbumDto': - return CreateAlbumDto.fromJson(value); - case 'CreateLibraryDto': - return CreateLibraryDto.fromJson(value); - case 'CreateProfileImageResponseDto': - return CreateProfileImageResponseDto.fromJson(value); - case 'CropParameters': - return CropParameters.fromJson(value); - case 'DatabaseBackupConfig': - return DatabaseBackupConfig.fromJson(value); - case 'DatabaseBackupDeleteDto': - return DatabaseBackupDeleteDto.fromJson(value); - case 'DatabaseBackupDto': - return DatabaseBackupDto.fromJson(value); - case 'DatabaseBackupListResponseDto': - return DatabaseBackupListResponseDto.fromJson(value); - case 'DownloadArchiveInfo': - return DownloadArchiveInfo.fromJson(value); - case 'DownloadInfoDto': - return DownloadInfoDto.fromJson(value); - case 'DownloadResponse': - return DownloadResponse.fromJson(value); - case 'DownloadResponseDto': - return DownloadResponseDto.fromJson(value); - case 'DownloadUpdate': - return DownloadUpdate.fromJson(value); - case 'DuplicateDetectionConfig': - return DuplicateDetectionConfig.fromJson(value); - case 'DuplicateResponseDto': - return DuplicateResponseDto.fromJson(value); - case 'EmailNotificationsResponse': - return EmailNotificationsResponse.fromJson(value); - case 'EmailNotificationsUpdate': - return EmailNotificationsUpdate.fromJson(value); - case 'ExifResponseDto': - return ExifResponseDto.fromJson(value); - case 'FaceDto': - return FaceDto.fromJson(value); - case 'FacialRecognitionConfig': - return FacialRecognitionConfig.fromJson(value); - case 'FoldersResponse': - return FoldersResponse.fromJson(value); - case 'FoldersUpdate': - return FoldersUpdate.fromJson(value); - case 'ImageFormat': - return ImageFormatTypeTransformer().decode(value); - case 'JobCreateDto': - return JobCreateDto.fromJson(value); - case 'JobName': - return JobNameTypeTransformer().decode(value); - case 'JobSettingsDto': - return JobSettingsDto.fromJson(value); - case 'LibraryResponseDto': - return LibraryResponseDto.fromJson(value); - case 'LibraryStatsResponseDto': - return LibraryStatsResponseDto.fromJson(value); - case 'LicenseKeyDto': - return LicenseKeyDto.fromJson(value); - case 'LicenseResponseDto': - return LicenseResponseDto.fromJson(value); - case 'LogLevel': - return LogLevelTypeTransformer().decode(value); case 'LoginCredentialDto': return LoginCredentialDto.fromJson(value); case 'LoginResponseDto': return LoginResponseDto.fromJson(value); case 'LogoutResponseDto': return LogoutResponseDto.fromJson(value); - case 'MachineLearningAvailabilityChecksDto': - return MachineLearningAvailabilityChecksDto.fromJson(value); - case 'MaintenanceAction': - return MaintenanceActionTypeTransformer().decode(value); - case 'MaintenanceAuthDto': - return MaintenanceAuthDto.fromJson(value); - case 'MaintenanceDetectInstallResponseDto': - return MaintenanceDetectInstallResponseDto.fromJson(value); - case 'MaintenanceDetectInstallStorageFolderDto': - return MaintenanceDetectInstallStorageFolderDto.fromJson(value); - case 'MaintenanceLoginDto': - return MaintenanceLoginDto.fromJson(value); - case 'MaintenanceStatusResponseDto': - return MaintenanceStatusResponseDto.fromJson(value); - case 'ManualJobName': - return ManualJobNameTypeTransformer().decode(value); - case 'MapMarkerResponseDto': - return MapMarkerResponseDto.fromJson(value); - case 'MapReverseGeocodeResponseDto': - return MapReverseGeocodeResponseDto.fromJson(value); - case 'MemoriesResponse': - return MemoriesResponse.fromJson(value); - case 'MemoriesUpdate': - return MemoriesUpdate.fromJson(value); - case 'MemoryCreateDto': - return MemoryCreateDto.fromJson(value); - case 'MemoryResponseDto': - return MemoryResponseDto.fromJson(value); - case 'MemorySearchOrder': - return MemorySearchOrderTypeTransformer().decode(value); - case 'MemoryStatisticsResponseDto': - return MemoryStatisticsResponseDto.fromJson(value); - case 'MemoryType': - return MemoryTypeTypeTransformer().decode(value); - case 'MemoryUpdateDto': - return MemoryUpdateDto.fromJson(value); - case 'MergePersonDto': - return MergePersonDto.fromJson(value); - case 'MetadataSearchDto': - return MetadataSearchDto.fromJson(value); - case 'MirrorAxis': - return MirrorAxisTypeTransformer().decode(value); - case 'MirrorParameters': - return MirrorParameters.fromJson(value); - case 'NotificationCreateDto': - return NotificationCreateDto.fromJson(value); - case 'NotificationDeleteAllDto': - return NotificationDeleteAllDto.fromJson(value); - case 'NotificationDto': - return NotificationDto.fromJson(value); - case 'NotificationLevel': - return NotificationLevelTypeTransformer().decode(value); - case 'NotificationType': - return NotificationTypeTypeTransformer().decode(value); - case 'NotificationUpdateAllDto': - return NotificationUpdateAllDto.fromJson(value); - case 'NotificationUpdateDto': - return NotificationUpdateDto.fromJson(value); - case 'OAuthAuthorizeResponseDto': - return OAuthAuthorizeResponseDto.fromJson(value); - case 'OAuthCallbackDto': - return OAuthCallbackDto.fromJson(value); - case 'OAuthConfigDto': - return OAuthConfigDto.fromJson(value); - case 'OAuthTokenEndpointAuthMethod': - return OAuthTokenEndpointAuthMethodTypeTransformer().decode(value); - case 'OcrConfig': - return OcrConfig.fromJson(value); - case 'OnThisDayDto': - return OnThisDayDto.fromJson(value); - case 'OnboardingDto': - return OnboardingDto.fromJson(value); - case 'OnboardingResponseDto': - return OnboardingResponseDto.fromJson(value); - case 'PartnerCreateDto': - return PartnerCreateDto.fromJson(value); - case 'PartnerDirection': - return PartnerDirectionTypeTransformer().decode(value); - case 'PartnerResponseDto': - return PartnerResponseDto.fromJson(value); - case 'PartnerUpdateDto': - return PartnerUpdateDto.fromJson(value); - case 'PeopleResponse': - return PeopleResponse.fromJson(value); - case 'PeopleResponseDto': - return PeopleResponseDto.fromJson(value); - case 'PeopleUpdate': - return PeopleUpdate.fromJson(value); - case 'PeopleUpdateDto': - return PeopleUpdateDto.fromJson(value); - case 'PeopleUpdateItem': - return PeopleUpdateItem.fromJson(value); case 'Permission': return PermissionTypeTransformer().decode(value); - case 'PersonCreateDto': - return PersonCreateDto.fromJson(value); - case 'PersonResponseDto': - return PersonResponseDto.fromJson(value); - case 'PersonStatisticsResponseDto': - return PersonStatisticsResponseDto.fromJson(value); - case 'PersonUpdateDto': - return PersonUpdateDto.fromJson(value); - case 'PersonWithFacesResponseDto': - return PersonWithFacesResponseDto.fromJson(value); - case 'PinCodeChangeDto': - return PinCodeChangeDto.fromJson(value); - case 'PinCodeResetDto': - return PinCodeResetDto.fromJson(value); - case 'PinCodeSetupDto': - return PinCodeSetupDto.fromJson(value); - case 'PlacesResponseDto': - return PlacesResponseDto.fromJson(value); - case 'PluginActionResponseDto': - return PluginActionResponseDto.fromJson(value); - case 'PluginContextType': - return PluginContextTypeTypeTransformer().decode(value); - case 'PluginFilterResponseDto': - return PluginFilterResponseDto.fromJson(value); - case 'PluginResponseDto': - return PluginResponseDto.fromJson(value); - case 'PluginTriggerResponseDto': - return PluginTriggerResponseDto.fromJson(value); - case 'PluginTriggerType': - return PluginTriggerTypeTypeTransformer().decode(value); - case 'PurchaseResponse': - return PurchaseResponse.fromJson(value); - case 'PurchaseUpdate': - return PurchaseUpdate.fromJson(value); - case 'QueueCommand': - return QueueCommandTypeTransformer().decode(value); - case 'QueueCommandDto': - return QueueCommandDto.fromJson(value); - case 'QueueDeleteDto': - return QueueDeleteDto.fromJson(value); - case 'QueueJobResponseDto': - return QueueJobResponseDto.fromJson(value); - case 'QueueJobStatus': - return QueueJobStatusTypeTransformer().decode(value); - case 'QueueName': - return QueueNameTypeTransformer().decode(value); - case 'QueueResponseDto': - return QueueResponseDto.fromJson(value); - case 'QueueResponseLegacyDto': - return QueueResponseLegacyDto.fromJson(value); - case 'QueueStatisticsDto': - return QueueStatisticsDto.fromJson(value); - case 'QueueStatusLegacyDto': - return QueueStatusLegacyDto.fromJson(value); - case 'QueueUpdateDto': - return QueueUpdateDto.fromJson(value); - case 'QueuesResponseLegacyDto': - return QueuesResponseLegacyDto.fromJson(value); - case 'RandomSearchDto': - return RandomSearchDto.fromJson(value); - case 'RatingsResponse': - return RatingsResponse.fromJson(value); - case 'RatingsUpdate': - return RatingsUpdate.fromJson(value); - case 'ReactionLevel': - return ReactionLevelTypeTransformer().decode(value); - case 'ReactionType': - return ReactionTypeTypeTransformer().decode(value); - case 'ReverseGeocodingStateResponseDto': - return ReverseGeocodingStateResponseDto.fromJson(value); - case 'RotateParameters': - return RotateParameters.fromJson(value); - case 'SearchAlbumResponseDto': - return SearchAlbumResponseDto.fromJson(value); - case 'SearchAssetResponseDto': - return SearchAssetResponseDto.fromJson(value); - case 'SearchExploreItem': - return SearchExploreItem.fromJson(value); - case 'SearchExploreResponseDto': - return SearchExploreResponseDto.fromJson(value); - case 'SearchFacetCountResponseDto': - return SearchFacetCountResponseDto.fromJson(value); - case 'SearchFacetResponseDto': - return SearchFacetResponseDto.fromJson(value); - case 'SearchResponseDto': - return SearchResponseDto.fromJson(value); - case 'SearchStatisticsResponseDto': - return SearchStatisticsResponseDto.fromJson(value); - case 'SearchSuggestionType': - return SearchSuggestionTypeTypeTransformer().decode(value); case 'ServerAboutResponseDto': return ServerAboutResponseDto.fromJson(value); - case 'ServerApkLinksDto': - return ServerApkLinksDto.fromJson(value); case 'ServerConfigDto': return ServerConfigDto.fromJson(value); case 'ServerFeaturesDto': return ServerFeaturesDto.fromJson(value); - case 'ServerMediaTypesResponseDto': - return ServerMediaTypesResponseDto.fromJson(value); case 'ServerPingResponse': return ServerPingResponse.fromJson(value); - case 'ServerStatsResponseDto': - return ServerStatsResponseDto.fromJson(value); - case 'ServerStorageResponseDto': - return ServerStorageResponseDto.fromJson(value); - case 'ServerThemeDto': - return ServerThemeDto.fromJson(value); - case 'ServerVersionHistoryResponseDto': - return ServerVersionHistoryResponseDto.fromJson(value); case 'ServerVersionResponseDto': return ServerVersionResponseDto.fromJson(value); case 'SessionCreateDto': @@ -620,232 +216,10 @@ class ApiClient { return SessionCreateResponseDto.fromJson(value); case 'SessionResponseDto': return SessionResponseDto.fromJson(value); - case 'SessionUnlockDto': - return SessionUnlockDto.fromJson(value); - case 'SessionUpdateDto': - return SessionUpdateDto.fromJson(value); - case 'SetMaintenanceModeDto': - return SetMaintenanceModeDto.fromJson(value); - case 'SharedLinkCreateDto': - return SharedLinkCreateDto.fromJson(value); - case 'SharedLinkEditDto': - return SharedLinkEditDto.fromJson(value); - case 'SharedLinkResponseDto': - return SharedLinkResponseDto.fromJson(value); - case 'SharedLinkType': - return SharedLinkTypeTypeTransformer().decode(value); - case 'SharedLinksResponse': - return SharedLinksResponse.fromJson(value); - case 'SharedLinksUpdate': - return SharedLinksUpdate.fromJson(value); case 'SignUpDto': return SignUpDto.fromJson(value); - case 'SmartSearchDto': - return SmartSearchDto.fromJson(value); - case 'SourceType': - return SourceTypeTypeTransformer().decode(value); - case 'StackCreateDto': - return StackCreateDto.fromJson(value); - case 'StackResponseDto': - return StackResponseDto.fromJson(value); - case 'StackUpdateDto': - return StackUpdateDto.fromJson(value); - case 'StatisticsSearchDto': - return StatisticsSearchDto.fromJson(value); - case 'StorageFolder': - return StorageFolderTypeTransformer().decode(value); - case 'SyncAckDeleteDto': - return SyncAckDeleteDto.fromJson(value); - case 'SyncAckDto': - return SyncAckDto.fromJson(value); - case 'SyncAckSetDto': - return SyncAckSetDto.fromJson(value); - case 'SyncAlbumDeleteV1': - return SyncAlbumDeleteV1.fromJson(value); - case 'SyncAlbumToAssetDeleteV1': - return SyncAlbumToAssetDeleteV1.fromJson(value); - case 'SyncAlbumToAssetV1': - return SyncAlbumToAssetV1.fromJson(value); - case 'SyncAlbumUserDeleteV1': - return SyncAlbumUserDeleteV1.fromJson(value); - case 'SyncAlbumUserV1': - return SyncAlbumUserV1.fromJson(value); - case 'SyncAlbumV1': - return SyncAlbumV1.fromJson(value); - case 'SyncAssetDeleteV1': - return SyncAssetDeleteV1.fromJson(value); - case 'SyncAssetExifV1': - return SyncAssetExifV1.fromJson(value); - case 'SyncAssetFaceDeleteV1': - return SyncAssetFaceDeleteV1.fromJson(value); - case 'SyncAssetFaceV1': - return SyncAssetFaceV1.fromJson(value); - case 'SyncAssetMetadataDeleteV1': - return SyncAssetMetadataDeleteV1.fromJson(value); - case 'SyncAssetMetadataV1': - return SyncAssetMetadataV1.fromJson(value); - case 'SyncAssetV1': - return SyncAssetV1.fromJson(value); - case 'SyncAuthUserV1': - return SyncAuthUserV1.fromJson(value); - case 'SyncEntityType': - return SyncEntityTypeTypeTransformer().decode(value); - case 'SyncMemoryAssetDeleteV1': - return SyncMemoryAssetDeleteV1.fromJson(value); - case 'SyncMemoryAssetV1': - return SyncMemoryAssetV1.fromJson(value); - case 'SyncMemoryDeleteV1': - return SyncMemoryDeleteV1.fromJson(value); - case 'SyncMemoryV1': - return SyncMemoryV1.fromJson(value); - case 'SyncPartnerDeleteV1': - return SyncPartnerDeleteV1.fromJson(value); - case 'SyncPartnerV1': - return SyncPartnerV1.fromJson(value); - case 'SyncPersonDeleteV1': - return SyncPersonDeleteV1.fromJson(value); - case 'SyncPersonV1': - return SyncPersonV1.fromJson(value); - case 'SyncRequestType': - return SyncRequestTypeTypeTransformer().decode(value); - case 'SyncStackDeleteV1': - return SyncStackDeleteV1.fromJson(value); - case 'SyncStackV1': - return SyncStackV1.fromJson(value); - case 'SyncStreamDto': - return SyncStreamDto.fromJson(value); - case 'SyncUserDeleteV1': - return SyncUserDeleteV1.fromJson(value); - case 'SyncUserMetadataDeleteV1': - return SyncUserMetadataDeleteV1.fromJson(value); - case 'SyncUserMetadataV1': - return SyncUserMetadataV1.fromJson(value); - case 'SyncUserV1': - return SyncUserV1.fromJson(value); - case 'SystemConfigBackupsDto': - return SystemConfigBackupsDto.fromJson(value); - case 'SystemConfigDto': - return SystemConfigDto.fromJson(value); - case 'SystemConfigFFmpegDto': - return SystemConfigFFmpegDto.fromJson(value); - case 'SystemConfigFacesDto': - return SystemConfigFacesDto.fromJson(value); - case 'SystemConfigGeneratedFullsizeImageDto': - return SystemConfigGeneratedFullsizeImageDto.fromJson(value); - case 'SystemConfigGeneratedImageDto': - return SystemConfigGeneratedImageDto.fromJson(value); - case 'SystemConfigImageDto': - return SystemConfigImageDto.fromJson(value); - case 'SystemConfigJobDto': - return SystemConfigJobDto.fromJson(value); - case 'SystemConfigLibraryDto': - return SystemConfigLibraryDto.fromJson(value); - case 'SystemConfigLibraryScanDto': - return SystemConfigLibraryScanDto.fromJson(value); - case 'SystemConfigLibraryWatchDto': - return SystemConfigLibraryWatchDto.fromJson(value); - case 'SystemConfigLoggingDto': - return SystemConfigLoggingDto.fromJson(value); - case 'SystemConfigMachineLearningDto': - return SystemConfigMachineLearningDto.fromJson(value); - case 'SystemConfigMapDto': - return SystemConfigMapDto.fromJson(value); - case 'SystemConfigMetadataDto': - return SystemConfigMetadataDto.fromJson(value); - case 'SystemConfigNewVersionCheckDto': - return SystemConfigNewVersionCheckDto.fromJson(value); - case 'SystemConfigNightlyTasksDto': - return SystemConfigNightlyTasksDto.fromJson(value); - case 'SystemConfigNotificationsDto': - return SystemConfigNotificationsDto.fromJson(value); - case 'SystemConfigOAuthDto': - return SystemConfigOAuthDto.fromJson(value); - case 'SystemConfigPasswordLoginDto': - return SystemConfigPasswordLoginDto.fromJson(value); - case 'SystemConfigReverseGeocodingDto': - return SystemConfigReverseGeocodingDto.fromJson(value); - case 'SystemConfigServerDto': - return SystemConfigServerDto.fromJson(value); - case 'SystemConfigSmtpDto': - return SystemConfigSmtpDto.fromJson(value); - case 'SystemConfigSmtpTransportDto': - return SystemConfigSmtpTransportDto.fromJson(value); - case 'SystemConfigStorageTemplateDto': - return SystemConfigStorageTemplateDto.fromJson(value); - case 'SystemConfigTemplateEmailsDto': - return SystemConfigTemplateEmailsDto.fromJson(value); - case 'SystemConfigTemplateStorageOptionDto': - return SystemConfigTemplateStorageOptionDto.fromJson(value); - case 'SystemConfigTemplatesDto': - return SystemConfigTemplatesDto.fromJson(value); - case 'SystemConfigThemeDto': - return SystemConfigThemeDto.fromJson(value); - case 'SystemConfigTrashDto': - return SystemConfigTrashDto.fromJson(value); - case 'SystemConfigUserDto': - return SystemConfigUserDto.fromJson(value); - case 'TagBulkAssetsDto': - return TagBulkAssetsDto.fromJson(value); - case 'TagBulkAssetsResponseDto': - return TagBulkAssetsResponseDto.fromJson(value); - case 'TagCreateDto': - return TagCreateDto.fromJson(value); - case 'TagResponseDto': - return TagResponseDto.fromJson(value); - case 'TagUpdateDto': - return TagUpdateDto.fromJson(value); - case 'TagUpsertDto': - return TagUpsertDto.fromJson(value); - case 'TagsResponse': - return TagsResponse.fromJson(value); - case 'TagsUpdate': - return TagsUpdate.fromJson(value); - case 'TemplateDto': - return TemplateDto.fromJson(value); - case 'TemplateResponseDto': - return TemplateResponseDto.fromJson(value); - case 'TestEmailResponseDto': - return TestEmailResponseDto.fromJson(value); - case 'TimeBucketAssetResponseDto': - return TimeBucketAssetResponseDto.fromJson(value); - case 'TimeBucketsResponseDto': - return TimeBucketsResponseDto.fromJson(value); - case 'ToneMapping': - return ToneMappingTypeTransformer().decode(value); - case 'TranscodeHWAccel': - return TranscodeHWAccelTypeTransformer().decode(value); - case 'TranscodePolicy': - return TranscodePolicyTypeTransformer().decode(value); - case 'TrashResponseDto': - return TrashResponseDto.fromJson(value); - case 'UpdateAlbumDto': - return UpdateAlbumDto.fromJson(value); - case 'UpdateAlbumUserDto': - return UpdateAlbumUserDto.fromJson(value); - case 'UpdateAssetDto': - return UpdateAssetDto.fromJson(value); - case 'UpdateLibraryDto': - return UpdateLibraryDto.fromJson(value); - case 'UsageByUserDto': - return UsageByUserDto.fromJson(value); - case 'UserAdminCreateDto': - return UserAdminCreateDto.fromJson(value); - case 'UserAdminDeleteDto': - return UserAdminDeleteDto.fromJson(value); case 'UserAdminResponseDto': return UserAdminResponseDto.fromJson(value); - case 'UserAdminUpdateDto': - return UserAdminUpdateDto.fromJson(value); - case 'UserAvatarColor': - return UserAvatarColorTypeTransformer().decode(value); - case 'UserLicense': - return UserLicense.fromJson(value); - case 'UserMetadataKey': - return UserMetadataKeyTypeTransformer().decode(value); - case 'UserPreferencesResponseDto': - return UserPreferencesResponseDto.fromJson(value); - case 'UserPreferencesUpdateDto': - return UserPreferencesUpdateDto.fromJson(value); case 'UserResponseDto': return UserResponseDto.fromJson(value); case 'UserStatus': @@ -854,32 +228,6 @@ class ApiClient { return UserUpdateMeDto.fromJson(value); case 'ValidateAccessTokenResponseDto': return ValidateAccessTokenResponseDto.fromJson(value); - case 'ValidateLibraryDto': - return ValidateLibraryDto.fromJson(value); - case 'ValidateLibraryImportPathResponseDto': - return ValidateLibraryImportPathResponseDto.fromJson(value); - case 'ValidateLibraryResponseDto': - return ValidateLibraryResponseDto.fromJson(value); - case 'VersionCheckStateResponseDto': - return VersionCheckStateResponseDto.fromJson(value); - case 'VideoCodec': - return VideoCodecTypeTransformer().decode(value); - case 'VideoContainer': - return VideoContainerTypeTransformer().decode(value); - case 'WorkflowActionItemDto': - return WorkflowActionItemDto.fromJson(value); - case 'WorkflowActionResponseDto': - return WorkflowActionResponseDto.fromJson(value); - case 'WorkflowCreateDto': - return WorkflowCreateDto.fromJson(value); - case 'WorkflowFilterItemDto': - return WorkflowFilterItemDto.fromJson(value); - case 'WorkflowFilterResponseDto': - return WorkflowFilterResponseDto.fromJson(value); - case 'WorkflowResponseDto': - return WorkflowResponseDto.fromJson(value); - case 'WorkflowUpdateDto': - return WorkflowUpdateDto.fromJson(value); default: dynamic match; if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { diff --git a/mobile/openapi/lib/api_helper.dart b/mobile/openapi/lib/api_helper.dart index 830325a5b6..8721173938 100644 --- a/mobile/openapi/lib/api_helper.dart +++ b/mobile/openapi/lib/api_helper.dart @@ -55,144 +55,12 @@ 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 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 AssetTypeEnum) { - return AssetTypeEnumTypeTransformer().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 PluginContextType) { - return PluginContextTypeTypeTransformer().encode(value).toString(); - } - if (value is PluginTriggerType) { - return PluginTriggerTypeTypeTransformer().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(); - } return value.toString(); } diff --git a/mobile/openapi/lib/model/activity_create_dto.dart b/mobile/openapi/lib/model/activity_create_dto.dart deleted file mode 100644 index fb4b6d084e..0000000000 --- a/mobile/openapi/lib/model/activity_create_dto.dart +++ /dev/null @@ -1,145 +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 ActivityCreateDto { - /// Returns a new [ActivityCreateDto] instance. - ActivityCreateDto({ - required this.albumId, - this.assetId, - this.comment, - required this.type, - }); - - /// Album ID - 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; - - /// 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; - - /// Activity type (like or comment) - 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]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - if (this.assetId != null) { - json[r'assetId'] = this.assetId; - } else { - // json[r'assetId'] = null; - } - if (this.comment != null) { - json[r'comment'] = this.comment; - } else { - // json[r'comment'] = null; - } - json[r'type'] = this.type; - 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(); - - return ActivityCreateDto( - albumId: mapValueOfType(json, r'albumId')!, - assetId: mapValueOfType(json, r'assetId'), - comment: mapValueOfType(json, r'comment'), - type: ReactionType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ActivityCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ActivityCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'albumId', - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/activity_response_dto.dart b/mobile/openapi/lib/model/activity_response_dto.dart deleted file mode 100644 index dadb45d8ac..0000000000 --- a/mobile/openapi/lib/model/activity_response_dto.dart +++ /dev/null @@ -1,151 +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 ActivityResponseDto { - /// Returns a new [ActivityResponseDto] instance. - ActivityResponseDto({ - required this.assetId, - this.comment, - required this.createdAt, - required this.id, - required this.type, - required this.user, - }); - - /// Asset ID (if activity is for an asset) - String? assetId; - - /// Comment text (for comment activities) - String? comment; - - /// Creation date - DateTime createdAt; - - /// Activity ID - String id; - - /// Activity type - ReactionType type; - - 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; - - @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]'; - - Map toJson() { - final json = {}; - if (this.assetId != null) { - json[r'assetId'] = this.assetId; - } else { - // json[r'assetId'] = null; - } - if (this.comment != null) { - json[r'comment'] = this.comment; - } else { - // json[r'comment'] = null; - } - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'id'] = this.id; - json[r'type'] = this.type; - json[r'user'] = this.user; - 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(); - - return ActivityResponseDto( - assetId: mapValueOfType(json, r'assetId'), - comment: mapValueOfType(json, r'comment'), - createdAt: mapDateTime(json, r'createdAt', r'')!, - id: mapValueOfType(json, r'id')!, - type: ReactionType.fromJson(json[r'type'])!, - user: UserResponseDto.fromJson(json[r'user'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ActivityResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ActivityResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'assetId', - 'createdAt', - 'id', - 'type', - 'user', - }; -} - diff --git a/mobile/openapi/lib/model/activity_statistics_response_dto.dart b/mobile/openapi/lib/model/activity_statistics_response_dto.dart deleted file mode 100644 index 15ad2a170e..0000000000 --- a/mobile/openapi/lib/model/activity_statistics_response_dto.dart +++ /dev/null @@ -1,109 +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 ActivityStatisticsResponseDto { - /// Returns a new [ActivityStatisticsResponseDto] instance. - ActivityStatisticsResponseDto({ - required this.comments, - required this.likes, - }); - - /// Number of comments - int comments; - - /// Number of likes - 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]'; - - Map toJson() { - final json = {}; - json[r'comments'] = this.comments; - json[r'likes'] = this.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(); - - return ActivityStatisticsResponseDto( - comments: mapValueOfType(json, r'comments')!, - likes: mapValueOfType(json, r'likes')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ActivityStatisticsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ActivityStatisticsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'comments', - 'likes', - }; -} - diff --git a/mobile/openapi/lib/model/add_users_dto.dart b/mobile/openapi/lib/model/add_users_dto.dart deleted file mode 100644 index 1dad234811..0000000000 --- a/mobile/openapi/lib/model/add_users_dto.dart +++ /dev/null @@ -1,100 +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 AddUsersDto { - /// Returns a new [AddUsersDto] instance. - AddUsersDto({ - this.albumUsers = const [], - }); - - /// Album users to add - List 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]'; - - Map toJson() { - final json = {}; - json[r'albumUsers'] = this.albumUsers; - 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(); - - return AddUsersDto( - albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AddUsersDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AddUsersDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'albumUsers', - }; -} - diff --git a/mobile/openapi/lib/model/admin_onboarding_update_dto.dart b/mobile/openapi/lib/model/admin_onboarding_update_dto.dart deleted file mode 100644 index 6daba2a796..0000000000 --- a/mobile/openapi/lib/model/admin_onboarding_update_dto.dart +++ /dev/null @@ -1,100 +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 AdminOnboardingUpdateDto { - /// Returns a new [AdminOnboardingUpdateDto] instance. - AdminOnboardingUpdateDto({ - required this.isOnboarded, - }); - - /// Is admin onboarded - 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]'; - - Map toJson() { - final json = {}; - json[r'isOnboarded'] = this.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(); - - return AdminOnboardingUpdateDto( - isOnboarded: mapValueOfType(json, r'isOnboarded')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AdminOnboardingUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AdminOnboardingUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'isOnboarded', - }; -} - diff --git a/mobile/openapi/lib/model/album_response_dto.dart b/mobile/openapi/lib/model/album_response_dto.dart deleted file mode 100644 index 43e686fbdc..0000000000 --- a/mobile/openapi/lib/model/album_response_dto.dart +++ /dev/null @@ -1,297 +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 AlbumResponseDto { - /// Returns a new [AlbumResponseDto] instance. - AlbumResponseDto({ - required this.albumName, - required this.albumThumbnailAssetId, - this.albumUsers = const [], - required this.assetCount, - this.assets = const [], - this.contributorCounts = const [], - required this.createdAt, - required this.description, - this.endDate, - required this.hasSharedLink, - required this.id, - required this.isActivityEnabled, - this.lastModifiedAssetTimestamp, - this.order, - required this.owner, - required this.ownerId, - required this.shared, - this.startDate, - required this.updatedAt, - }); - - /// Album name - String albumName; - - /// Thumbnail asset ID - String? albumThumbnailAssetId; - - List albumUsers; - - /// Number of assets - int assetCount; - - List assets; - - List contributorCounts; - - /// Creation date - DateTime createdAt; - - /// Album description - 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; - - /// Has shared link - bool hasSharedLink; - - /// Album ID - String id; - - /// Activity feed enabled - 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; - - /// Asset sort order - /// - /// 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; - - UserResponseDto owner; - - /// Owner user ID - String ownerId; - - /// Is shared album - 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; - - /// Last update date - 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.assets, assets) && - _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.owner == owner && - other.ownerId == ownerId && - other.shared == shared && - other.startDate == startDate && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumName.hashCode) + - (albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) + - (albumUsers.hashCode) + - (assetCount.hashCode) + - (assets.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) + - (owner.hashCode) + - (ownerId.hashCode) + - (shared.hashCode) + - (startDate == null ? 0 : startDate!.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, albumUsers=$albumUsers, assetCount=$assetCount, assets=$assets, contributorCounts=$contributorCounts, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, startDate=$startDate, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'albumName'] = this.albumName; - if (this.albumThumbnailAssetId != null) { - json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; - } else { - // json[r'albumThumbnailAssetId'] = null; - } - json[r'albumUsers'] = this.albumUsers; - json[r'assetCount'] = this.assetCount; - json[r'assets'] = this.assets; - 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'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; - } - if (this.order != null) { - json[r'order'] = this.order; - } else { - // json[r'order'] = null; - } - json[r'owner'] = this.owner; - json[r'ownerId'] = this.ownerId; - json[r'shared'] = this.shared; - if (this.startDate != null) { - json[r'startDate'] = this.startDate!.toUtc().toIso8601String(); - } else { - // json[r'startDate'] = null; - } - json[r'updatedAt'] = this.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(); - - return AlbumResponseDto( - albumName: mapValueOfType(json, r'albumName')!, - albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), - albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']), - assetCount: mapValueOfType(json, r'assetCount')!, - assets: AssetResponseDto.listFromJson(json[r'assets']), - contributorCounts: ContributorCountResponseDto.listFromJson(json[r'contributorCounts']), - createdAt: mapDateTime(json, r'createdAt', r'')!, - description: mapValueOfType(json, r'description')!, - endDate: mapDateTime(json, r'endDate', r''), - hasSharedLink: mapValueOfType(json, r'hasSharedLink')!, - id: mapValueOfType(json, r'id')!, - isActivityEnabled: mapValueOfType(json, r'isActivityEnabled')!, - lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''), - order: AssetOrder.fromJson(json[r'order']), - owner: UserResponseDto.fromJson(json[r'owner'])!, - ownerId: mapValueOfType(json, r'ownerId')!, - shared: mapValueOfType(json, r'shared')!, - startDate: mapDateTime(json, r'startDate', r''), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'albumName', - 'albumThumbnailAssetId', - 'albumUsers', - 'assetCount', - 'assets', - 'createdAt', - 'description', - 'hasSharedLink', - 'id', - 'isActivityEnabled', - 'owner', - 'ownerId', - 'shared', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/album_statistics_response_dto.dart b/mobile/openapi/lib/model/album_statistics_response_dto.dart deleted file mode 100644 index 127334e687..0000000000 --- a/mobile/openapi/lib/model/album_statistics_response_dto.dart +++ /dev/null @@ -1,118 +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 AlbumStatisticsResponseDto { - /// Returns a new [AlbumStatisticsResponseDto] instance. - AlbumStatisticsResponseDto({ - required this.notShared, - required this.owned, - required this.shared, - }); - - /// Number of non-shared albums - int notShared; - - /// Number of owned albums - int owned; - - /// Number of shared albums - 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]'; - - Map toJson() { - final json = {}; - json[r'notShared'] = this.notShared; - json[r'owned'] = this.owned; - json[r'shared'] = this.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(); - - return AlbumStatisticsResponseDto( - notShared: mapValueOfType(json, r'notShared')!, - owned: mapValueOfType(json, r'owned')!, - shared: mapValueOfType(json, r'shared')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumStatisticsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumStatisticsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'notShared', - 'owned', - 'shared', - }; -} - diff --git a/mobile/openapi/lib/model/album_user_add_dto.dart b/mobile/openapi/lib/model/album_user_add_dto.dart deleted file mode 100644 index c448a0b4b7..0000000000 --- a/mobile/openapi/lib/model/album_user_add_dto.dart +++ /dev/null @@ -1,108 +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 AlbumUserAddDto { - /// Returns a new [AlbumUserAddDto] instance. - AlbumUserAddDto({ - this.role = AlbumUserRole.editor, - required this.userId, - }); - - /// Album user role - AlbumUserRole role; - - /// User ID - 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.hashCode) + - (userId.hashCode); - - @override - String toString() => 'AlbumUserAddDto[role=$role, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'role'] = this.role; - json[r'userId'] = this.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(); - - return AlbumUserAddDto( - role: AlbumUserRole.fromJson(json[r'role']) ?? AlbumUserRole.editor, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumUserAddDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumUserAddDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/album_user_create_dto.dart b/mobile/openapi/lib/model/album_user_create_dto.dart deleted file mode 100644 index 8006748341..0000000000 --- a/mobile/openapi/lib/model/album_user_create_dto.dart +++ /dev/null @@ -1,109 +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 AlbumUserCreateDto { - /// Returns a new [AlbumUserCreateDto] instance. - AlbumUserCreateDto({ - required this.role, - required this.userId, - }); - - /// Album user role - AlbumUserRole role; - - /// User ID - 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]'; - - Map toJson() { - final json = {}; - json[r'role'] = this.role; - json[r'userId'] = this.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(); - - return AlbumUserCreateDto( - role: AlbumUserRole.fromJson(json[r'role'])!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumUserCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumUserCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'role', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/album_user_response_dto.dart b/mobile/openapi/lib/model/album_user_response_dto.dart deleted file mode 100644 index 8d0c01cfb8..0000000000 --- a/mobile/openapi/lib/model/album_user_response_dto.dart +++ /dev/null @@ -1,108 +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 AlbumUserResponseDto { - /// Returns a new [AlbumUserResponseDto] instance. - AlbumUserResponseDto({ - required this.role, - required this.user, - }); - - /// Album user role - AlbumUserRole role; - - 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]'; - - Map toJson() { - final json = {}; - json[r'role'] = this.role; - json[r'user'] = this.user; - 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(); - - return AlbumUserResponseDto( - role: AlbumUserRole.fromJson(json[r'role'])!, - user: UserResponseDto.fromJson(json[r'user'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumUserResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumUserResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'role', - 'user', - }; -} - diff --git a/mobile/openapi/lib/model/album_user_role.dart b/mobile/openapi/lib/model/album_user_role.dart deleted file mode 100644 index d797fdc2e8..0000000000 --- a/mobile/openapi/lib/model/album_user_role.dart +++ /dev/null @@ -1,85 +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; - -/// Album user role -class AlbumUserRole { - /// Instantiate a new enum with the provided [value]. - const AlbumUserRole._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const editor = AlbumUserRole._(r'editor'); - static const viewer = AlbumUserRole._(r'viewer'); - - /// List of all possible values in this [enum][AlbumUserRole]. - static const values = [ - editor, - viewer, - ]; - - static AlbumUserRole? fromJson(dynamic value) => AlbumUserRoleTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } -} - -/// 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'viewer': return AlbumUserRole.viewer; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AlbumUserRoleTypeTransformer] instance. - static AlbumUserRoleTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/albums_add_assets_dto.dart b/mobile/openapi/lib/model/albums_add_assets_dto.dart deleted file mode 100644 index d6aa3db1c1..0000000000 --- a/mobile/openapi/lib/model/albums_add_assets_dto.dart +++ /dev/null @@ -1,113 +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 AlbumsAddAssetsDto { - /// Returns a new [AlbumsAddAssetsDto] instance. - AlbumsAddAssetsDto({ - this.albumIds = const [], - this.assetIds = const [], - }); - - /// Album IDs - List albumIds; - - /// Asset IDs - List 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]'; - - Map toJson() { - final json = {}; - json[r'albumIds'] = this.albumIds; - json[r'assetIds'] = this.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(); - - return AlbumsAddAssetsDto( - albumIds: json[r'albumIds'] is Iterable - ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) - : const [], - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumsAddAssetsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumsAddAssetsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'albumIds', - 'assetIds', - }; -} - diff --git a/mobile/openapi/lib/model/albums_add_assets_response_dto.dart b/mobile/openapi/lib/model/albums_add_assets_response_dto.dart deleted file mode 100644 index 743a9f0645..0000000000 --- a/mobile/openapi/lib/model/albums_add_assets_response_dto.dart +++ /dev/null @@ -1,118 +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 AlbumsAddAssetsResponseDto { - /// Returns a new [AlbumsAddAssetsResponseDto] instance. - AlbumsAddAssetsResponseDto({ - this.error, - required this.success, - }); - - /// Error reason - /// - /// 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; - - /// Operation success - bool success; - - @override - bool operator ==(Object other) => identical(this, other) || other is AlbumsAddAssetsResponseDto && - other.error == error && - other.success == success; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (error == null ? 0 : error!.hashCode) + - (success.hashCode); - - @override - String toString() => 'AlbumsAddAssetsResponseDto[error=$error, success=$success]'; - - Map toJson() { - final json = {}; - if (this.error != null) { - json[r'error'] = this.error; - } else { - // json[r'error'] = null; - } - json[r'success'] = this.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(); - - return AlbumsAddAssetsResponseDto( - error: BulkIdErrorReason.fromJson(json[r'error']), - success: mapValueOfType(json, r'success')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumsAddAssetsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumsAddAssetsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'success', - }; -} - diff --git a/mobile/openapi/lib/model/albums_response.dart b/mobile/openapi/lib/model/albums_response.dart deleted file mode 100644 index 520ee171c1..0000000000 --- a/mobile/openapi/lib/model/albums_response.dart +++ /dev/null @@ -1,100 +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 AlbumsResponse { - /// Returns a new [AlbumsResponse] instance. - AlbumsResponse({ - this.defaultAssetOrder = AssetOrder.desc, - }); - - /// Default asset order for albums - 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]'; - - Map toJson() { - final json = {}; - json[r'defaultAssetOrder'] = this.defaultAssetOrder; - 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(); - - return AlbumsResponse( - defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumsResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumsResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - 'defaultAssetOrder', - }; -} - diff --git a/mobile/openapi/lib/model/albums_update.dart b/mobile/openapi/lib/model/albums_update.dart deleted file mode 100644 index 107c65dd1e..0000000000 --- a/mobile/openapi/lib/model/albums_update.dart +++ /dev/null @@ -1,109 +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 AlbumsUpdate { - /// Returns a new [AlbumsUpdate] instance. - AlbumsUpdate({ - this.defaultAssetOrder, - }); - - /// Default asset order for albums - /// - /// 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; - - @override - bool operator ==(Object other) => identical(this, other) || other is AlbumsUpdate && - other.defaultAssetOrder == defaultAssetOrder; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (defaultAssetOrder == null ? 0 : defaultAssetOrder!.hashCode); - - @override - String toString() => 'AlbumsUpdate[defaultAssetOrder=$defaultAssetOrder]'; - - Map toJson() { - final json = {}; - if (this.defaultAssetOrder != null) { - json[r'defaultAssetOrder'] = this.defaultAssetOrder; - } else { - // json[r'defaultAssetOrder'] = null; - } - 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(); - - return AlbumsUpdate( - defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - 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); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AlbumsUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AlbumsUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - 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 = { - }; -} - diff --git a/mobile/openapi/lib/model/api_key_create_response_dto.dart b/mobile/openapi/lib/model/api_key_create_response_dto.dart index 7540c4bb26..10fe908600 100644 --- a/mobile/openapi/lib/model/api_key_create_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_create_response_dto.dart @@ -13,33 +13,33 @@ part of openapi.api; class APIKeyCreateResponseDto { /// Returns a new [APIKeyCreateResponseDto] instance. APIKeyCreateResponseDto({ - required this.apiKey, required this.secret, + required this.apiKey, }); - APIKeyResponseDto apiKey; - /// API key secret (only shown once) String secret; + APIKeyResponseDto apiKey; + @override bool operator ==(Object other) => identical(this, other) || other is APIKeyCreateResponseDto && - other.apiKey == apiKey && - other.secret == secret; + other.secret == secret && + other.apiKey == apiKey; @override int get hashCode => // ignore: unnecessary_parenthesis - (apiKey.hashCode) + - (secret.hashCode); + (secret.hashCode) + + (apiKey.hashCode); @override - String toString() => 'APIKeyCreateResponseDto[apiKey=$apiKey, secret=$secret]'; + String toString() => 'APIKeyCreateResponseDto[secret=$secret, apiKey=$apiKey]'; Map toJson() { final json = {}; - json[r'apiKey'] = this.apiKey; json[r'secret'] = this.secret; + json[r'apiKey'] = this.apiKey; return json; } @@ -52,8 +52,8 @@ class APIKeyCreateResponseDto { final json = value.cast(); return APIKeyCreateResponseDto( - apiKey: APIKeyResponseDto.fromJson(json[r'apiKey'])!, secret: mapValueOfType(json, r'secret')!, + apiKey: APIKeyResponseDto.fromJson(json[r'apiKey'])!, ); } return null; @@ -101,8 +101,8 @@ class APIKeyCreateResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'apiKey', 'secret', + 'apiKey', }; } diff --git a/mobile/openapi/lib/model/api_key_response_dto.dart b/mobile/openapi/lib/model/api_key_response_dto.dart index 32ba543342..c4d1e75ec6 100644 --- a/mobile/openapi/lib/model/api_key_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_response_dto.dart @@ -13,55 +13,55 @@ part of openapi.api; class APIKeyResponseDto { /// Returns a new [APIKeyResponseDto] instance. APIKeyResponseDto({ - required this.createdAt, required this.id, required this.name, - this.permissions = const [], + required this.createdAt, required this.updatedAt, + this.permissions = const [], }); - /// Creation date - DateTime createdAt; - /// API key ID String id; /// API key name String name; - /// List of permissions - List permissions; + /// Creation date + DateTime createdAt; /// Last update date DateTime updatedAt; + /// List of permissions + List permissions; + @override bool operator ==(Object other) => identical(this, other) || other is APIKeyResponseDto && - other.createdAt == createdAt && other.id == id && other.name == name && - _deepEquality.equals(other.permissions, permissions) && - other.updatedAt == updatedAt; + other.createdAt == createdAt && + other.updatedAt == updatedAt && + _deepEquality.equals(other.permissions, permissions); @override int get hashCode => // ignore: unnecessary_parenthesis - (createdAt.hashCode) + (id.hashCode) + (name.hashCode) + - (permissions.hashCode) + - (updatedAt.hashCode); + (createdAt.hashCode) + + (updatedAt.hashCode) + + (permissions.hashCode); @override - String toString() => 'APIKeyResponseDto[createdAt=$createdAt, id=$id, name=$name, permissions=$permissions, updatedAt=$updatedAt]'; + String toString() => 'APIKeyResponseDto[id=$id, name=$name, createdAt=$createdAt, updatedAt=$updatedAt, permissions=$permissions]'; Map toJson() { final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'id'] = this.id; json[r'name'] = this.name; - json[r'permissions'] = this.permissions; + json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); + json[r'permissions'] = this.permissions; return json; } @@ -74,11 +74,11 @@ class APIKeyResponseDto { final json = value.cast(); return APIKeyResponseDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, - permissions: Permission.listFromJson(json[r'permissions']), + createdAt: mapDateTime(json, r'createdAt', r'')!, updatedAt: mapDateTime(json, r'updatedAt', r'')!, + permissions: Permission.listFromJson(json[r'permissions']), ); } return null; @@ -126,11 +126,11 @@ class APIKeyResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'createdAt', 'id', 'name', - 'permissions', + 'createdAt', 'updatedAt', + 'permissions', }; } diff --git a/mobile/openapi/lib/model/asset_bulk_delete_dto.dart b/mobile/openapi/lib/model/asset_bulk_delete_dto.dart deleted file mode 100644 index 055ef16015..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_delete_dto.dart +++ /dev/null @@ -1,120 +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 AssetBulkDeleteDto { - /// Returns a new [AssetBulkDeleteDto] instance. - AssetBulkDeleteDto({ - this.force, - this.ids = const [], - }); - - /// Force delete even if in use - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? force; - - /// IDs to process - List ids; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkDeleteDto && - other.force == force && - _deepEquality.equals(other.ids, ids); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (force == null ? 0 : force!.hashCode) + - (ids.hashCode); - - @override - String toString() => 'AssetBulkDeleteDto[force=$force, ids=$ids]'; - - Map toJson() { - final json = {}; - if (this.force != null) { - json[r'force'] = this.force; - } else { - // json[r'force'] = null; - } - json[r'ids'] = this.ids; - return json; - } - - /// Returns a new [AssetBulkDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkDeleteDto( - force: mapValueOfType(json, r'force'), - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/asset_bulk_update_dto.dart b/mobile/openapi/lib/model/asset_bulk_update_dto.dart deleted file mode 100644 index a373743852..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_update_dto.dart +++ /dev/null @@ -1,279 +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 AssetBulkUpdateDto { - /// Returns a new [AssetBulkUpdateDto] instance. - AssetBulkUpdateDto({ - this.dateTimeOriginal, - this.dateTimeRelative, - this.description, - this.duplicateId, - this.ids = const [], - this.isFavorite, - this.latitude, - this.longitude, - this.rating, - this.timeZone, - this.visibility, - }); - - /// Original date and time - /// - /// 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? dateTimeOriginal; - - /// Relative time offset in seconds - /// - /// 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. - /// - num? dateTimeRelative; - - /// Asset description - /// - /// 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? description; - - /// Duplicate ID - String? duplicateId; - - /// Asset IDs to update - List ids; - - /// Mark as favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Latitude coordinate - /// - /// 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. - /// - num? latitude; - - /// Longitude coordinate - /// - /// 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. - /// - num? longitude; - - /// Rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Time zone (IANA timezone) - /// - /// 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? timeZone; - - /// Asset visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkUpdateDto && - other.dateTimeOriginal == dateTimeOriginal && - other.dateTimeRelative == dateTimeRelative && - other.description == description && - other.duplicateId == duplicateId && - _deepEquality.equals(other.ids, ids) && - other.isFavorite == isFavorite && - other.latitude == latitude && - other.longitude == longitude && - other.rating == rating && - other.timeZone == timeZone && - other.visibility == visibility; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (dateTimeRelative == null ? 0 : dateTimeRelative!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (duplicateId == null ? 0 : duplicateId!.hashCode) + - (ids.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (timeZone == null ? 0 : timeZone!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode); - - @override - String toString() => 'AssetBulkUpdateDto[dateTimeOriginal=$dateTimeOriginal, dateTimeRelative=$dateTimeRelative, description=$description, duplicateId=$duplicateId, ids=$ids, isFavorite=$isFavorite, latitude=$latitude, longitude=$longitude, rating=$rating, timeZone=$timeZone, visibility=$visibility]'; - - Map toJson() { - final json = {}; - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal; - } else { - // json[r'dateTimeOriginal'] = null; - } - if (this.dateTimeRelative != null) { - json[r'dateTimeRelative'] = this.dateTimeRelative; - } else { - // json[r'dateTimeRelative'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.duplicateId != null) { - json[r'duplicateId'] = this.duplicateId; - } else { - // json[r'duplicateId'] = null; - } - json[r'ids'] = this.ids; - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.latitude != null) { - json[r'latitude'] = this.latitude; - } else { - // json[r'latitude'] = null; - } - if (this.longitude != null) { - json[r'longitude'] = this.longitude; - } else { - // json[r'longitude'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.timeZone != null) { - json[r'timeZone'] = this.timeZone; - } else { - // json[r'timeZone'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - return json; - } - - /// Returns a new [AssetBulkUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkUpdateDto( - dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), - dateTimeRelative: num.parse('${json[r'dateTimeRelative']}'), - description: mapValueOfType(json, r'description'), - duplicateId: mapValueOfType(json, r'duplicateId'), - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - isFavorite: mapValueOfType(json, r'isFavorite'), - latitude: num.parse('${json[r'latitude']}'), - longitude: num.parse('${json[r'longitude']}'), - rating: num.parse('${json[r'rating']}'), - timeZone: mapValueOfType(json, r'timeZone'), - visibility: AssetVisibility.fromJson(json[r'visibility']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart deleted file mode 100644 index 66f46795e8..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_dto.dart +++ /dev/null @@ -1,100 +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 AssetBulkUploadCheckDto { - /// Returns a new [AssetBulkUploadCheckDto] instance. - AssetBulkUploadCheckDto({ - this.assets = const [], - }); - - /// Assets to check - List assets; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckDto && - _deepEquality.equals(other.assets, assets); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assets.hashCode); - - @override - String toString() => 'AssetBulkUploadCheckDto[assets=$assets]'; - - Map toJson() { - final json = {}; - json[r'assets'] = this.assets; - return json; - } - - /// Returns a new [AssetBulkUploadCheckDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkUploadCheckDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckDto"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkUploadCheckDto( - assets: AssetBulkUploadCheckItem.listFromJson(json[r'assets']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkUploadCheckDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkUploadCheckDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkUploadCheckDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assets', - }; -} - diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart deleted file mode 100644 index 65f81926e3..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_item.dart +++ /dev/null @@ -1,109 +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 AssetBulkUploadCheckItem { - /// Returns a new [AssetBulkUploadCheckItem] instance. - AssetBulkUploadCheckItem({ - required this.checksum, - required this.id, - }); - - /// Base64 or hex encoded SHA1 hash - String checksum; - - /// Asset ID - String id; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckItem && - other.checksum == checksum && - other.id == id; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (checksum.hashCode) + - (id.hashCode); - - @override - String toString() => 'AssetBulkUploadCheckItem[checksum=$checksum, id=$id]'; - - Map toJson() { - final json = {}; - json[r'checksum'] = this.checksum; - json[r'id'] = this.id; - return json; - } - - /// Returns a new [AssetBulkUploadCheckItem] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkUploadCheckItem? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckItem"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkUploadCheckItem( - checksum: mapValueOfType(json, r'checksum')!, - id: mapValueOfType(json, r'id')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckItem.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkUploadCheckItem.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkUploadCheckItem-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkUploadCheckItem.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'checksum', - 'id', - }; -} - diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart deleted file mode 100644 index b37bb0de8a..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_response_dto.dart +++ /dev/null @@ -1,100 +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 AssetBulkUploadCheckResponseDto { - /// Returns a new [AssetBulkUploadCheckResponseDto] instance. - AssetBulkUploadCheckResponseDto({ - this.results = const [], - }); - - /// Upload check results - List results; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckResponseDto && - _deepEquality.equals(other.results, results); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (results.hashCode); - - @override - String toString() => 'AssetBulkUploadCheckResponseDto[results=$results]'; - - Map toJson() { - final json = {}; - json[r'results'] = this.results; - return json; - } - - /// Returns a new [AssetBulkUploadCheckResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkUploadCheckResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkUploadCheckResponseDto( - results: AssetBulkUploadCheckResult.listFromJson(json[r'results']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkUploadCheckResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkUploadCheckResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkUploadCheckResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'results', - }; -} - diff --git a/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart b/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart deleted file mode 100644 index b56370f689..0000000000 --- a/mobile/openapi/lib/model/asset_bulk_upload_check_result.dart +++ /dev/null @@ -1,305 +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 AssetBulkUploadCheckResult { - /// Returns a new [AssetBulkUploadCheckResult] instance. - AssetBulkUploadCheckResult({ - required this.action, - this.assetId, - required this.id, - this.isTrashed, - this.reason, - }); - - /// Upload action - AssetBulkUploadCheckResultActionEnum action; - - /// Existing asset ID if duplicate - /// - /// 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; - - /// Asset ID - String id; - - /// Whether existing asset is trashed - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isTrashed; - - /// Rejection reason if rejected - AssetBulkUploadCheckResultReasonEnum? reason; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckResult && - other.action == action && - other.assetId == assetId && - other.id == id && - other.isTrashed == isTrashed && - other.reason == reason; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (assetId == null ? 0 : assetId!.hashCode) + - (id.hashCode) + - (isTrashed == null ? 0 : isTrashed!.hashCode) + - (reason == null ? 0 : reason!.hashCode); - - @override - String toString() => 'AssetBulkUploadCheckResult[action=$action, assetId=$assetId, id=$id, isTrashed=$isTrashed, reason=$reason]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - if (this.assetId != null) { - json[r'assetId'] = this.assetId; - } else { - // json[r'assetId'] = null; - } - json[r'id'] = this.id; - if (this.isTrashed != null) { - json[r'isTrashed'] = this.isTrashed; - } else { - // json[r'isTrashed'] = null; - } - if (this.reason != null) { - json[r'reason'] = this.reason; - } else { - // json[r'reason'] = null; - } - return json; - } - - /// Returns a new [AssetBulkUploadCheckResult] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetBulkUploadCheckResult? fromJson(dynamic value) { - upgradeDto(value, "AssetBulkUploadCheckResult"); - if (value is Map) { - final json = value.cast(); - - return AssetBulkUploadCheckResult( - action: AssetBulkUploadCheckResultActionEnum.fromJson(json[r'action'])!, - assetId: mapValueOfType(json, r'assetId'), - id: mapValueOfType(json, r'id')!, - isTrashed: mapValueOfType(json, r'isTrashed'), - reason: AssetBulkUploadCheckResultReasonEnum.fromJson(json[r'reason']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckResult.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetBulkUploadCheckResult.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetBulkUploadCheckResult-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetBulkUploadCheckResult.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'id', - }; -} - -/// Upload action -class AssetBulkUploadCheckResultActionEnum { - /// Instantiate a new enum with the provided [value]. - const AssetBulkUploadCheckResultActionEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const accept = AssetBulkUploadCheckResultActionEnum._(r'accept'); - static const reject = AssetBulkUploadCheckResultActionEnum._(r'reject'); - - /// List of all possible values in this [enum][AssetBulkUploadCheckResultActionEnum]. - static const values = [ - accept, - reject, - ]; - - static AssetBulkUploadCheckResultActionEnum? fromJson(dynamic value) => AssetBulkUploadCheckResultActionEnumTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckResultActionEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetBulkUploadCheckResultActionEnum] to String, -/// and [decode] dynamic data back to [AssetBulkUploadCheckResultActionEnum]. -class AssetBulkUploadCheckResultActionEnumTypeTransformer { - factory AssetBulkUploadCheckResultActionEnumTypeTransformer() => _instance ??= const AssetBulkUploadCheckResultActionEnumTypeTransformer._(); - - const AssetBulkUploadCheckResultActionEnumTypeTransformer._(); - - String encode(AssetBulkUploadCheckResultActionEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetBulkUploadCheckResultActionEnum. - /// - /// 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. - AssetBulkUploadCheckResultActionEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'accept': return AssetBulkUploadCheckResultActionEnum.accept; - case r'reject': return AssetBulkUploadCheckResultActionEnum.reject; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetBulkUploadCheckResultActionEnumTypeTransformer] instance. - static AssetBulkUploadCheckResultActionEnumTypeTransformer? _instance; -} - - -/// Rejection reason if rejected -class AssetBulkUploadCheckResultReasonEnum { - /// Instantiate a new enum with the provided [value]. - const AssetBulkUploadCheckResultReasonEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const duplicate = AssetBulkUploadCheckResultReasonEnum._(r'duplicate'); - static const unsupportedFormat = AssetBulkUploadCheckResultReasonEnum._(r'unsupported-format'); - - /// List of all possible values in this [enum][AssetBulkUploadCheckResultReasonEnum]. - static const values = [ - duplicate, - unsupportedFormat, - ]; - - static AssetBulkUploadCheckResultReasonEnum? fromJson(dynamic value) => AssetBulkUploadCheckResultReasonEnumTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetBulkUploadCheckResultReasonEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetBulkUploadCheckResultReasonEnum] to String, -/// and [decode] dynamic data back to [AssetBulkUploadCheckResultReasonEnum]. -class AssetBulkUploadCheckResultReasonEnumTypeTransformer { - factory AssetBulkUploadCheckResultReasonEnumTypeTransformer() => _instance ??= const AssetBulkUploadCheckResultReasonEnumTypeTransformer._(); - - const AssetBulkUploadCheckResultReasonEnumTypeTransformer._(); - - String encode(AssetBulkUploadCheckResultReasonEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetBulkUploadCheckResultReasonEnum. - /// - /// 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. - AssetBulkUploadCheckResultReasonEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'duplicate': return AssetBulkUploadCheckResultReasonEnum.duplicate; - case r'unsupported-format': return AssetBulkUploadCheckResultReasonEnum.unsupportedFormat; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetBulkUploadCheckResultReasonEnumTypeTransformer] instance. - static AssetBulkUploadCheckResultReasonEnumTypeTransformer? _instance; -} - - diff --git a/mobile/openapi/lib/model/asset_copy_dto.dart b/mobile/openapi/lib/model/asset_copy_dto.dart deleted file mode 100644 index 2e68c5c113..0000000000 --- a/mobile/openapi/lib/model/asset_copy_dto.dart +++ /dev/null @@ -1,149 +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 AssetCopyDto { - /// Returns a new [AssetCopyDto] instance. - AssetCopyDto({ - this.albums = true, - this.favorite = true, - this.sharedLinks = true, - this.sidecar = true, - required this.sourceId, - this.stack = true, - required this.targetId, - }); - - /// Copy album associations - bool albums; - - /// Copy favorite status - bool favorite; - - /// Copy shared links - bool sharedLinks; - - /// Copy sidecar file - bool sidecar; - - /// Source asset ID - String sourceId; - - /// Copy stack association - bool stack; - - /// Target asset ID - String targetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetCopyDto && - other.albums == albums && - other.favorite == favorite && - other.sharedLinks == sharedLinks && - other.sidecar == sidecar && - other.sourceId == sourceId && - other.stack == stack && - other.targetId == targetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albums.hashCode) + - (favorite.hashCode) + - (sharedLinks.hashCode) + - (sidecar.hashCode) + - (sourceId.hashCode) + - (stack.hashCode) + - (targetId.hashCode); - - @override - String toString() => 'AssetCopyDto[albums=$albums, favorite=$favorite, sharedLinks=$sharedLinks, sidecar=$sidecar, sourceId=$sourceId, stack=$stack, targetId=$targetId]'; - - Map toJson() { - final json = {}; - json[r'albums'] = this.albums; - json[r'favorite'] = this.favorite; - json[r'sharedLinks'] = this.sharedLinks; - json[r'sidecar'] = this.sidecar; - json[r'sourceId'] = this.sourceId; - json[r'stack'] = this.stack; - json[r'targetId'] = this.targetId; - return json; - } - - /// Returns a new [AssetCopyDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetCopyDto? fromJson(dynamic value) { - upgradeDto(value, "AssetCopyDto"); - if (value is Map) { - final json = value.cast(); - - return AssetCopyDto( - albums: mapValueOfType(json, r'albums') ?? true, - favorite: mapValueOfType(json, r'favorite') ?? true, - sharedLinks: mapValueOfType(json, r'sharedLinks') ?? true, - sidecar: mapValueOfType(json, r'sidecar') ?? true, - sourceId: mapValueOfType(json, r'sourceId')!, - stack: mapValueOfType(json, r'stack') ?? true, - targetId: mapValueOfType(json, r'targetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetCopyDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetCopyDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetCopyDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetCopyDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'sourceId', - 'targetId', - }; -} - diff --git a/mobile/openapi/lib/model/asset_delta_sync_dto.dart b/mobile/openapi/lib/model/asset_delta_sync_dto.dart deleted file mode 100644 index 22c09752d2..0000000000 --- a/mobile/openapi/lib/model/asset_delta_sync_dto.dart +++ /dev/null @@ -1,111 +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 AssetDeltaSyncDto { - /// Returns a new [AssetDeltaSyncDto] instance. - AssetDeltaSyncDto({ - required this.updatedAfter, - this.userIds = const [], - }); - - /// Sync assets updated after this date - DateTime updatedAfter; - - /// User IDs to sync - List userIds; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetDeltaSyncDto && - other.updatedAfter == updatedAfter && - _deepEquality.equals(other.userIds, userIds); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (updatedAfter.hashCode) + - (userIds.hashCode); - - @override - String toString() => 'AssetDeltaSyncDto[updatedAfter=$updatedAfter, userIds=$userIds]'; - - Map toJson() { - final json = {}; - json[r'updatedAfter'] = this.updatedAfter.toUtc().toIso8601String(); - json[r'userIds'] = this.userIds; - return json; - } - - /// Returns a new [AssetDeltaSyncDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetDeltaSyncDto? fromJson(dynamic value) { - upgradeDto(value, "AssetDeltaSyncDto"); - if (value is Map) { - final json = value.cast(); - - return AssetDeltaSyncDto( - updatedAfter: mapDateTime(json, r'updatedAfter', r'')!, - userIds: json[r'userIds'] is Iterable - ? (json[r'userIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetDeltaSyncDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetDeltaSyncDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetDeltaSyncDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetDeltaSyncDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'updatedAfter', - 'userIds', - }; -} - diff --git a/mobile/openapi/lib/model/asset_delta_sync_response_dto.dart b/mobile/openapi/lib/model/asset_delta_sync_response_dto.dart deleted file mode 100644 index 7351840b11..0000000000 --- a/mobile/openapi/lib/model/asset_delta_sync_response_dto.dart +++ /dev/null @@ -1,120 +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 AssetDeltaSyncResponseDto { - /// Returns a new [AssetDeltaSyncResponseDto] instance. - AssetDeltaSyncResponseDto({ - this.deleted = const [], - required this.needsFullSync, - this.upserted = const [], - }); - - /// Deleted asset IDs - List deleted; - - /// Whether full sync is needed - bool needsFullSync; - - /// Upserted assets - List upserted; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetDeltaSyncResponseDto && - _deepEquality.equals(other.deleted, deleted) && - other.needsFullSync == needsFullSync && - _deepEquality.equals(other.upserted, upserted); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (deleted.hashCode) + - (needsFullSync.hashCode) + - (upserted.hashCode); - - @override - String toString() => 'AssetDeltaSyncResponseDto[deleted=$deleted, needsFullSync=$needsFullSync, upserted=$upserted]'; - - Map toJson() { - final json = {}; - json[r'deleted'] = this.deleted; - json[r'needsFullSync'] = this.needsFullSync; - json[r'upserted'] = this.upserted; - return json; - } - - /// Returns a new [AssetDeltaSyncResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetDeltaSyncResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetDeltaSyncResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetDeltaSyncResponseDto( - deleted: json[r'deleted'] is Iterable - ? (json[r'deleted'] as Iterable).cast().toList(growable: false) - : const [], - needsFullSync: mapValueOfType(json, r'needsFullSync')!, - upserted: AssetResponseDto.listFromJson(json[r'upserted']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetDeltaSyncResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetDeltaSyncResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetDeltaSyncResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetDeltaSyncResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'deleted', - 'needsFullSync', - 'upserted', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action.dart b/mobile/openapi/lib/model/asset_edit_action.dart deleted file mode 100644 index 3754cb4501..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action.dart +++ /dev/null @@ -1,88 +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; - -/// Type of edit action to perform -class AssetEditAction { - /// Instantiate a new enum with the provided [value]. - const AssetEditAction._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const crop = AssetEditAction._(r'crop'); - static const rotate = AssetEditAction._(r'rotate'); - static const mirror = AssetEditAction._(r'mirror'); - - /// List of all possible values in this [enum][AssetEditAction]. - static const values = [ - crop, - rotate, - mirror, - ]; - - static AssetEditAction? fromJson(dynamic value) => AssetEditActionTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditAction.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetEditAction] to String, -/// and [decode] dynamic data back to [AssetEditAction]. -class AssetEditActionTypeTransformer { - factory AssetEditActionTypeTransformer() => _instance ??= const AssetEditActionTypeTransformer._(); - - const AssetEditActionTypeTransformer._(); - - String encode(AssetEditAction data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetEditAction. - /// - /// 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. - AssetEditAction? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'crop': return AssetEditAction.crop; - case r'rotate': return AssetEditAction.rotate; - case r'mirror': return AssetEditAction.mirror; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetEditActionTypeTransformer] instance. - static AssetEditActionTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action_crop.dart b/mobile/openapi/lib/model/asset_edit_action_crop.dart deleted file mode 100644 index 7672ed825b..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action_crop.dart +++ /dev/null @@ -1,108 +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 AssetEditActionCrop { - /// Returns a new [AssetEditActionCrop] instance. - AssetEditActionCrop({ - required this.action, - required this.parameters, - }); - - /// Type of edit action to perform - AssetEditAction action; - - CropParameters parameters; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditActionCrop && - other.action == action && - other.parameters == parameters; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (parameters.hashCode); - - @override - String toString() => 'AssetEditActionCrop[action=$action, parameters=$parameters]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - json[r'parameters'] = this.parameters; - return json; - } - - /// Returns a new [AssetEditActionCrop] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditActionCrop? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionCrop"); - if (value is Map) { - final json = value.cast(); - - return AssetEditActionCrop( - action: AssetEditAction.fromJson(json[r'action'])!, - parameters: CropParameters.fromJson(json[r'parameters'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditActionCrop.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditActionCrop.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditActionCrop-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditActionCrop.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'parameters', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action_list_dto.dart b/mobile/openapi/lib/model/asset_edit_action_list_dto.dart deleted file mode 100644 index e843c66e8f..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action_list_dto.dart +++ /dev/null @@ -1,100 +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 AssetEditActionListDto { - /// Returns a new [AssetEditActionListDto] instance. - AssetEditActionListDto({ - this.edits = const [], - }); - - /// List of edit actions to apply (crop, rotate, or mirror) - List edits; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditActionListDto && - _deepEquality.equals(other.edits, edits); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (edits.hashCode); - - @override - String toString() => 'AssetEditActionListDto[edits=$edits]'; - - Map toJson() { - final json = {}; - json[r'edits'] = this.edits; - return json; - } - - /// Returns a new [AssetEditActionListDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditActionListDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionListDto"); - if (value is Map) { - final json = value.cast(); - - return AssetEditActionListDto( - edits: AssetEditActionListDtoEditsInner.listFromJson(json[r'edits']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditActionListDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditActionListDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditActionListDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditActionListDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'edits', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action_list_dto_edits_inner.dart b/mobile/openapi/lib/model/asset_edit_action_list_dto_edits_inner.dart deleted file mode 100644 index 00c9be2381..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action_list_dto_edits_inner.dart +++ /dev/null @@ -1,108 +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 AssetEditActionListDtoEditsInner { - /// Returns a new [AssetEditActionListDtoEditsInner] instance. - AssetEditActionListDtoEditsInner({ - required this.action, - required this.parameters, - }); - - /// Type of edit action to perform - AssetEditAction action; - - MirrorParameters parameters; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditActionListDtoEditsInner && - other.action == action && - other.parameters == parameters; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (parameters.hashCode); - - @override - String toString() => 'AssetEditActionListDtoEditsInner[action=$action, parameters=$parameters]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - json[r'parameters'] = this.parameters; - return json; - } - - /// Returns a new [AssetEditActionListDtoEditsInner] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditActionListDtoEditsInner? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionListDtoEditsInner"); - if (value is Map) { - final json = value.cast(); - - return AssetEditActionListDtoEditsInner( - action: AssetEditAction.fromJson(json[r'action'])!, - parameters: MirrorParameters.fromJson(json[r'parameters'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditActionListDtoEditsInner.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditActionListDtoEditsInner.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditActionListDtoEditsInner-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditActionListDtoEditsInner.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'parameters', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action_mirror.dart b/mobile/openapi/lib/model/asset_edit_action_mirror.dart deleted file mode 100644 index aef98fc1a8..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action_mirror.dart +++ /dev/null @@ -1,108 +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 AssetEditActionMirror { - /// Returns a new [AssetEditActionMirror] instance. - AssetEditActionMirror({ - required this.action, - required this.parameters, - }); - - /// Type of edit action to perform - AssetEditAction action; - - MirrorParameters parameters; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditActionMirror && - other.action == action && - other.parameters == parameters; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (parameters.hashCode); - - @override - String toString() => 'AssetEditActionMirror[action=$action, parameters=$parameters]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - json[r'parameters'] = this.parameters; - return json; - } - - /// Returns a new [AssetEditActionMirror] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditActionMirror? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionMirror"); - if (value is Map) { - final json = value.cast(); - - return AssetEditActionMirror( - action: AssetEditAction.fromJson(json[r'action'])!, - parameters: MirrorParameters.fromJson(json[r'parameters'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditActionMirror.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditActionMirror.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditActionMirror-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditActionMirror.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'parameters', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edit_action_rotate.dart b/mobile/openapi/lib/model/asset_edit_action_rotate.dart deleted file mode 100644 index 302e6a0ce6..0000000000 --- a/mobile/openapi/lib/model/asset_edit_action_rotate.dart +++ /dev/null @@ -1,108 +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 AssetEditActionRotate { - /// Returns a new [AssetEditActionRotate] instance. - AssetEditActionRotate({ - required this.action, - required this.parameters, - }); - - /// Type of edit action to perform - AssetEditAction action; - - RotateParameters parameters; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditActionRotate && - other.action == action && - other.parameters == parameters; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (parameters.hashCode); - - @override - String toString() => 'AssetEditActionRotate[action=$action, parameters=$parameters]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - json[r'parameters'] = this.parameters; - return json; - } - - /// Returns a new [AssetEditActionRotate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditActionRotate? fromJson(dynamic value) { - upgradeDto(value, "AssetEditActionRotate"); - if (value is Map) { - final json = value.cast(); - - return AssetEditActionRotate( - action: AssetEditAction.fromJson(json[r'action'])!, - parameters: RotateParameters.fromJson(json[r'parameters'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditActionRotate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditActionRotate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditActionRotate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditActionRotate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'parameters', - }; -} - diff --git a/mobile/openapi/lib/model/asset_edits_dto.dart b/mobile/openapi/lib/model/asset_edits_dto.dart deleted file mode 100644 index 3bfbce8594..0000000000 --- a/mobile/openapi/lib/model/asset_edits_dto.dart +++ /dev/null @@ -1,109 +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 AssetEditsDto { - /// Returns a new [AssetEditsDto] instance. - AssetEditsDto({ - required this.assetId, - this.edits = const [], - }); - - /// Asset ID to apply edits to - String assetId; - - /// List of edit actions to apply (crop, rotate, or mirror) - List edits; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetEditsDto && - other.assetId == assetId && - _deepEquality.equals(other.edits, edits); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (edits.hashCode); - - @override - String toString() => 'AssetEditsDto[assetId=$assetId, edits=$edits]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'edits'] = this.edits; - return json; - } - - /// Returns a new [AssetEditsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetEditsDto? fromJson(dynamic value) { - upgradeDto(value, "AssetEditsDto"); - if (value is Map) { - final json = value.cast(); - - return AssetEditsDto( - assetId: mapValueOfType(json, r'assetId')!, - edits: AssetEditActionListDtoEditsInner.listFromJson(json[r'edits']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetEditsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetEditsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetEditsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetEditsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'edits', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_create_dto.dart b/mobile/openapi/lib/model/asset_face_create_dto.dart deleted file mode 100644 index 3ecc20c699..0000000000 --- a/mobile/openapi/lib/model/asset_face_create_dto.dart +++ /dev/null @@ -1,163 +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 AssetFaceCreateDto { - /// Returns a new [AssetFaceCreateDto] instance. - AssetFaceCreateDto({ - required this.assetId, - required this.height, - required this.imageHeight, - required this.imageWidth, - required this.personId, - required this.width, - required this.x, - required this.y, - }); - - /// Asset ID - String assetId; - - /// Face bounding box height - int height; - - /// Image height in pixels - int imageHeight; - - /// Image width in pixels - int imageWidth; - - /// Person ID - String personId; - - /// Face bounding box width - int width; - - /// Face bounding box X coordinate - int x; - - /// Face bounding box Y coordinate - int y; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceCreateDto && - other.assetId == assetId && - other.height == height && - other.imageHeight == imageHeight && - other.imageWidth == imageWidth && - other.personId == personId && - other.width == width && - other.x == x && - other.y == y; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (height.hashCode) + - (imageHeight.hashCode) + - (imageWidth.hashCode) + - (personId.hashCode) + - (width.hashCode) + - (x.hashCode) + - (y.hashCode); - - @override - String toString() => 'AssetFaceCreateDto[assetId=$assetId, height=$height, imageHeight=$imageHeight, imageWidth=$imageWidth, personId=$personId, width=$width, x=$x, y=$y]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'height'] = this.height; - json[r'imageHeight'] = this.imageHeight; - json[r'imageWidth'] = this.imageWidth; - json[r'personId'] = this.personId; - json[r'width'] = this.width; - json[r'x'] = this.x; - json[r'y'] = this.y; - return json; - } - - /// Returns a new [AssetFaceCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceCreateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceCreateDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceCreateDto( - assetId: mapValueOfType(json, r'assetId')!, - height: mapValueOfType(json, r'height')!, - imageHeight: mapValueOfType(json, r'imageHeight')!, - imageWidth: mapValueOfType(json, r'imageWidth')!, - personId: mapValueOfType(json, r'personId')!, - width: mapValueOfType(json, r'width')!, - x: mapValueOfType(json, r'x')!, - y: mapValueOfType(json, r'y')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'height', - 'imageHeight', - 'imageWidth', - 'personId', - 'width', - 'x', - 'y', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_delete_dto.dart b/mobile/openapi/lib/model/asset_face_delete_dto.dart deleted file mode 100644 index a1f3731bea..0000000000 --- a/mobile/openapi/lib/model/asset_face_delete_dto.dart +++ /dev/null @@ -1,100 +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 AssetFaceDeleteDto { - /// Returns a new [AssetFaceDeleteDto] instance. - AssetFaceDeleteDto({ - required this.force, - }); - - /// Force delete even if person has other faces - bool force; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceDeleteDto && - other.force == force; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (force.hashCode); - - @override - String toString() => 'AssetFaceDeleteDto[force=$force]'; - - Map toJson() { - final json = {}; - json[r'force'] = this.force; - return json; - } - - /// Returns a new [AssetFaceDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceDeleteDto( - force: mapValueOfType(json, r'force')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'force', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_response_dto.dart b/mobile/openapi/lib/model/asset_face_response_dto.dart deleted file mode 100644 index 61d972a0c4..0000000000 --- a/mobile/openapi/lib/model/asset_face_response_dto.dart +++ /dev/null @@ -1,185 +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 AssetFaceResponseDto { - /// Returns a new [AssetFaceResponseDto] instance. - AssetFaceResponseDto({ - required this.boundingBoxX1, - required this.boundingBoxX2, - required this.boundingBoxY1, - required this.boundingBoxY2, - required this.id, - required this.imageHeight, - required this.imageWidth, - required this.person, - this.sourceType, - }); - - /// Bounding box X1 coordinate - int boundingBoxX1; - - /// Bounding box X2 coordinate - int boundingBoxX2; - - /// Bounding box Y1 coordinate - int boundingBoxY1; - - /// Bounding box Y2 coordinate - int boundingBoxY2; - - /// Face ID - String id; - - /// Image height in pixels - int imageHeight; - - /// Image width in pixels - int imageWidth; - - /// Person associated with face - PersonResponseDto? person; - - /// Face detection source type - /// - /// 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. - /// - SourceType? sourceType; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceResponseDto && - other.boundingBoxX1 == boundingBoxX1 && - other.boundingBoxX2 == boundingBoxX2 && - other.boundingBoxY1 == boundingBoxY1 && - other.boundingBoxY2 == boundingBoxY2 && - other.id == id && - other.imageHeight == imageHeight && - other.imageWidth == imageWidth && - other.person == person && - other.sourceType == sourceType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (boundingBoxX1.hashCode) + - (boundingBoxX2.hashCode) + - (boundingBoxY1.hashCode) + - (boundingBoxY2.hashCode) + - (id.hashCode) + - (imageHeight.hashCode) + - (imageWidth.hashCode) + - (person == null ? 0 : person!.hashCode) + - (sourceType == null ? 0 : sourceType!.hashCode); - - @override - String toString() => 'AssetFaceResponseDto[boundingBoxX1=$boundingBoxX1, boundingBoxX2=$boundingBoxX2, boundingBoxY1=$boundingBoxY1, boundingBoxY2=$boundingBoxY2, id=$id, imageHeight=$imageHeight, imageWidth=$imageWidth, person=$person, sourceType=$sourceType]'; - - Map toJson() { - final json = {}; - json[r'boundingBoxX1'] = this.boundingBoxX1; - json[r'boundingBoxX2'] = this.boundingBoxX2; - json[r'boundingBoxY1'] = this.boundingBoxY1; - json[r'boundingBoxY2'] = this.boundingBoxY2; - json[r'id'] = this.id; - json[r'imageHeight'] = this.imageHeight; - json[r'imageWidth'] = this.imageWidth; - if (this.person != null) { - json[r'person'] = this.person; - } else { - // json[r'person'] = null; - } - if (this.sourceType != null) { - json[r'sourceType'] = this.sourceType; - } else { - // json[r'sourceType'] = null; - } - return json; - } - - /// Returns a new [AssetFaceResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceResponseDto( - boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, - boundingBoxX2: mapValueOfType(json, r'boundingBoxX2')!, - boundingBoxY1: mapValueOfType(json, r'boundingBoxY1')!, - boundingBoxY2: mapValueOfType(json, r'boundingBoxY2')!, - id: mapValueOfType(json, r'id')!, - imageHeight: mapValueOfType(json, r'imageHeight')!, - imageWidth: mapValueOfType(json, r'imageWidth')!, - person: PersonResponseDto.fromJson(json[r'person']), - sourceType: SourceType.fromJson(json[r'sourceType']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'boundingBoxX1', - 'boundingBoxX2', - 'boundingBoxY1', - 'boundingBoxY2', - 'id', - 'imageHeight', - 'imageWidth', - 'person', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_update_dto.dart b/mobile/openapi/lib/model/asset_face_update_dto.dart deleted file mode 100644 index 1027627552..0000000000 --- a/mobile/openapi/lib/model/asset_face_update_dto.dart +++ /dev/null @@ -1,100 +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 AssetFaceUpdateDto { - /// Returns a new [AssetFaceUpdateDto] instance. - AssetFaceUpdateDto({ - this.data = const [], - }); - - /// Face update items - List data; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceUpdateDto && - _deepEquality.equals(other.data, data); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (data.hashCode); - - @override - String toString() => 'AssetFaceUpdateDto[data=$data]'; - - Map toJson() { - final json = {}; - json[r'data'] = this.data; - return json; - } - - /// Returns a new [AssetFaceUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceUpdateDto( - data: AssetFaceUpdateItem.listFromJson(json[r'data']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'data', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_update_item.dart b/mobile/openapi/lib/model/asset_face_update_item.dart deleted file mode 100644 index a81b21e139..0000000000 --- a/mobile/openapi/lib/model/asset_face_update_item.dart +++ /dev/null @@ -1,109 +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 AssetFaceUpdateItem { - /// Returns a new [AssetFaceUpdateItem] instance. - AssetFaceUpdateItem({ - required this.assetId, - required this.personId, - }); - - /// Asset ID - String assetId; - - /// Person ID - String personId; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceUpdateItem && - other.assetId == assetId && - other.personId == personId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (personId.hashCode); - - @override - String toString() => 'AssetFaceUpdateItem[assetId=$assetId, personId=$personId]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'personId'] = this.personId; - return json; - } - - /// Returns a new [AssetFaceUpdateItem] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceUpdateItem? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceUpdateItem"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceUpdateItem( - assetId: mapValueOfType(json, r'assetId')!, - personId: mapValueOfType(json, r'personId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceUpdateItem.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceUpdateItem.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceUpdateItem-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceUpdateItem.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'personId', - }; -} - diff --git a/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart b/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart deleted file mode 100644 index 1ae5cef07e..0000000000 --- a/mobile/openapi/lib/model/asset_face_without_person_response_dto.dart +++ /dev/null @@ -1,172 +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 AssetFaceWithoutPersonResponseDto { - /// Returns a new [AssetFaceWithoutPersonResponseDto] instance. - AssetFaceWithoutPersonResponseDto({ - required this.boundingBoxX1, - required this.boundingBoxX2, - required this.boundingBoxY1, - required this.boundingBoxY2, - required this.id, - required this.imageHeight, - required this.imageWidth, - this.sourceType, - }); - - /// Bounding box X1 coordinate - int boundingBoxX1; - - /// Bounding box X2 coordinate - int boundingBoxX2; - - /// Bounding box Y1 coordinate - int boundingBoxY1; - - /// Bounding box Y2 coordinate - int boundingBoxY2; - - /// Face ID - String id; - - /// Image height in pixels - int imageHeight; - - /// Image width in pixels - int imageWidth; - - /// Face detection source type - /// - /// 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. - /// - SourceType? sourceType; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFaceWithoutPersonResponseDto && - other.boundingBoxX1 == boundingBoxX1 && - other.boundingBoxX2 == boundingBoxX2 && - other.boundingBoxY1 == boundingBoxY1 && - other.boundingBoxY2 == boundingBoxY2 && - other.id == id && - other.imageHeight == imageHeight && - other.imageWidth == imageWidth && - other.sourceType == sourceType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (boundingBoxX1.hashCode) + - (boundingBoxX2.hashCode) + - (boundingBoxY1.hashCode) + - (boundingBoxY2.hashCode) + - (id.hashCode) + - (imageHeight.hashCode) + - (imageWidth.hashCode) + - (sourceType == null ? 0 : sourceType!.hashCode); - - @override - String toString() => 'AssetFaceWithoutPersonResponseDto[boundingBoxX1=$boundingBoxX1, boundingBoxX2=$boundingBoxX2, boundingBoxY1=$boundingBoxY1, boundingBoxY2=$boundingBoxY2, id=$id, imageHeight=$imageHeight, imageWidth=$imageWidth, sourceType=$sourceType]'; - - Map toJson() { - final json = {}; - json[r'boundingBoxX1'] = this.boundingBoxX1; - json[r'boundingBoxX2'] = this.boundingBoxX2; - json[r'boundingBoxY1'] = this.boundingBoxY1; - json[r'boundingBoxY2'] = this.boundingBoxY2; - json[r'id'] = this.id; - json[r'imageHeight'] = this.imageHeight; - json[r'imageWidth'] = this.imageWidth; - if (this.sourceType != null) { - json[r'sourceType'] = this.sourceType; - } else { - // json[r'sourceType'] = null; - } - return json; - } - - /// Returns a new [AssetFaceWithoutPersonResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFaceWithoutPersonResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFaceWithoutPersonResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFaceWithoutPersonResponseDto( - boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, - boundingBoxX2: mapValueOfType(json, r'boundingBoxX2')!, - boundingBoxY1: mapValueOfType(json, r'boundingBoxY1')!, - boundingBoxY2: mapValueOfType(json, r'boundingBoxY2')!, - id: mapValueOfType(json, r'id')!, - imageHeight: mapValueOfType(json, r'imageHeight')!, - imageWidth: mapValueOfType(json, r'imageWidth')!, - sourceType: SourceType.fromJson(json[r'sourceType']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFaceWithoutPersonResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFaceWithoutPersonResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFaceWithoutPersonResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFaceWithoutPersonResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'boundingBoxX1', - 'boundingBoxX2', - 'boundingBoxY1', - 'boundingBoxY2', - 'id', - 'imageHeight', - 'imageWidth', - }; -} - diff --git a/mobile/openapi/lib/model/asset_full_sync_dto.dart b/mobile/openapi/lib/model/asset_full_sync_dto.dart deleted file mode 100644 index 3fabb1cac6..0000000000 --- a/mobile/openapi/lib/model/asset_full_sync_dto.dart +++ /dev/null @@ -1,147 +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 AssetFullSyncDto { - /// Returns a new [AssetFullSyncDto] instance. - AssetFullSyncDto({ - this.lastId, - required this.limit, - required this.updatedUntil, - this.userId, - }); - - /// Last asset ID (pagination) - /// - /// 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? lastId; - - /// Maximum number of assets to return - /// - /// Minimum value: 1 - int limit; - - /// Sync assets updated until this date - DateTime updatedUntil; - - /// Filter by user ID - /// - /// 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? userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetFullSyncDto && - other.lastId == lastId && - other.limit == limit && - other.updatedUntil == updatedUntil && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (lastId == null ? 0 : lastId!.hashCode) + - (limit.hashCode) + - (updatedUntil.hashCode) + - (userId == null ? 0 : userId!.hashCode); - - @override - String toString() => 'AssetFullSyncDto[lastId=$lastId, limit=$limit, updatedUntil=$updatedUntil, userId=$userId]'; - - Map toJson() { - final json = {}; - if (this.lastId != null) { - json[r'lastId'] = this.lastId; - } else { - // json[r'lastId'] = null; - } - json[r'limit'] = this.limit; - json[r'updatedUntil'] = this.updatedUntil.toUtc().toIso8601String(); - if (this.userId != null) { - json[r'userId'] = this.userId; - } else { - // json[r'userId'] = null; - } - return json; - } - - /// Returns a new [AssetFullSyncDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetFullSyncDto? fromJson(dynamic value) { - upgradeDto(value, "AssetFullSyncDto"); - if (value is Map) { - final json = value.cast(); - - return AssetFullSyncDto( - lastId: mapValueOfType(json, r'lastId'), - limit: mapValueOfType(json, r'limit')!, - updatedUntil: mapDateTime(json, r'updatedUntil', r'')!, - userId: mapValueOfType(json, r'userId'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetFullSyncDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetFullSyncDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetFullSyncDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetFullSyncDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'limit', - 'updatedUntil', - }; -} - diff --git a/mobile/openapi/lib/model/asset_ids_dto.dart b/mobile/openapi/lib/model/asset_ids_dto.dart deleted file mode 100644 index 85e5cc3aee..0000000000 --- a/mobile/openapi/lib/model/asset_ids_dto.dart +++ /dev/null @@ -1,102 +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 AssetIdsDto { - /// Returns a new [AssetIdsDto] instance. - AssetIdsDto({ - this.assetIds = const [], - }); - - /// Asset IDs - List assetIds; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetIdsDto && - _deepEquality.equals(other.assetIds, assetIds); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode); - - @override - String toString() => 'AssetIdsDto[assetIds=$assetIds]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - return json; - } - - /// Returns a new [AssetIdsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetIdsDto? fromJson(dynamic value) { - upgradeDto(value, "AssetIdsDto"); - if (value is Map) { - final json = value.cast(); - - return AssetIdsDto( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetIdsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetIdsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetIdsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetIdsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetIds', - }; -} - diff --git a/mobile/openapi/lib/model/asset_ids_response_dto.dart b/mobile/openapi/lib/model/asset_ids_response_dto.dart deleted file mode 100644 index 9745283021..0000000000 --- a/mobile/openapi/lib/model/asset_ids_response_dto.dart +++ /dev/null @@ -1,198 +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 AssetIdsResponseDto { - /// Returns a new [AssetIdsResponseDto] instance. - AssetIdsResponseDto({ - required this.assetId, - this.error, - required this.success, - }); - - /// Asset ID - String assetId; - - /// Error reason if failed - AssetIdsResponseDtoErrorEnum? error; - - /// Whether operation succeeded - bool success; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetIdsResponseDto && - other.assetId == assetId && - other.error == error && - other.success == success; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (error == null ? 0 : error!.hashCode) + - (success.hashCode); - - @override - String toString() => 'AssetIdsResponseDto[assetId=$assetId, error=$error, success=$success]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - if (this.error != null) { - json[r'error'] = this.error; - } else { - // json[r'error'] = null; - } - json[r'success'] = this.success; - return json; - } - - /// Returns a new [AssetIdsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetIdsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetIdsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetIdsResponseDto( - assetId: mapValueOfType(json, r'assetId')!, - error: AssetIdsResponseDtoErrorEnum.fromJson(json[r'error']), - success: mapValueOfType(json, r'success')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetIdsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetIdsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetIdsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetIdsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'success', - }; -} - -/// Error reason if failed -class AssetIdsResponseDtoErrorEnum { - /// Instantiate a new enum with the provided [value]. - const AssetIdsResponseDtoErrorEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const duplicate = AssetIdsResponseDtoErrorEnum._(r'duplicate'); - static const noPermission = AssetIdsResponseDtoErrorEnum._(r'no_permission'); - static const notFound = AssetIdsResponseDtoErrorEnum._(r'not_found'); - - /// List of all possible values in this [enum][AssetIdsResponseDtoErrorEnum]. - static const values = [ - duplicate, - noPermission, - notFound, - ]; - - static AssetIdsResponseDtoErrorEnum? fromJson(dynamic value) => AssetIdsResponseDtoErrorEnumTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetIdsResponseDtoErrorEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetIdsResponseDtoErrorEnum] to String, -/// and [decode] dynamic data back to [AssetIdsResponseDtoErrorEnum]. -class AssetIdsResponseDtoErrorEnumTypeTransformer { - factory AssetIdsResponseDtoErrorEnumTypeTransformer() => _instance ??= const AssetIdsResponseDtoErrorEnumTypeTransformer._(); - - const AssetIdsResponseDtoErrorEnumTypeTransformer._(); - - String encode(AssetIdsResponseDtoErrorEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetIdsResponseDtoErrorEnum. - /// - /// 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. - AssetIdsResponseDtoErrorEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'duplicate': return AssetIdsResponseDtoErrorEnum.duplicate; - case r'no_permission': return AssetIdsResponseDtoErrorEnum.noPermission; - case r'not_found': return AssetIdsResponseDtoErrorEnum.notFound; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetIdsResponseDtoErrorEnumTypeTransformer] instance. - static AssetIdsResponseDtoErrorEnumTypeTransformer? _instance; -} - - diff --git a/mobile/openapi/lib/model/asset_job_name.dart b/mobile/openapi/lib/model/asset_job_name.dart deleted file mode 100644 index 7625677bb5..0000000000 --- a/mobile/openapi/lib/model/asset_job_name.dart +++ /dev/null @@ -1,91 +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; - -/// Job name -class AssetJobName { - /// Instantiate a new enum with the provided [value]. - const AssetJobName._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const refreshFaces = AssetJobName._(r'refresh-faces'); - static const refreshMetadata = AssetJobName._(r'refresh-metadata'); - static const regenerateThumbnail = AssetJobName._(r'regenerate-thumbnail'); - static const transcodeVideo = AssetJobName._(r'transcode-video'); - - /// List of all possible values in this [enum][AssetJobName]. - static const values = [ - refreshFaces, - refreshMetadata, - regenerateThumbnail, - transcodeVideo, - ]; - - static AssetJobName? fromJson(dynamic value) => AssetJobNameTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetJobName.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetJobName] to String, -/// and [decode] dynamic data back to [AssetJobName]. -class AssetJobNameTypeTransformer { - factory AssetJobNameTypeTransformer() => _instance ??= const AssetJobNameTypeTransformer._(); - - const AssetJobNameTypeTransformer._(); - - String encode(AssetJobName data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetJobName. - /// - /// 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. - AssetJobName? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'refresh-faces': return AssetJobName.refreshFaces; - case r'refresh-metadata': return AssetJobName.refreshMetadata; - case r'regenerate-thumbnail': return AssetJobName.regenerateThumbnail; - case r'transcode-video': return AssetJobName.transcodeVideo; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetJobNameTypeTransformer] instance. - static AssetJobNameTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_jobs_dto.dart b/mobile/openapi/lib/model/asset_jobs_dto.dart deleted file mode 100644 index 0aa5544a3a..0000000000 --- a/mobile/openapi/lib/model/asset_jobs_dto.dart +++ /dev/null @@ -1,111 +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 AssetJobsDto { - /// Returns a new [AssetJobsDto] instance. - AssetJobsDto({ - this.assetIds = const [], - required this.name, - }); - - /// Asset IDs - List assetIds; - - /// Job name - AssetJobName name; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetJobsDto && - _deepEquality.equals(other.assetIds, assetIds) && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode) + - (name.hashCode); - - @override - String toString() => 'AssetJobsDto[assetIds=$assetIds, name=$name]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - json[r'name'] = this.name; - return json; - } - - /// Returns a new [AssetJobsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetJobsDto? fromJson(dynamic value) { - upgradeDto(value, "AssetJobsDto"); - if (value is Map) { - final json = value.cast(); - - return AssetJobsDto( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - name: AssetJobName.fromJson(json[r'name'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetJobsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetJobsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetJobsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetJobsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetIds', - 'name', - }; -} - diff --git a/mobile/openapi/lib/model/asset_media_response_dto.dart b/mobile/openapi/lib/model/asset_media_response_dto.dart deleted file mode 100644 index 905e738b6e..0000000000 --- a/mobile/openapi/lib/model/asset_media_response_dto.dart +++ /dev/null @@ -1,109 +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 AssetMediaResponseDto { - /// Returns a new [AssetMediaResponseDto] instance. - AssetMediaResponseDto({ - required this.id, - required this.status, - }); - - /// Asset media ID - String id; - - /// Upload status - AssetMediaStatus status; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMediaResponseDto && - other.id == id && - other.status == status; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (id.hashCode) + - (status.hashCode); - - @override - String toString() => 'AssetMediaResponseDto[id=$id, status=$status]'; - - Map toJson() { - final json = {}; - json[r'id'] = this.id; - json[r'status'] = this.status; - return json; - } - - /// Returns a new [AssetMediaResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMediaResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMediaResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMediaResponseDto( - id: mapValueOfType(json, r'id')!, - status: AssetMediaStatus.fromJson(json[r'status'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMediaResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMediaResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMediaResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMediaResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'id', - 'status', - }; -} - diff --git a/mobile/openapi/lib/model/asset_media_size.dart b/mobile/openapi/lib/model/asset_media_size.dart deleted file mode 100644 index 087d19da1f..0000000000 --- a/mobile/openapi/lib/model/asset_media_size.dart +++ /dev/null @@ -1,91 +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 AssetMediaSize { - /// Instantiate a new enum with the provided [value]. - const AssetMediaSize._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const original = AssetMediaSize._(r'original'); - static const fullsize = AssetMediaSize._(r'fullsize'); - static const preview = AssetMediaSize._(r'preview'); - static const thumbnail = AssetMediaSize._(r'thumbnail'); - - /// List of all possible values in this [enum][AssetMediaSize]. - static const values = [ - original, - fullsize, - preview, - thumbnail, - ]; - - static AssetMediaSize? fromJson(dynamic value) => AssetMediaSizeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMediaSize.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetMediaSize] to String, -/// and [decode] dynamic data back to [AssetMediaSize]. -class AssetMediaSizeTypeTransformer { - factory AssetMediaSizeTypeTransformer() => _instance ??= const AssetMediaSizeTypeTransformer._(); - - const AssetMediaSizeTypeTransformer._(); - - String encode(AssetMediaSize data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetMediaSize. - /// - /// 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. - AssetMediaSize? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'original': return AssetMediaSize.original; - case r'fullsize': return AssetMediaSize.fullsize; - case r'preview': return AssetMediaSize.preview; - case r'thumbnail': return AssetMediaSize.thumbnail; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetMediaSizeTypeTransformer] instance. - static AssetMediaSizeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_media_status.dart b/mobile/openapi/lib/model/asset_media_status.dart deleted file mode 100644 index b45918e5c3..0000000000 --- a/mobile/openapi/lib/model/asset_media_status.dart +++ /dev/null @@ -1,88 +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; - -/// Upload status -class AssetMediaStatus { - /// Instantiate a new enum with the provided [value]. - const AssetMediaStatus._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const created = AssetMediaStatus._(r'created'); - static const replaced = AssetMediaStatus._(r'replaced'); - static const duplicate = AssetMediaStatus._(r'duplicate'); - - /// List of all possible values in this [enum][AssetMediaStatus]. - static const values = [ - created, - replaced, - duplicate, - ]; - - static AssetMediaStatus? fromJson(dynamic value) => AssetMediaStatusTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMediaStatus.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetMediaStatus] to String, -/// and [decode] dynamic data back to [AssetMediaStatus]. -class AssetMediaStatusTypeTransformer { - factory AssetMediaStatusTypeTransformer() => _instance ??= const AssetMediaStatusTypeTransformer._(); - - const AssetMediaStatusTypeTransformer._(); - - String encode(AssetMediaStatus data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetMediaStatus. - /// - /// 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. - AssetMediaStatus? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'created': return AssetMediaStatus.created; - case r'replaced': return AssetMediaStatus.replaced; - case r'duplicate': return AssetMediaStatus.duplicate; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetMediaStatusTypeTransformer] instance. - static AssetMediaStatusTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart deleted file mode 100644 index 6376ebc531..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_bulk_delete_dto.dart +++ /dev/null @@ -1,100 +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 AssetMetadataBulkDeleteDto { - /// Returns a new [AssetMetadataBulkDeleteDto] instance. - AssetMetadataBulkDeleteDto({ - this.items = const [], - }); - - /// Metadata items to delete - List items; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataBulkDeleteDto && - _deepEquality.equals(other.items, items); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (items.hashCode); - - @override - String toString() => 'AssetMetadataBulkDeleteDto[items=$items]'; - - Map toJson() { - final json = {}; - json[r'items'] = this.items; - return json; - } - - /// Returns a new [AssetMetadataBulkDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataBulkDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataBulkDeleteDto( - items: AssetMetadataBulkDeleteItemDto.listFromJson(json[r'items']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataBulkDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataBulkDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataBulkDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataBulkDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'items', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart deleted file mode 100644 index 90417b79e0..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_bulk_delete_item_dto.dart +++ /dev/null @@ -1,109 +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 AssetMetadataBulkDeleteItemDto { - /// Returns a new [AssetMetadataBulkDeleteItemDto] instance. - AssetMetadataBulkDeleteItemDto({ - required this.assetId, - required this.key, - }); - - /// Asset ID - String assetId; - - /// Metadata key - String key; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataBulkDeleteItemDto && - other.assetId == assetId && - other.key == key; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (key.hashCode); - - @override - String toString() => 'AssetMetadataBulkDeleteItemDto[assetId=$assetId, key=$key]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'key'] = this.key; - return json; - } - - /// Returns a new [AssetMetadataBulkDeleteItemDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataBulkDeleteItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkDeleteItemDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataBulkDeleteItemDto( - assetId: mapValueOfType(json, r'assetId')!, - key: mapValueOfType(json, r'key')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataBulkDeleteItemDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataBulkDeleteItemDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataBulkDeleteItemDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataBulkDeleteItemDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'key', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart deleted file mode 100644 index b79a693726..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_bulk_response_dto.dart +++ /dev/null @@ -1,127 +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 AssetMetadataBulkResponseDto { - /// Returns a new [AssetMetadataBulkResponseDto] instance. - AssetMetadataBulkResponseDto({ - required this.assetId, - required this.key, - required this.updatedAt, - required this.value, - }); - - /// Asset ID - String assetId; - - /// Metadata key - String key; - - /// Last update date - DateTime updatedAt; - - /// Metadata value (object) - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataBulkResponseDto && - other.assetId == assetId && - other.key == key && - other.updatedAt == updatedAt && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (key.hashCode) + - (updatedAt.hashCode) + - (value.hashCode); - - @override - String toString() => 'AssetMetadataBulkResponseDto[assetId=$assetId, key=$key, updatedAt=$updatedAt, value=$value]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'key'] = this.key; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - json[r'value'] = this.value; - return json; - } - - /// Returns a new [AssetMetadataBulkResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataBulkResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataBulkResponseDto( - assetId: mapValueOfType(json, r'assetId')!, - key: mapValueOfType(json, r'key')!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataBulkResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataBulkResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataBulkResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataBulkResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'key', - 'updatedAt', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart deleted file mode 100644 index a5e770b02a..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_dto.dart +++ /dev/null @@ -1,100 +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 AssetMetadataBulkUpsertDto { - /// Returns a new [AssetMetadataBulkUpsertDto] instance. - AssetMetadataBulkUpsertDto({ - this.items = const [], - }); - - /// Metadata items to upsert - List items; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataBulkUpsertDto && - _deepEquality.equals(other.items, items); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (items.hashCode); - - @override - String toString() => 'AssetMetadataBulkUpsertDto[items=$items]'; - - Map toJson() { - final json = {}; - json[r'items'] = this.items; - return json; - } - - /// Returns a new [AssetMetadataBulkUpsertDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataBulkUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkUpsertDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataBulkUpsertDto( - items: AssetMetadataBulkUpsertItemDto.listFromJson(json[r'items']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataBulkUpsertDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataBulkUpsertDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataBulkUpsertDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataBulkUpsertDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'items', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart deleted file mode 100644 index caaf379b30..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_bulk_upsert_item_dto.dart +++ /dev/null @@ -1,118 +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 AssetMetadataBulkUpsertItemDto { - /// Returns a new [AssetMetadataBulkUpsertItemDto] instance. - AssetMetadataBulkUpsertItemDto({ - required this.assetId, - required this.key, - required this.value, - }); - - /// Asset ID - String assetId; - - /// Metadata key - String key; - - /// Metadata value (object) - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataBulkUpsertItemDto && - other.assetId == assetId && - other.key == key && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (key.hashCode) + - (value.hashCode); - - @override - String toString() => 'AssetMetadataBulkUpsertItemDto[assetId=$assetId, key=$key, value=$value]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'key'] = this.key; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [AssetMetadataBulkUpsertItemDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataBulkUpsertItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataBulkUpsertItemDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataBulkUpsertItemDto( - assetId: mapValueOfType(json, r'assetId')!, - key: mapValueOfType(json, r'key')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataBulkUpsertItemDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataBulkUpsertItemDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataBulkUpsertItemDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataBulkUpsertItemDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'key', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_response_dto.dart b/mobile/openapi/lib/model/asset_metadata_response_dto.dart deleted file mode 100644 index 2c3faab178..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_response_dto.dart +++ /dev/null @@ -1,118 +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 AssetMetadataResponseDto { - /// Returns a new [AssetMetadataResponseDto] instance. - AssetMetadataResponseDto({ - required this.key, - required this.updatedAt, - required this.value, - }); - - /// Metadata key - String key; - - /// Last update date - DateTime updatedAt; - - /// Metadata value (object) - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataResponseDto && - other.key == key && - other.updatedAt == updatedAt && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (key.hashCode) + - (updatedAt.hashCode) + - (value.hashCode); - - @override - String toString() => 'AssetMetadataResponseDto[key=$key, updatedAt=$updatedAt, value=$value]'; - - Map toJson() { - final json = {}; - json[r'key'] = this.key; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - json[r'value'] = this.value; - return json; - } - - /// Returns a new [AssetMetadataResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataResponseDto( - key: mapValueOfType(json, r'key')!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'key', - 'updatedAt', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart b/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart deleted file mode 100644 index b1473d4826..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_upsert_dto.dart +++ /dev/null @@ -1,100 +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 AssetMetadataUpsertDto { - /// Returns a new [AssetMetadataUpsertDto] instance. - AssetMetadataUpsertDto({ - this.items = const [], - }); - - /// Metadata items to upsert - List items; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataUpsertDto && - _deepEquality.equals(other.items, items); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (items.hashCode); - - @override - String toString() => 'AssetMetadataUpsertDto[items=$items]'; - - Map toJson() { - final json = {}; - json[r'items'] = this.items; - return json; - } - - /// Returns a new [AssetMetadataUpsertDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataUpsertDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataUpsertDto( - items: AssetMetadataUpsertItemDto.listFromJson(json[r'items']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataUpsertDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataUpsertDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataUpsertDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataUpsertDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'items', - }; -} - diff --git a/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart b/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart deleted file mode 100644 index 8a6bcb9b01..0000000000 --- a/mobile/openapi/lib/model/asset_metadata_upsert_item_dto.dart +++ /dev/null @@ -1,109 +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 AssetMetadataUpsertItemDto { - /// Returns a new [AssetMetadataUpsertItemDto] instance. - AssetMetadataUpsertItemDto({ - required this.key, - required this.value, - }); - - /// Metadata key - String key; - - /// Metadata value (object) - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetMetadataUpsertItemDto && - other.key == key && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (key.hashCode) + - (value.hashCode); - - @override - String toString() => 'AssetMetadataUpsertItemDto[key=$key, value=$value]'; - - Map toJson() { - final json = {}; - json[r'key'] = this.key; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [AssetMetadataUpsertItemDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetMetadataUpsertItemDto? fromJson(dynamic value) { - upgradeDto(value, "AssetMetadataUpsertItemDto"); - if (value is Map) { - final json = value.cast(); - - return AssetMetadataUpsertItemDto( - key: mapValueOfType(json, r'key')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetMetadataUpsertItemDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetMetadataUpsertItemDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetMetadataUpsertItemDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetMetadataUpsertItemDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'key', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/asset_ocr_response_dto.dart b/mobile/openapi/lib/model/asset_ocr_response_dto.dart deleted file mode 100644 index c7937c6eb2..0000000000 --- a/mobile/openapi/lib/model/asset_ocr_response_dto.dart +++ /dev/null @@ -1,206 +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 AssetOcrResponseDto { - /// Returns a new [AssetOcrResponseDto] instance. - AssetOcrResponseDto({ - required this.assetId, - required this.boxScore, - required this.id, - required this.text, - required this.textScore, - required this.x1, - required this.x2, - required this.x3, - required this.x4, - required this.y1, - required this.y2, - required this.y3, - required this.y4, - }); - - String assetId; - - /// Confidence score for text detection box - double boxScore; - - String id; - - /// Recognized text - String text; - - /// Confidence score for text recognition - double textScore; - - /// Normalized x coordinate of box corner 1 (0-1) - double x1; - - /// Normalized x coordinate of box corner 2 (0-1) - double x2; - - /// Normalized x coordinate of box corner 3 (0-1) - double x3; - - /// Normalized x coordinate of box corner 4 (0-1) - double x4; - - /// Normalized y coordinate of box corner 1 (0-1) - double y1; - - /// Normalized y coordinate of box corner 2 (0-1) - double y2; - - /// Normalized y coordinate of box corner 3 (0-1) - double y3; - - /// Normalized y coordinate of box corner 4 (0-1) - double y4; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetOcrResponseDto && - other.assetId == assetId && - other.boxScore == boxScore && - other.id == id && - other.text == text && - other.textScore == textScore && - other.x1 == x1 && - other.x2 == x2 && - other.x3 == x3 && - other.x4 == x4 && - other.y1 == y1 && - other.y2 == y2 && - other.y3 == y3 && - other.y4 == y4; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (boxScore.hashCode) + - (id.hashCode) + - (text.hashCode) + - (textScore.hashCode) + - (x1.hashCode) + - (x2.hashCode) + - (x3.hashCode) + - (x4.hashCode) + - (y1.hashCode) + - (y2.hashCode) + - (y3.hashCode) + - (y4.hashCode); - - @override - String toString() => 'AssetOcrResponseDto[assetId=$assetId, boxScore=$boxScore, id=$id, text=$text, textScore=$textScore, x1=$x1, x2=$x2, x3=$x3, x4=$x4, y1=$y1, y2=$y2, y3=$y3, y4=$y4]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'boxScore'] = this.boxScore; - json[r'id'] = this.id; - json[r'text'] = this.text; - json[r'textScore'] = this.textScore; - json[r'x1'] = this.x1; - json[r'x2'] = this.x2; - json[r'x3'] = this.x3; - json[r'x4'] = this.x4; - json[r'y1'] = this.y1; - json[r'y2'] = this.y2; - json[r'y3'] = this.y3; - json[r'y4'] = this.y4; - return json; - } - - /// Returns a new [AssetOcrResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetOcrResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetOcrResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetOcrResponseDto( - assetId: mapValueOfType(json, r'assetId')!, - boxScore: (mapValueOfType(json, r'boxScore')!).toDouble(), - id: mapValueOfType(json, r'id')!, - text: mapValueOfType(json, r'text')!, - textScore: (mapValueOfType(json, r'textScore')!).toDouble(), - x1: (mapValueOfType(json, r'x1')!).toDouble(), - x2: (mapValueOfType(json, r'x2')!).toDouble(), - x3: (mapValueOfType(json, r'x3')!).toDouble(), - x4: (mapValueOfType(json, r'x4')!).toDouble(), - y1: (mapValueOfType(json, r'y1')!).toDouble(), - y2: (mapValueOfType(json, r'y2')!).toDouble(), - y3: (mapValueOfType(json, r'y3')!).toDouble(), - y4: (mapValueOfType(json, r'y4')!).toDouble(), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetOcrResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetOcrResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetOcrResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetOcrResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'boxScore', - 'id', - 'text', - 'textScore', - 'x1', - 'x2', - 'x3', - 'x4', - 'y1', - 'y2', - 'y3', - 'y4', - }; -} - diff --git a/mobile/openapi/lib/model/asset_order.dart b/mobile/openapi/lib/model/asset_order.dart deleted file mode 100644 index 21edd95ff6..0000000000 --- a/mobile/openapi/lib/model/asset_order.dart +++ /dev/null @@ -1,85 +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; - -/// Asset sort order -class AssetOrder { - /// Instantiate a new enum with the provided [value]. - const AssetOrder._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const asc = AssetOrder._(r'asc'); - static const desc = AssetOrder._(r'desc'); - - /// List of all possible values in this [enum][AssetOrder]. - static const values = [ - asc, - desc, - ]; - - static AssetOrder? fromJson(dynamic value) => AssetOrderTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetOrder.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetOrder] to String, -/// and [decode] dynamic data back to [AssetOrder]. -class AssetOrderTypeTransformer { - factory AssetOrderTypeTransformer() => _instance ??= const AssetOrderTypeTransformer._(); - - const AssetOrderTypeTransformer._(); - - String encode(AssetOrder data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetOrder. - /// - /// 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. - AssetOrder? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'asc': return AssetOrder.asc; - case r'desc': return AssetOrder.desc; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetOrderTypeTransformer] instance. - static AssetOrderTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart deleted file mode 100644 index 5422ccf55f..0000000000 --- a/mobile/openapi/lib/model/asset_response_dto.dart +++ /dev/null @@ -1,461 +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 AssetResponseDto { - /// Returns a new [AssetResponseDto] instance. - AssetResponseDto({ - required this.checksum, - required this.createdAt, - required this.deviceAssetId, - required this.deviceId, - this.duplicateId, - required this.duration, - this.exifInfo, - required this.fileCreatedAt, - required this.fileModifiedAt, - required this.hasMetadata, - required this.height, - required this.id, - required this.isArchived, - required this.isEdited, - required this.isFavorite, - required this.isOffline, - required this.isTrashed, - this.libraryId, - this.livePhotoVideoId, - required this.localDateTime, - required this.originalFileName, - this.originalMimeType, - required this.originalPath, - this.owner, - required this.ownerId, - this.people = const [], - this.resized, - this.stack, - this.tags = const [], - required this.thumbhash, - required this.type, - this.unassignedFaces = const [], - required this.updatedAt, - required this.visibility, - required this.width, - }); - - /// Base64 encoded SHA1 hash - String checksum; - - /// The UTC timestamp when the asset was originally uploaded to Immich. - DateTime createdAt; - - /// Device asset ID - String deviceAssetId; - - /// Device ID - String deviceId; - - /// Duplicate group ID - String? duplicateId; - - /// Video duration (for videos) - String duration; - - /// - /// 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. - /// - ExifResponseDto? exifInfo; - - /// The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken. - DateTime fileCreatedAt; - - /// The UTC timestamp when the file was last modified on the filesystem. This reflects the last time the physical file was changed, which may be different from when the photo was originally taken. - DateTime fileModifiedAt; - - /// Whether asset has metadata - bool hasMetadata; - - /// Asset height - num? height; - - /// Asset ID - String id; - - /// Is archived - bool isArchived; - - /// Is edited - bool isEdited; - - /// Is favorite - bool isFavorite; - - /// Is offline - bool isOffline; - - /// Is trashed - bool isTrashed; - - /// Library ID - String? libraryId; - - /// Live photo video ID - String? livePhotoVideoId; - - /// The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months. - DateTime localDateTime; - - /// Original file name - String originalFileName; - - /// Original MIME type - /// - /// 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? originalMimeType; - - /// Original file path - String originalPath; - - /// - /// 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. - /// - UserResponseDto? owner; - - /// Owner user ID - String ownerId; - - List people; - - /// Is resized - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? resized; - - AssetStackResponseDto? stack; - - List tags; - - /// Thumbhash for thumbnail generation - String? thumbhash; - - /// Asset type - AssetTypeEnum type; - - List unassignedFaces; - - /// The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified. - DateTime updatedAt; - - /// Asset visibility - AssetVisibility visibility; - - /// Asset width - num? width; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto && - other.checksum == checksum && - other.createdAt == createdAt && - other.deviceAssetId == deviceAssetId && - other.deviceId == deviceId && - other.duplicateId == duplicateId && - other.duration == duration && - other.exifInfo == exifInfo && - other.fileCreatedAt == fileCreatedAt && - other.fileModifiedAt == fileModifiedAt && - other.hasMetadata == hasMetadata && - other.height == height && - other.id == id && - other.isArchived == isArchived && - other.isEdited == isEdited && - other.isFavorite == isFavorite && - other.isOffline == isOffline && - other.isTrashed == isTrashed && - other.libraryId == libraryId && - other.livePhotoVideoId == livePhotoVideoId && - other.localDateTime == localDateTime && - other.originalFileName == originalFileName && - other.originalMimeType == originalMimeType && - other.originalPath == originalPath && - other.owner == owner && - other.ownerId == ownerId && - _deepEquality.equals(other.people, people) && - other.resized == resized && - other.stack == stack && - _deepEquality.equals(other.tags, tags) && - other.thumbhash == thumbhash && - other.type == type && - _deepEquality.equals(other.unassignedFaces, unassignedFaces) && - other.updatedAt == updatedAt && - other.visibility == visibility && - other.width == width; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (checksum.hashCode) + - (createdAt.hashCode) + - (deviceAssetId.hashCode) + - (deviceId.hashCode) + - (duplicateId == null ? 0 : duplicateId!.hashCode) + - (duration.hashCode) + - (exifInfo == null ? 0 : exifInfo!.hashCode) + - (fileCreatedAt.hashCode) + - (fileModifiedAt.hashCode) + - (hasMetadata.hashCode) + - (height == null ? 0 : height!.hashCode) + - (id.hashCode) + - (isArchived.hashCode) + - (isEdited.hashCode) + - (isFavorite.hashCode) + - (isOffline.hashCode) + - (isTrashed.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + - (localDateTime.hashCode) + - (originalFileName.hashCode) + - (originalMimeType == null ? 0 : originalMimeType!.hashCode) + - (originalPath.hashCode) + - (owner == null ? 0 : owner!.hashCode) + - (ownerId.hashCode) + - (people.hashCode) + - (resized == null ? 0 : resized!.hashCode) + - (stack == null ? 0 : stack!.hashCode) + - (tags.hashCode) + - (thumbhash == null ? 0 : thumbhash!.hashCode) + - (type.hashCode) + - (unassignedFaces.hashCode) + - (updatedAt.hashCode) + - (visibility.hashCode) + - (width == null ? 0 : width!.hashCode); - - @override - String toString() => 'AssetResponseDto[checksum=$checksum, createdAt=$createdAt, deviceAssetId=$deviceAssetId, deviceId=$deviceId, duplicateId=$duplicateId, duration=$duration, exifInfo=$exifInfo, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, hasMetadata=$hasMetadata, height=$height, id=$id, isArchived=$isArchived, isEdited=$isEdited, isFavorite=$isFavorite, isOffline=$isOffline, isTrashed=$isTrashed, libraryId=$libraryId, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, originalFileName=$originalFileName, originalMimeType=$originalMimeType, originalPath=$originalPath, owner=$owner, ownerId=$ownerId, people=$people, resized=$resized, stack=$stack, tags=$tags, thumbhash=$thumbhash, type=$type, unassignedFaces=$unassignedFaces, updatedAt=$updatedAt, visibility=$visibility, width=$width]'; - - Map toJson() { - final json = {}; - json[r'checksum'] = this.checksum; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'deviceAssetId'] = this.deviceAssetId; - json[r'deviceId'] = this.deviceId; - if (this.duplicateId != null) { - json[r'duplicateId'] = this.duplicateId; - } else { - // json[r'duplicateId'] = null; - } - json[r'duration'] = this.duration; - if (this.exifInfo != null) { - json[r'exifInfo'] = this.exifInfo; - } else { - // json[r'exifInfo'] = null; - } - json[r'fileCreatedAt'] = this.fileCreatedAt.toUtc().toIso8601String(); - json[r'fileModifiedAt'] = this.fileModifiedAt.toUtc().toIso8601String(); - json[r'hasMetadata'] = this.hasMetadata; - if (this.height != null) { - json[r'height'] = this.height; - } else { - // json[r'height'] = null; - } - json[r'id'] = this.id; - json[r'isArchived'] = this.isArchived; - json[r'isEdited'] = this.isEdited; - json[r'isFavorite'] = this.isFavorite; - json[r'isOffline'] = this.isOffline; - json[r'isTrashed'] = this.isTrashed; - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.livePhotoVideoId != null) { - json[r'livePhotoVideoId'] = this.livePhotoVideoId; - } else { - // json[r'livePhotoVideoId'] = null; - } - json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String(); - json[r'originalFileName'] = this.originalFileName; - if (this.originalMimeType != null) { - json[r'originalMimeType'] = this.originalMimeType; - } else { - // json[r'originalMimeType'] = null; - } - json[r'originalPath'] = this.originalPath; - if (this.owner != null) { - json[r'owner'] = this.owner; - } else { - // json[r'owner'] = null; - } - json[r'ownerId'] = this.ownerId; - json[r'people'] = this.people; - if (this.resized != null) { - json[r'resized'] = this.resized; - } else { - // json[r'resized'] = null; - } - if (this.stack != null) { - json[r'stack'] = this.stack; - } else { - // json[r'stack'] = null; - } - json[r'tags'] = this.tags; - if (this.thumbhash != null) { - json[r'thumbhash'] = this.thumbhash; - } else { - // json[r'thumbhash'] = null; - } - json[r'type'] = this.type; - json[r'unassignedFaces'] = this.unassignedFaces; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - json[r'visibility'] = this.visibility; - if (this.width != null) { - json[r'width'] = this.width; - } else { - // json[r'width'] = null; - } - return json; - } - - /// Returns a new [AssetResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetResponseDto( - checksum: mapValueOfType(json, r'checksum')!, - createdAt: mapDateTime(json, r'createdAt', r'')!, - deviceAssetId: mapValueOfType(json, r'deviceAssetId')!, - deviceId: mapValueOfType(json, r'deviceId')!, - duplicateId: mapValueOfType(json, r'duplicateId'), - duration: mapValueOfType(json, r'duration')!, - exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']), - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, - hasMetadata: mapValueOfType(json, r'hasMetadata')!, - height: json[r'height'] == null - ? null - : num.parse('${json[r'height']}'), - id: mapValueOfType(json, r'id')!, - isArchived: mapValueOfType(json, r'isArchived')!, - isEdited: mapValueOfType(json, r'isEdited')!, - isFavorite: mapValueOfType(json, r'isFavorite')!, - isOffline: mapValueOfType(json, r'isOffline')!, - isTrashed: mapValueOfType(json, r'isTrashed')!, - libraryId: mapValueOfType(json, r'libraryId'), - livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), - localDateTime: mapDateTime(json, r'localDateTime', r'')!, - originalFileName: mapValueOfType(json, r'originalFileName')!, - originalMimeType: mapValueOfType(json, r'originalMimeType'), - originalPath: mapValueOfType(json, r'originalPath')!, - owner: UserResponseDto.fromJson(json[r'owner']), - ownerId: mapValueOfType(json, r'ownerId')!, - people: PersonWithFacesResponseDto.listFromJson(json[r'people']), - resized: mapValueOfType(json, r'resized'), - stack: AssetStackResponseDto.fromJson(json[r'stack']), - tags: TagResponseDto.listFromJson(json[r'tags']), - thumbhash: mapValueOfType(json, r'thumbhash'), - type: AssetTypeEnum.fromJson(json[r'type'])!, - unassignedFaces: AssetFaceWithoutPersonResponseDto.listFromJson(json[r'unassignedFaces']), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - visibility: AssetVisibility.fromJson(json[r'visibility'])!, - width: json[r'width'] == null - ? null - : num.parse('${json[r'width']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'checksum', - 'createdAt', - 'deviceAssetId', - 'deviceId', - 'duration', - 'fileCreatedAt', - 'fileModifiedAt', - 'hasMetadata', - 'height', - 'id', - 'isArchived', - 'isEdited', - 'isFavorite', - 'isOffline', - 'isTrashed', - 'localDateTime', - 'originalFileName', - 'originalPath', - 'ownerId', - 'thumbhash', - 'type', - 'updatedAt', - 'visibility', - 'width', - }; -} - diff --git a/mobile/openapi/lib/model/asset_stack_response_dto.dart b/mobile/openapi/lib/model/asset_stack_response_dto.dart deleted file mode 100644 index 229e7aa710..0000000000 --- a/mobile/openapi/lib/model/asset_stack_response_dto.dart +++ /dev/null @@ -1,118 +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 AssetStackResponseDto { - /// Returns a new [AssetStackResponseDto] instance. - AssetStackResponseDto({ - required this.assetCount, - required this.id, - required this.primaryAssetId, - }); - - /// Number of assets in stack - int assetCount; - - /// Stack ID - String id; - - /// Primary asset ID - String primaryAssetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetStackResponseDto && - other.assetCount == assetCount && - other.id == id && - other.primaryAssetId == primaryAssetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetCount.hashCode) + - (id.hashCode) + - (primaryAssetId.hashCode); - - @override - String toString() => 'AssetStackResponseDto[assetCount=$assetCount, id=$id, primaryAssetId=$primaryAssetId]'; - - Map toJson() { - final json = {}; - json[r'assetCount'] = this.assetCount; - json[r'id'] = this.id; - json[r'primaryAssetId'] = this.primaryAssetId; - return json; - } - - /// Returns a new [AssetStackResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetStackResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetStackResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetStackResponseDto( - assetCount: mapValueOfType(json, r'assetCount')!, - id: mapValueOfType(json, r'id')!, - primaryAssetId: mapValueOfType(json, r'primaryAssetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetStackResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetStackResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetStackResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetStackResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetCount', - 'id', - 'primaryAssetId', - }; -} - diff --git a/mobile/openapi/lib/model/asset_stats_response_dto.dart b/mobile/openapi/lib/model/asset_stats_response_dto.dart deleted file mode 100644 index 201550c87f..0000000000 --- a/mobile/openapi/lib/model/asset_stats_response_dto.dart +++ /dev/null @@ -1,118 +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 AssetStatsResponseDto { - /// Returns a new [AssetStatsResponseDto] instance. - AssetStatsResponseDto({ - required this.images, - required this.total, - required this.videos, - }); - - /// Number of images - int images; - - /// Total number of assets - int total; - - /// Number of videos - int videos; - - @override - bool operator ==(Object other) => identical(this, other) || other is AssetStatsResponseDto && - other.images == images && - other.total == total && - other.videos == videos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (images.hashCode) + - (total.hashCode) + - (videos.hashCode); - - @override - String toString() => 'AssetStatsResponseDto[images=$images, total=$total, videos=$videos]'; - - Map toJson() { - final json = {}; - json[r'images'] = this.images; - json[r'total'] = this.total; - json[r'videos'] = this.videos; - return json; - } - - /// Returns a new [AssetStatsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AssetStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AssetStatsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AssetStatsResponseDto( - images: mapValueOfType(json, r'images')!, - total: mapValueOfType(json, r'total')!, - videos: mapValueOfType(json, r'videos')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetStatsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AssetStatsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AssetStatsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AssetStatsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'images', - 'total', - 'videos', - }; -} - diff --git a/mobile/openapi/lib/model/asset_type_enum.dart b/mobile/openapi/lib/model/asset_type_enum.dart deleted file mode 100644 index b6e0351198..0000000000 --- a/mobile/openapi/lib/model/asset_type_enum.dart +++ /dev/null @@ -1,91 +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; - -/// Asset type -class AssetTypeEnum { - /// Instantiate a new enum with the provided [value]. - const AssetTypeEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const IMAGE = AssetTypeEnum._(r'IMAGE'); - static const VIDEO = AssetTypeEnum._(r'VIDEO'); - static const AUDIO = AssetTypeEnum._(r'AUDIO'); - static const OTHER = AssetTypeEnum._(r'OTHER'); - - /// List of all possible values in this [enum][AssetTypeEnum]. - static const values = [ - IMAGE, - VIDEO, - AUDIO, - OTHER, - ]; - - static AssetTypeEnum? fromJson(dynamic value) => AssetTypeEnumTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetTypeEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetTypeEnum] to String, -/// and [decode] dynamic data back to [AssetTypeEnum]. -class AssetTypeEnumTypeTransformer { - factory AssetTypeEnumTypeTransformer() => _instance ??= const AssetTypeEnumTypeTransformer._(); - - const AssetTypeEnumTypeTransformer._(); - - String encode(AssetTypeEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetTypeEnum. - /// - /// 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. - AssetTypeEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'IMAGE': return AssetTypeEnum.IMAGE; - case r'VIDEO': return AssetTypeEnum.VIDEO; - case r'AUDIO': return AssetTypeEnum.AUDIO; - case r'OTHER': return AssetTypeEnum.OTHER; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetTypeEnumTypeTransformer] instance. - static AssetTypeEnumTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/asset_visibility.dart b/mobile/openapi/lib/model/asset_visibility.dart deleted file mode 100644 index 6290dffb2e..0000000000 --- a/mobile/openapi/lib/model/asset_visibility.dart +++ /dev/null @@ -1,91 +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; - -/// Asset visibility -class AssetVisibility { - /// Instantiate a new enum with the provided [value]. - const AssetVisibility._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const archive = AssetVisibility._(r'archive'); - static const timeline = AssetVisibility._(r'timeline'); - static const hidden = AssetVisibility._(r'hidden'); - static const locked = AssetVisibility._(r'locked'); - - /// List of all possible values in this [enum][AssetVisibility]. - static const values = [ - archive, - timeline, - hidden, - locked, - ]; - - static AssetVisibility? fromJson(dynamic value) => AssetVisibilityTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AssetVisibility.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AssetVisibility] to String, -/// and [decode] dynamic data back to [AssetVisibility]. -class AssetVisibilityTypeTransformer { - factory AssetVisibilityTypeTransformer() => _instance ??= const AssetVisibilityTypeTransformer._(); - - const AssetVisibilityTypeTransformer._(); - - String encode(AssetVisibility data) => data.value; - - /// Decodes a [dynamic value][data] to a AssetVisibility. - /// - /// 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. - AssetVisibility? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'archive': return AssetVisibility.archive; - case r'timeline': return AssetVisibility.timeline; - case r'hidden': return AssetVisibility.hidden; - case r'locked': return AssetVisibility.locked; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AssetVisibilityTypeTransformer] instance. - static AssetVisibilityTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/audio_codec.dart b/mobile/openapi/lib/model/audio_codec.dart deleted file mode 100644 index 095c616995..0000000000 --- a/mobile/openapi/lib/model/audio_codec.dart +++ /dev/null @@ -1,91 +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; - -/// Target audio codec -class AudioCodec { - /// Instantiate a new enum with the provided [value]. - const AudioCodec._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const mp3 = AudioCodec._(r'mp3'); - static const aac = AudioCodec._(r'aac'); - static const libopus = AudioCodec._(r'libopus'); - static const pcmS16le = AudioCodec._(r'pcm_s16le'); - - /// List of all possible values in this [enum][AudioCodec]. - static const values = [ - mp3, - aac, - libopus, - pcmS16le, - ]; - - static AudioCodec? fromJson(dynamic value) => AudioCodecTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AudioCodec.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [AudioCodec] to String, -/// and [decode] dynamic data back to [AudioCodec]. -class AudioCodecTypeTransformer { - factory AudioCodecTypeTransformer() => _instance ??= const AudioCodecTypeTransformer._(); - - const AudioCodecTypeTransformer._(); - - String encode(AudioCodec data) => data.value; - - /// Decodes a [dynamic value][data] to a AudioCodec. - /// - /// 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. - AudioCodec? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'mp3': return AudioCodec.mp3; - case r'aac': return AudioCodec.aac; - case r'libopus': return AudioCodec.libopus; - case r'pcm_s16le': return AudioCodec.pcmS16le; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [AudioCodecTypeTransformer] instance. - static AudioCodecTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/auth_status_response_dto.dart b/mobile/openapi/lib/model/auth_status_response_dto.dart deleted file mode 100644 index 23b9d40525..0000000000 --- a/mobile/openapi/lib/model/auth_status_response_dto.dart +++ /dev/null @@ -1,154 +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 AuthStatusResponseDto { - /// Returns a new [AuthStatusResponseDto] instance. - AuthStatusResponseDto({ - this.expiresAt, - required this.isElevated, - required this.password, - required this.pinCode, - this.pinExpiresAt, - }); - - /// Session expiration date - /// - /// 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? expiresAt; - - /// Is elevated session - bool isElevated; - - /// Has password set - bool password; - - /// Has PIN code set - bool pinCode; - - /// PIN expiration date - /// - /// 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? pinExpiresAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is AuthStatusResponseDto && - other.expiresAt == expiresAt && - other.isElevated == isElevated && - other.password == password && - other.pinCode == pinCode && - other.pinExpiresAt == pinExpiresAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (expiresAt == null ? 0 : expiresAt!.hashCode) + - (isElevated.hashCode) + - (password.hashCode) + - (pinCode.hashCode) + - (pinExpiresAt == null ? 0 : pinExpiresAt!.hashCode); - - @override - String toString() => 'AuthStatusResponseDto[expiresAt=$expiresAt, isElevated=$isElevated, password=$password, pinCode=$pinCode, pinExpiresAt=$pinExpiresAt]'; - - Map toJson() { - final json = {}; - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt; - } else { - // json[r'expiresAt'] = null; - } - json[r'isElevated'] = this.isElevated; - json[r'password'] = this.password; - json[r'pinCode'] = this.pinCode; - if (this.pinExpiresAt != null) { - json[r'pinExpiresAt'] = this.pinExpiresAt; - } else { - // json[r'pinExpiresAt'] = null; - } - return json; - } - - /// Returns a new [AuthStatusResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AuthStatusResponseDto? fromJson(dynamic value) { - upgradeDto(value, "AuthStatusResponseDto"); - if (value is Map) { - final json = value.cast(); - - return AuthStatusResponseDto( - expiresAt: mapValueOfType(json, r'expiresAt'), - isElevated: mapValueOfType(json, r'isElevated')!, - password: mapValueOfType(json, r'password')!, - pinCode: mapValueOfType(json, r'pinCode')!, - pinExpiresAt: mapValueOfType(json, r'pinExpiresAt'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AuthStatusResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AuthStatusResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AuthStatusResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AuthStatusResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'isElevated', - 'password', - 'pinCode', - }; -} - diff --git a/mobile/openapi/lib/model/avatar_update.dart b/mobile/openapi/lib/model/avatar_update.dart deleted file mode 100644 index a817832dab..0000000000 --- a/mobile/openapi/lib/model/avatar_update.dart +++ /dev/null @@ -1,109 +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 AvatarUpdate { - /// Returns a new [AvatarUpdate] instance. - AvatarUpdate({ - this.color, - }); - - /// Avatar color - /// - /// 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. - /// - UserAvatarColor? color; - - @override - bool operator ==(Object other) => identical(this, other) || other is AvatarUpdate && - other.color == color; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (color == null ? 0 : color!.hashCode); - - @override - String toString() => 'AvatarUpdate[color=$color]'; - - Map toJson() { - final json = {}; - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - return json; - } - - /// Returns a new [AvatarUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static AvatarUpdate? fromJson(dynamic value) { - upgradeDto(value, "AvatarUpdate"); - if (value is Map) { - final json = value.cast(); - - return AvatarUpdate( - color: UserAvatarColor.fromJson(json[r'color']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = AvatarUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = AvatarUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of AvatarUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = AvatarUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/bulk_id_error_reason.dart b/mobile/openapi/lib/model/bulk_id_error_reason.dart deleted file mode 100644 index ea56e9dbba..0000000000 --- a/mobile/openapi/lib/model/bulk_id_error_reason.dart +++ /dev/null @@ -1,91 +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; - -/// Error reason -class BulkIdErrorReason { - /// Instantiate a new enum with the provided [value]. - const BulkIdErrorReason._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const duplicate = BulkIdErrorReason._(r'duplicate'); - static const noPermission = BulkIdErrorReason._(r'no_permission'); - static const notFound = BulkIdErrorReason._(r'not_found'); - static const unknown = BulkIdErrorReason._(r'unknown'); - - /// List of all possible values in this [enum][BulkIdErrorReason]. - static const values = [ - duplicate, - noPermission, - notFound, - unknown, - ]; - - static BulkIdErrorReason? fromJson(dynamic value) => BulkIdErrorReasonTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = BulkIdErrorReason.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [BulkIdErrorReason] to String, -/// and [decode] dynamic data back to [BulkIdErrorReason]. -class BulkIdErrorReasonTypeTransformer { - factory BulkIdErrorReasonTypeTransformer() => _instance ??= const BulkIdErrorReasonTypeTransformer._(); - - const BulkIdErrorReasonTypeTransformer._(); - - String encode(BulkIdErrorReason data) => data.value; - - /// Decodes a [dynamic value][data] to a BulkIdErrorReason. - /// - /// 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. - BulkIdErrorReason? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'duplicate': return BulkIdErrorReason.duplicate; - case r'no_permission': return BulkIdErrorReason.noPermission; - case r'not_found': return BulkIdErrorReason.notFound; - case r'unknown': return BulkIdErrorReason.unknown; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [BulkIdErrorReasonTypeTransformer] instance. - static BulkIdErrorReasonTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/bulk_id_response_dto.dart b/mobile/openapi/lib/model/bulk_id_response_dto.dart deleted file mode 100644 index cd122785dd..0000000000 --- a/mobile/openapi/lib/model/bulk_id_response_dto.dart +++ /dev/null @@ -1,201 +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 BulkIdResponseDto { - /// Returns a new [BulkIdResponseDto] instance. - BulkIdResponseDto({ - this.error, - required this.id, - required this.success, - }); - - /// Error reason if failed - BulkIdResponseDtoErrorEnum? error; - - /// ID - String id; - - /// Whether operation succeeded - bool success; - - @override - bool operator ==(Object other) => identical(this, other) || other is BulkIdResponseDto && - other.error == error && - other.id == id && - other.success == success; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (error == null ? 0 : error!.hashCode) + - (id.hashCode) + - (success.hashCode); - - @override - String toString() => 'BulkIdResponseDto[error=$error, id=$id, success=$success]'; - - Map toJson() { - final json = {}; - if (this.error != null) { - json[r'error'] = this.error; - } else { - // json[r'error'] = null; - } - json[r'id'] = this.id; - json[r'success'] = this.success; - return json; - } - - /// Returns a new [BulkIdResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static BulkIdResponseDto? fromJson(dynamic value) { - upgradeDto(value, "BulkIdResponseDto"); - if (value is Map) { - final json = value.cast(); - - return BulkIdResponseDto( - error: BulkIdResponseDtoErrorEnum.fromJson(json[r'error']), - id: mapValueOfType(json, r'id')!, - success: mapValueOfType(json, r'success')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = BulkIdResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = BulkIdResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of BulkIdResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = BulkIdResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'id', - 'success', - }; -} - -/// Error reason if failed -class BulkIdResponseDtoErrorEnum { - /// Instantiate a new enum with the provided [value]. - const BulkIdResponseDtoErrorEnum._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const duplicate = BulkIdResponseDtoErrorEnum._(r'duplicate'); - static const noPermission = BulkIdResponseDtoErrorEnum._(r'no_permission'); - static const notFound = BulkIdResponseDtoErrorEnum._(r'not_found'); - static const unknown = BulkIdResponseDtoErrorEnum._(r'unknown'); - - /// List of all possible values in this [enum][BulkIdResponseDtoErrorEnum]. - static const values = [ - duplicate, - noPermission, - notFound, - unknown, - ]; - - static BulkIdResponseDtoErrorEnum? fromJson(dynamic value) => BulkIdResponseDtoErrorEnumTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = BulkIdResponseDtoErrorEnum.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [BulkIdResponseDtoErrorEnum] to String, -/// and [decode] dynamic data back to [BulkIdResponseDtoErrorEnum]. -class BulkIdResponseDtoErrorEnumTypeTransformer { - factory BulkIdResponseDtoErrorEnumTypeTransformer() => _instance ??= const BulkIdResponseDtoErrorEnumTypeTransformer._(); - - const BulkIdResponseDtoErrorEnumTypeTransformer._(); - - String encode(BulkIdResponseDtoErrorEnum data) => data.value; - - /// Decodes a [dynamic value][data] to a BulkIdResponseDtoErrorEnum. - /// - /// 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. - BulkIdResponseDtoErrorEnum? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'duplicate': return BulkIdResponseDtoErrorEnum.duplicate; - case r'no_permission': return BulkIdResponseDtoErrorEnum.noPermission; - case r'not_found': return BulkIdResponseDtoErrorEnum.notFound; - case r'unknown': return BulkIdResponseDtoErrorEnum.unknown; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [BulkIdResponseDtoErrorEnumTypeTransformer] instance. - static BulkIdResponseDtoErrorEnumTypeTransformer? _instance; -} - - diff --git a/mobile/openapi/lib/model/bulk_ids_dto.dart b/mobile/openapi/lib/model/bulk_ids_dto.dart deleted file mode 100644 index 7e7864a285..0000000000 --- a/mobile/openapi/lib/model/bulk_ids_dto.dart +++ /dev/null @@ -1,102 +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 BulkIdsDto { - /// Returns a new [BulkIdsDto] instance. - BulkIdsDto({ - this.ids = const [], - }); - - /// IDs to process - List ids; - - @override - bool operator ==(Object other) => identical(this, other) || other is BulkIdsDto && - _deepEquality.equals(other.ids, ids); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (ids.hashCode); - - @override - String toString() => 'BulkIdsDto[ids=$ids]'; - - Map toJson() { - final json = {}; - json[r'ids'] = this.ids; - return json; - } - - /// Returns a new [BulkIdsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static BulkIdsDto? fromJson(dynamic value) { - upgradeDto(value, "BulkIdsDto"); - if (value is Map) { - final json = value.cast(); - - return BulkIdsDto( - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = BulkIdsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = BulkIdsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of BulkIdsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = BulkIdsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/cast_response.dart b/mobile/openapi/lib/model/cast_response.dart deleted file mode 100644 index 0b7f0738fe..0000000000 --- a/mobile/openapi/lib/model/cast_response.dart +++ /dev/null @@ -1,100 +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 CastResponse { - /// Returns a new [CastResponse] instance. - CastResponse({ - this.gCastEnabled = false, - }); - - /// Whether Google Cast is enabled - bool gCastEnabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is CastResponse && - other.gCastEnabled == gCastEnabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (gCastEnabled.hashCode); - - @override - String toString() => 'CastResponse[gCastEnabled=$gCastEnabled]'; - - Map toJson() { - final json = {}; - json[r'gCastEnabled'] = this.gCastEnabled; - return json; - } - - /// Returns a new [CastResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CastResponse? fromJson(dynamic value) { - upgradeDto(value, "CastResponse"); - if (value is Map) { - final json = value.cast(); - - return CastResponse( - gCastEnabled: mapValueOfType(json, r'gCastEnabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CastResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CastResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CastResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CastResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'gCastEnabled', - }; -} - diff --git a/mobile/openapi/lib/model/cast_update.dart b/mobile/openapi/lib/model/cast_update.dart deleted file mode 100644 index 8dbf80f171..0000000000 --- a/mobile/openapi/lib/model/cast_update.dart +++ /dev/null @@ -1,109 +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 CastUpdate { - /// Returns a new [CastUpdate] instance. - CastUpdate({ - this.gCastEnabled, - }); - - /// Whether Google Cast is enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? gCastEnabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is CastUpdate && - other.gCastEnabled == gCastEnabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (gCastEnabled == null ? 0 : gCastEnabled!.hashCode); - - @override - String toString() => 'CastUpdate[gCastEnabled=$gCastEnabled]'; - - Map toJson() { - final json = {}; - if (this.gCastEnabled != null) { - json[r'gCastEnabled'] = this.gCastEnabled; - } else { - // json[r'gCastEnabled'] = null; - } - return json; - } - - /// Returns a new [CastUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CastUpdate? fromJson(dynamic value) { - upgradeDto(value, "CastUpdate"); - if (value is Map) { - final json = value.cast(); - - return CastUpdate( - gCastEnabled: mapValueOfType(json, r'gCastEnabled'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CastUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CastUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CastUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CastUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/change_password_dto.dart b/mobile/openapi/lib/model/change_password_dto.dart index 3dd6e437da..5e4a0085e2 100644 --- a/mobile/openapi/lib/model/change_password_dto.dart +++ b/mobile/openapi/lib/model/change_password_dto.dart @@ -13,41 +13,41 @@ part of openapi.api; class ChangePasswordDto { /// Returns a new [ChangePasswordDto] instance. ChangePasswordDto({ - this.invalidateSessions = false, - required this.newPassword, required this.password, + required this.newPassword, + this.invalidateSessions = false, }); - /// Invalidate all other sessions - bool invalidateSessions; - - /// New password (min 8 characters) - String newPassword; - /// Current password String password; + /// New password (min 8 characters) + String newPassword; + + /// Invalidate all other sessions + bool invalidateSessions; + @override bool operator ==(Object other) => identical(this, other) || other is ChangePasswordDto && - other.invalidateSessions == invalidateSessions && + other.password == password && other.newPassword == newPassword && - other.password == password; + other.invalidateSessions == invalidateSessions; @override int get hashCode => // ignore: unnecessary_parenthesis - (invalidateSessions.hashCode) + + (password.hashCode) + (newPassword.hashCode) + - (password.hashCode); + (invalidateSessions.hashCode); @override - String toString() => 'ChangePasswordDto[invalidateSessions=$invalidateSessions, newPassword=$newPassword, password=$password]'; + String toString() => 'ChangePasswordDto[password=$password, newPassword=$newPassword, invalidateSessions=$invalidateSessions]'; Map toJson() { final json = {}; - json[r'invalidateSessions'] = this.invalidateSessions; - json[r'newPassword'] = this.newPassword; json[r'password'] = this.password; + json[r'newPassword'] = this.newPassword; + json[r'invalidateSessions'] = this.invalidateSessions; return json; } @@ -60,9 +60,9 @@ class ChangePasswordDto { final json = value.cast(); return ChangePasswordDto( - invalidateSessions: mapValueOfType(json, r'invalidateSessions') ?? false, - newPassword: mapValueOfType(json, r'newPassword')!, password: mapValueOfType(json, r'password')!, + newPassword: mapValueOfType(json, r'newPassword')!, + invalidateSessions: mapValueOfType(json, r'invalidateSessions') ?? false, ); } return null; @@ -110,8 +110,8 @@ class ChangePasswordDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'newPassword', 'password', + 'newPassword', }; } diff --git a/mobile/openapi/lib/model/check_existing_assets_dto.dart b/mobile/openapi/lib/model/check_existing_assets_dto.dart deleted file mode 100644 index 6e4a471092..0000000000 --- a/mobile/openapi/lib/model/check_existing_assets_dto.dart +++ /dev/null @@ -1,111 +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 CheckExistingAssetsDto { - /// Returns a new [CheckExistingAssetsDto] instance. - CheckExistingAssetsDto({ - this.deviceAssetIds = const [], - required this.deviceId, - }); - - /// Device asset IDs to check - List deviceAssetIds; - - /// Device ID - String deviceId; - - @override - bool operator ==(Object other) => identical(this, other) || other is CheckExistingAssetsDto && - _deepEquality.equals(other.deviceAssetIds, deviceAssetIds) && - other.deviceId == deviceId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (deviceAssetIds.hashCode) + - (deviceId.hashCode); - - @override - String toString() => 'CheckExistingAssetsDto[deviceAssetIds=$deviceAssetIds, deviceId=$deviceId]'; - - Map toJson() { - final json = {}; - json[r'deviceAssetIds'] = this.deviceAssetIds; - json[r'deviceId'] = this.deviceId; - return json; - } - - /// Returns a new [CheckExistingAssetsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CheckExistingAssetsDto? fromJson(dynamic value) { - upgradeDto(value, "CheckExistingAssetsDto"); - if (value is Map) { - final json = value.cast(); - - return CheckExistingAssetsDto( - deviceAssetIds: json[r'deviceAssetIds'] is Iterable - ? (json[r'deviceAssetIds'] as Iterable).cast().toList(growable: false) - : const [], - deviceId: mapValueOfType(json, r'deviceId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CheckExistingAssetsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CheckExistingAssetsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CheckExistingAssetsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CheckExistingAssetsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'deviceAssetIds', - 'deviceId', - }; -} - diff --git a/mobile/openapi/lib/model/check_existing_assets_response_dto.dart b/mobile/openapi/lib/model/check_existing_assets_response_dto.dart deleted file mode 100644 index 9fb13f100f..0000000000 --- a/mobile/openapi/lib/model/check_existing_assets_response_dto.dart +++ /dev/null @@ -1,102 +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 CheckExistingAssetsResponseDto { - /// Returns a new [CheckExistingAssetsResponseDto] instance. - CheckExistingAssetsResponseDto({ - this.existingIds = const [], - }); - - /// Existing asset IDs - List existingIds; - - @override - bool operator ==(Object other) => identical(this, other) || other is CheckExistingAssetsResponseDto && - _deepEquality.equals(other.existingIds, existingIds); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (existingIds.hashCode); - - @override - String toString() => 'CheckExistingAssetsResponseDto[existingIds=$existingIds]'; - - Map toJson() { - final json = {}; - json[r'existingIds'] = this.existingIds; - return json; - } - - /// Returns a new [CheckExistingAssetsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CheckExistingAssetsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "CheckExistingAssetsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return CheckExistingAssetsResponseDto( - existingIds: json[r'existingIds'] is Iterable - ? (json[r'existingIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CheckExistingAssetsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CheckExistingAssetsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CheckExistingAssetsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CheckExistingAssetsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'existingIds', - }; -} - diff --git a/mobile/openapi/lib/model/clip_config.dart b/mobile/openapi/lib/model/clip_config.dart deleted file mode 100644 index 915e4975ed..0000000000 --- a/mobile/openapi/lib/model/clip_config.dart +++ /dev/null @@ -1,109 +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 CLIPConfig { - /// Returns a new [CLIPConfig] instance. - CLIPConfig({ - required this.enabled, - required this.modelName, - }); - - /// Whether the task is enabled - bool enabled; - - /// Name of the model to use - String modelName; - - @override - bool operator ==(Object other) => identical(this, other) || other is CLIPConfig && - other.enabled == enabled && - other.modelName == modelName; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (modelName.hashCode); - - @override - String toString() => 'CLIPConfig[enabled=$enabled, modelName=$modelName]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'modelName'] = this.modelName; - return json; - } - - /// Returns a new [CLIPConfig] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CLIPConfig? fromJson(dynamic value) { - upgradeDto(value, "CLIPConfig"); - if (value is Map) { - final json = value.cast(); - - return CLIPConfig( - enabled: mapValueOfType(json, r'enabled')!, - modelName: mapValueOfType(json, r'modelName')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CLIPConfig.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CLIPConfig.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CLIPConfig-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CLIPConfig.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'modelName', - }; -} - diff --git a/mobile/openapi/lib/model/colorspace.dart b/mobile/openapi/lib/model/colorspace.dart deleted file mode 100644 index e871e140fb..0000000000 --- a/mobile/openapi/lib/model/colorspace.dart +++ /dev/null @@ -1,85 +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; - -/// Colorspace -class Colorspace { - /// Instantiate a new enum with the provided [value]. - const Colorspace._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const srgb = Colorspace._(r'srgb'); - static const p3 = Colorspace._(r'p3'); - - /// List of all possible values in this [enum][Colorspace]. - static const values = [ - srgb, - p3, - ]; - - static Colorspace? fromJson(dynamic value) => ColorspaceTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = Colorspace.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [Colorspace] to String, -/// and [decode] dynamic data back to [Colorspace]. -class ColorspaceTypeTransformer { - factory ColorspaceTypeTransformer() => _instance ??= const ColorspaceTypeTransformer._(); - - const ColorspaceTypeTransformer._(); - - String encode(Colorspace data) => data.value; - - /// Decodes a [dynamic value][data] to a Colorspace. - /// - /// 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. - Colorspace? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'srgb': return Colorspace.srgb; - case r'p3': return Colorspace.p3; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ColorspaceTypeTransformer] instance. - static ColorspaceTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/contributor_count_response_dto.dart b/mobile/openapi/lib/model/contributor_count_response_dto.dart deleted file mode 100644 index 1bef8f29d8..0000000000 --- a/mobile/openapi/lib/model/contributor_count_response_dto.dart +++ /dev/null @@ -1,109 +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 ContributorCountResponseDto { - /// Returns a new [ContributorCountResponseDto] instance. - ContributorCountResponseDto({ - required this.assetCount, - required this.userId, - }); - - /// Number of assets contributed - int assetCount; - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is ContributorCountResponseDto && - other.assetCount == assetCount && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetCount.hashCode) + - (userId.hashCode); - - @override - String toString() => 'ContributorCountResponseDto[assetCount=$assetCount, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'assetCount'] = this.assetCount; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [ContributorCountResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ContributorCountResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ContributorCountResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ContributorCountResponseDto( - assetCount: mapValueOfType(json, r'assetCount')!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ContributorCountResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ContributorCountResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ContributorCountResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ContributorCountResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetCount', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/cq_mode.dart b/mobile/openapi/lib/model/cq_mode.dart deleted file mode 100644 index efd788b5fb..0000000000 --- a/mobile/openapi/lib/model/cq_mode.dart +++ /dev/null @@ -1,88 +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; - -/// CQ mode -class CQMode { - /// Instantiate a new enum with the provided [value]. - const CQMode._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const auto = CQMode._(r'auto'); - static const cqp = CQMode._(r'cqp'); - static const icq = CQMode._(r'icq'); - - /// List of all possible values in this [enum][CQMode]. - static const values = [ - auto, - cqp, - icq, - ]; - - static CQMode? fromJson(dynamic value) => CQModeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CQMode.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [CQMode] to String, -/// and [decode] dynamic data back to [CQMode]. -class CQModeTypeTransformer { - factory CQModeTypeTransformer() => _instance ??= const CQModeTypeTransformer._(); - - const CQModeTypeTransformer._(); - - String encode(CQMode data) => data.value; - - /// Decodes a [dynamic value][data] to a CQMode. - /// - /// 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. - CQMode? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'auto': return CQMode.auto; - case r'cqp': return CQMode.cqp; - case r'icq': return CQMode.icq; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [CQModeTypeTransformer] instance. - static CQModeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/create_album_dto.dart b/mobile/openapi/lib/model/create_album_dto.dart deleted file mode 100644 index 183a41c772..0000000000 --- a/mobile/openapi/lib/model/create_album_dto.dart +++ /dev/null @@ -1,136 +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 CreateAlbumDto { - /// Returns a new [CreateAlbumDto] instance. - CreateAlbumDto({ - required this.albumName, - this.albumUsers = const [], - this.assetIds = const [], - this.description, - }); - - /// Album name - String albumName; - - /// Album users - List albumUsers; - - /// Initial asset IDs - List assetIds; - - /// Album description - /// - /// 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? description; - - @override - bool operator ==(Object other) => identical(this, other) || other is CreateAlbumDto && - other.albumName == albumName && - _deepEquality.equals(other.albumUsers, albumUsers) && - _deepEquality.equals(other.assetIds, assetIds) && - other.description == description; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumName.hashCode) + - (albumUsers.hashCode) + - (assetIds.hashCode) + - (description == null ? 0 : description!.hashCode); - - @override - String toString() => 'CreateAlbumDto[albumName=$albumName, albumUsers=$albumUsers, assetIds=$assetIds, description=$description]'; - - Map toJson() { - final json = {}; - json[r'albumName'] = this.albumName; - json[r'albumUsers'] = this.albumUsers; - json[r'assetIds'] = this.assetIds; - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - return json; - } - - /// Returns a new [CreateAlbumDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CreateAlbumDto? fromJson(dynamic value) { - upgradeDto(value, "CreateAlbumDto"); - if (value is Map) { - final json = value.cast(); - - return CreateAlbumDto( - albumName: mapValueOfType(json, r'albumName')!, - albumUsers: AlbumUserCreateDto.listFromJson(json[r'albumUsers']), - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - description: mapValueOfType(json, r'description'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CreateAlbumDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CreateAlbumDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CreateAlbumDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CreateAlbumDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumName', - }; -} - diff --git a/mobile/openapi/lib/model/create_library_dto.dart b/mobile/openapi/lib/model/create_library_dto.dart deleted file mode 100644 index 69942fee5c..0000000000 --- a/mobile/openapi/lib/model/create_library_dto.dart +++ /dev/null @@ -1,138 +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 CreateLibraryDto { - /// Returns a new [CreateLibraryDto] instance. - CreateLibraryDto({ - this.exclusionPatterns = const {}, - this.importPaths = const {}, - this.name, - required this.ownerId, - }); - - /// Exclusion patterns (max 128) - Set exclusionPatterns; - - /// Import paths (max 128) - Set importPaths; - - /// Library name - /// - /// 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? name; - - /// Owner user ID - String ownerId; - - @override - bool operator ==(Object other) => identical(this, other) || other is CreateLibraryDto && - _deepEquality.equals(other.exclusionPatterns, exclusionPatterns) && - _deepEquality.equals(other.importPaths, importPaths) && - other.name == name && - other.ownerId == ownerId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (exclusionPatterns.hashCode) + - (importPaths.hashCode) + - (name == null ? 0 : name!.hashCode) + - (ownerId.hashCode); - - @override - String toString() => 'CreateLibraryDto[exclusionPatterns=$exclusionPatterns, importPaths=$importPaths, name=$name, ownerId=$ownerId]'; - - Map toJson() { - final json = {}; - json[r'exclusionPatterns'] = this.exclusionPatterns.toList(growable: false); - json[r'importPaths'] = this.importPaths.toList(growable: false); - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - json[r'ownerId'] = this.ownerId; - return json; - } - - /// Returns a new [CreateLibraryDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CreateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "CreateLibraryDto"); - if (value is Map) { - final json = value.cast(); - - return CreateLibraryDto( - exclusionPatterns: json[r'exclusionPatterns'] is Iterable - ? (json[r'exclusionPatterns'] as Iterable).cast().toSet() - : const {}, - importPaths: json[r'importPaths'] is Iterable - ? (json[r'importPaths'] as Iterable).cast().toSet() - : const {}, - name: mapValueOfType(json, r'name'), - ownerId: mapValueOfType(json, r'ownerId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CreateLibraryDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CreateLibraryDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CreateLibraryDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CreateLibraryDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ownerId', - }; -} - diff --git a/mobile/openapi/lib/model/create_profile_image_response_dto.dart b/mobile/openapi/lib/model/create_profile_image_response_dto.dart deleted file mode 100644 index 20d7cbd5e7..0000000000 --- a/mobile/openapi/lib/model/create_profile_image_response_dto.dart +++ /dev/null @@ -1,118 +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 CreateProfileImageResponseDto { - /// Returns a new [CreateProfileImageResponseDto] instance. - CreateProfileImageResponseDto({ - required this.profileChangedAt, - required this.profileImagePath, - required this.userId, - }); - - /// Profile image change date - DateTime profileChangedAt; - - /// Profile image file path - String profileImagePath; - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is CreateProfileImageResponseDto && - other.profileChangedAt == profileChangedAt && - other.profileImagePath == profileImagePath && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (profileChangedAt.hashCode) + - (profileImagePath.hashCode) + - (userId.hashCode); - - @override - String toString() => 'CreateProfileImageResponseDto[profileChangedAt=$profileChangedAt, profileImagePath=$profileImagePath, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - json[r'profileImagePath'] = this.profileImagePath; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [CreateProfileImageResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CreateProfileImageResponseDto? fromJson(dynamic value) { - upgradeDto(value, "CreateProfileImageResponseDto"); - if (value is Map) { - final json = value.cast(); - - return CreateProfileImageResponseDto( - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - profileImagePath: mapValueOfType(json, r'profileImagePath')!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CreateProfileImageResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CreateProfileImageResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CreateProfileImageResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CreateProfileImageResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'profileChangedAt', - 'profileImagePath', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/crop_parameters.dart b/mobile/openapi/lib/model/crop_parameters.dart deleted file mode 100644 index 8c5b884596..0000000000 --- a/mobile/openapi/lib/model/crop_parameters.dart +++ /dev/null @@ -1,135 +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 CropParameters { - /// Returns a new [CropParameters] instance. - CropParameters({ - required this.height, - required this.width, - required this.x, - required this.y, - }); - - /// Height of the crop - /// - /// Minimum value: 1 - num height; - - /// Width of the crop - /// - /// Minimum value: 1 - num width; - - /// Top-Left X coordinate of crop - /// - /// Minimum value: 0 - num x; - - /// Top-Left Y coordinate of crop - /// - /// Minimum value: 0 - num y; - - @override - bool operator ==(Object other) => identical(this, other) || other is CropParameters && - other.height == height && - other.width == width && - other.x == x && - other.y == y; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (height.hashCode) + - (width.hashCode) + - (x.hashCode) + - (y.hashCode); - - @override - String toString() => 'CropParameters[height=$height, width=$width, x=$x, y=$y]'; - - Map toJson() { - final json = {}; - json[r'height'] = this.height; - json[r'width'] = this.width; - json[r'x'] = this.x; - json[r'y'] = this.y; - return json; - } - - /// Returns a new [CropParameters] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static CropParameters? fromJson(dynamic value) { - upgradeDto(value, "CropParameters"); - if (value is Map) { - final json = value.cast(); - - return CropParameters( - height: num.parse('${json[r'height']}'), - width: num.parse('${json[r'width']}'), - x: num.parse('${json[r'x']}'), - y: num.parse('${json[r'y']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = CropParameters.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = CropParameters.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of CropParameters-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = CropParameters.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'height', - 'width', - 'x', - 'y', - }; -} - diff --git a/mobile/openapi/lib/model/database_backup_config.dart b/mobile/openapi/lib/model/database_backup_config.dart deleted file mode 100644 index 419968c3f3..0000000000 --- a/mobile/openapi/lib/model/database_backup_config.dart +++ /dev/null @@ -1,120 +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 DatabaseBackupConfig { - /// Returns a new [DatabaseBackupConfig] instance. - DatabaseBackupConfig({ - required this.cronExpression, - required this.enabled, - required this.keepLastAmount, - }); - - /// Cron expression - String cronExpression; - - /// Enabled - bool enabled; - - /// Keep last amount - /// - /// Minimum value: 1 - num keepLastAmount; - - @override - bool operator ==(Object other) => identical(this, other) || other is DatabaseBackupConfig && - other.cronExpression == cronExpression && - other.enabled == enabled && - other.keepLastAmount == keepLastAmount; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (cronExpression.hashCode) + - (enabled.hashCode) + - (keepLastAmount.hashCode); - - @override - String toString() => 'DatabaseBackupConfig[cronExpression=$cronExpression, enabled=$enabled, keepLastAmount=$keepLastAmount]'; - - Map toJson() { - final json = {}; - json[r'cronExpression'] = this.cronExpression; - json[r'enabled'] = this.enabled; - json[r'keepLastAmount'] = this.keepLastAmount; - return json; - } - - /// Returns a new [DatabaseBackupConfig] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DatabaseBackupConfig? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupConfig"); - if (value is Map) { - final json = value.cast(); - - return DatabaseBackupConfig( - cronExpression: mapValueOfType(json, r'cronExpression')!, - enabled: mapValueOfType(json, r'enabled')!, - keepLastAmount: num.parse('${json[r'keepLastAmount']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DatabaseBackupConfig.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DatabaseBackupConfig.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DatabaseBackupConfig-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DatabaseBackupConfig.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'cronExpression', - 'enabled', - 'keepLastAmount', - }; -} - diff --git a/mobile/openapi/lib/model/database_backup_delete_dto.dart b/mobile/openapi/lib/model/database_backup_delete_dto.dart deleted file mode 100644 index 8bc33a81dc..0000000000 --- a/mobile/openapi/lib/model/database_backup_delete_dto.dart +++ /dev/null @@ -1,101 +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 DatabaseBackupDeleteDto { - /// Returns a new [DatabaseBackupDeleteDto] instance. - DatabaseBackupDeleteDto({ - this.backups = const [], - }); - - List backups; - - @override - bool operator ==(Object other) => identical(this, other) || other is DatabaseBackupDeleteDto && - _deepEquality.equals(other.backups, backups); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (backups.hashCode); - - @override - String toString() => 'DatabaseBackupDeleteDto[backups=$backups]'; - - Map toJson() { - final json = {}; - json[r'backups'] = this.backups; - return json; - } - - /// Returns a new [DatabaseBackupDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DatabaseBackupDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return DatabaseBackupDeleteDto( - backups: json[r'backups'] is Iterable - ? (json[r'backups'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DatabaseBackupDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DatabaseBackupDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DatabaseBackupDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DatabaseBackupDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'backups', - }; -} - diff --git a/mobile/openapi/lib/model/database_backup_dto.dart b/mobile/openapi/lib/model/database_backup_dto.dart deleted file mode 100644 index 4bf231587b..0000000000 --- a/mobile/openapi/lib/model/database_backup_dto.dart +++ /dev/null @@ -1,107 +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 DatabaseBackupDto { - /// Returns a new [DatabaseBackupDto] instance. - DatabaseBackupDto({ - required this.filename, - required this.filesize, - }); - - String filename; - - num filesize; - - @override - bool operator ==(Object other) => identical(this, other) || other is DatabaseBackupDto && - other.filename == filename && - other.filesize == filesize; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (filename.hashCode) + - (filesize.hashCode); - - @override - String toString() => 'DatabaseBackupDto[filename=$filename, filesize=$filesize]'; - - Map toJson() { - final json = {}; - json[r'filename'] = this.filename; - json[r'filesize'] = this.filesize; - return json; - } - - /// Returns a new [DatabaseBackupDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DatabaseBackupDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupDto"); - if (value is Map) { - final json = value.cast(); - - return DatabaseBackupDto( - filename: mapValueOfType(json, r'filename')!, - filesize: num.parse('${json[r'filesize']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DatabaseBackupDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DatabaseBackupDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DatabaseBackupDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DatabaseBackupDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'filename', - 'filesize', - }; -} - diff --git a/mobile/openapi/lib/model/database_backup_list_response_dto.dart b/mobile/openapi/lib/model/database_backup_list_response_dto.dart deleted file mode 100644 index 16985dd605..0000000000 --- a/mobile/openapi/lib/model/database_backup_list_response_dto.dart +++ /dev/null @@ -1,99 +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 DatabaseBackupListResponseDto { - /// Returns a new [DatabaseBackupListResponseDto] instance. - DatabaseBackupListResponseDto({ - this.backups = const [], - }); - - List backups; - - @override - bool operator ==(Object other) => identical(this, other) || other is DatabaseBackupListResponseDto && - _deepEquality.equals(other.backups, backups); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (backups.hashCode); - - @override - String toString() => 'DatabaseBackupListResponseDto[backups=$backups]'; - - Map toJson() { - final json = {}; - json[r'backups'] = this.backups; - return json; - } - - /// Returns a new [DatabaseBackupListResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DatabaseBackupListResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DatabaseBackupListResponseDto"); - if (value is Map) { - final json = value.cast(); - - return DatabaseBackupListResponseDto( - backups: DatabaseBackupDto.listFromJson(json[r'backups']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DatabaseBackupListResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DatabaseBackupListResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DatabaseBackupListResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DatabaseBackupListResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'backups', - }; -} - diff --git a/mobile/openapi/lib/model/download_archive_info.dart b/mobile/openapi/lib/model/download_archive_info.dart deleted file mode 100644 index 97a3346a67..0000000000 --- a/mobile/openapi/lib/model/download_archive_info.dart +++ /dev/null @@ -1,111 +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 DownloadArchiveInfo { - /// Returns a new [DownloadArchiveInfo] instance. - DownloadArchiveInfo({ - this.assetIds = const [], - required this.size, - }); - - /// Asset IDs in this archive - List assetIds; - - /// Archive size in bytes - int size; - - @override - bool operator ==(Object other) => identical(this, other) || other is DownloadArchiveInfo && - _deepEquality.equals(other.assetIds, assetIds) && - other.size == size; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode) + - (size.hashCode); - - @override - String toString() => 'DownloadArchiveInfo[assetIds=$assetIds, size=$size]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - json[r'size'] = this.size; - return json; - } - - /// Returns a new [DownloadArchiveInfo] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DownloadArchiveInfo? fromJson(dynamic value) { - upgradeDto(value, "DownloadArchiveInfo"); - if (value is Map) { - final json = value.cast(); - - return DownloadArchiveInfo( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - size: mapValueOfType(json, r'size')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DownloadArchiveInfo.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DownloadArchiveInfo.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DownloadArchiveInfo-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DownloadArchiveInfo.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetIds', - 'size', - }; -} - diff --git a/mobile/openapi/lib/model/download_info_dto.dart b/mobile/openapi/lib/model/download_info_dto.dart deleted file mode 100644 index a1ba44920e..0000000000 --- a/mobile/openapi/lib/model/download_info_dto.dart +++ /dev/null @@ -1,157 +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 DownloadInfoDto { - /// Returns a new [DownloadInfoDto] instance. - DownloadInfoDto({ - this.albumId, - this.archiveSize, - this.assetIds = const [], - this.userId, - }); - - /// Album ID to download - /// - /// 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? albumId; - - /// Archive size limit in bytes - /// - /// Minimum value: 1 - /// - /// 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. - /// - int? archiveSize; - - /// Asset IDs to download - List assetIds; - - /// User ID to download assets from - /// - /// 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? userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is DownloadInfoDto && - other.albumId == albumId && - other.archiveSize == archiveSize && - _deepEquality.equals(other.assetIds, assetIds) && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId == null ? 0 : albumId!.hashCode) + - (archiveSize == null ? 0 : archiveSize!.hashCode) + - (assetIds.hashCode) + - (userId == null ? 0 : userId!.hashCode); - - @override - String toString() => 'DownloadInfoDto[albumId=$albumId, archiveSize=$archiveSize, assetIds=$assetIds, userId=$userId]'; - - Map toJson() { - final json = {}; - if (this.albumId != null) { - json[r'albumId'] = this.albumId; - } else { - // json[r'albumId'] = null; - } - if (this.archiveSize != null) { - json[r'archiveSize'] = this.archiveSize; - } else { - // json[r'archiveSize'] = null; - } - json[r'assetIds'] = this.assetIds; - if (this.userId != null) { - json[r'userId'] = this.userId; - } else { - // json[r'userId'] = null; - } - return json; - } - - /// Returns a new [DownloadInfoDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DownloadInfoDto? fromJson(dynamic value) { - upgradeDto(value, "DownloadInfoDto"); - if (value is Map) { - final json = value.cast(); - - return DownloadInfoDto( - albumId: mapValueOfType(json, r'albumId'), - archiveSize: mapValueOfType(json, r'archiveSize'), - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - userId: mapValueOfType(json, r'userId'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DownloadInfoDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DownloadInfoDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DownloadInfoDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DownloadInfoDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/download_response.dart b/mobile/openapi/lib/model/download_response.dart deleted file mode 100644 index 32e9487475..0000000000 --- a/mobile/openapi/lib/model/download_response.dart +++ /dev/null @@ -1,109 +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 DownloadResponse { - /// Returns a new [DownloadResponse] instance. - DownloadResponse({ - required this.archiveSize, - this.includeEmbeddedVideos = false, - }); - - /// Maximum archive size in bytes - int archiveSize; - - /// Whether to include embedded videos in downloads - bool includeEmbeddedVideos; - - @override - bool operator ==(Object other) => identical(this, other) || other is DownloadResponse && - other.archiveSize == archiveSize && - other.includeEmbeddedVideos == includeEmbeddedVideos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (archiveSize.hashCode) + - (includeEmbeddedVideos.hashCode); - - @override - String toString() => 'DownloadResponse[archiveSize=$archiveSize, includeEmbeddedVideos=$includeEmbeddedVideos]'; - - Map toJson() { - final json = {}; - json[r'archiveSize'] = this.archiveSize; - json[r'includeEmbeddedVideos'] = this.includeEmbeddedVideos; - return json; - } - - /// Returns a new [DownloadResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DownloadResponse? fromJson(dynamic value) { - upgradeDto(value, "DownloadResponse"); - if (value is Map) { - final json = value.cast(); - - return DownloadResponse( - archiveSize: mapValueOfType(json, r'archiveSize')!, - includeEmbeddedVideos: mapValueOfType(json, r'includeEmbeddedVideos')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DownloadResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DownloadResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DownloadResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DownloadResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'archiveSize', - 'includeEmbeddedVideos', - }; -} - diff --git a/mobile/openapi/lib/model/download_response_dto.dart b/mobile/openapi/lib/model/download_response_dto.dart deleted file mode 100644 index 81912e1d30..0000000000 --- a/mobile/openapi/lib/model/download_response_dto.dart +++ /dev/null @@ -1,109 +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 DownloadResponseDto { - /// Returns a new [DownloadResponseDto] instance. - DownloadResponseDto({ - this.archives = const [], - required this.totalSize, - }); - - /// Archive information - List archives; - - /// Total size in bytes - int totalSize; - - @override - bool operator ==(Object other) => identical(this, other) || other is DownloadResponseDto && - _deepEquality.equals(other.archives, archives) && - other.totalSize == totalSize; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (archives.hashCode) + - (totalSize.hashCode); - - @override - String toString() => 'DownloadResponseDto[archives=$archives, totalSize=$totalSize]'; - - Map toJson() { - final json = {}; - json[r'archives'] = this.archives; - json[r'totalSize'] = this.totalSize; - return json; - } - - /// Returns a new [DownloadResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DownloadResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DownloadResponseDto"); - if (value is Map) { - final json = value.cast(); - - return DownloadResponseDto( - archives: DownloadArchiveInfo.listFromJson(json[r'archives']), - totalSize: mapValueOfType(json, r'totalSize')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DownloadResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DownloadResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DownloadResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DownloadResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'archives', - 'totalSize', - }; -} - diff --git a/mobile/openapi/lib/model/download_update.dart b/mobile/openapi/lib/model/download_update.dart deleted file mode 100644 index 4acc1c8bd3..0000000000 --- a/mobile/openapi/lib/model/download_update.dart +++ /dev/null @@ -1,129 +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 DownloadUpdate { - /// Returns a new [DownloadUpdate] instance. - DownloadUpdate({ - this.archiveSize, - this.includeEmbeddedVideos, - }); - - /// Maximum archive size in bytes - /// - /// Minimum value: 1 - /// - /// 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. - /// - int? archiveSize; - - /// Whether to include embedded videos in downloads - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? includeEmbeddedVideos; - - @override - bool operator ==(Object other) => identical(this, other) || other is DownloadUpdate && - other.archiveSize == archiveSize && - other.includeEmbeddedVideos == includeEmbeddedVideos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (archiveSize == null ? 0 : archiveSize!.hashCode) + - (includeEmbeddedVideos == null ? 0 : includeEmbeddedVideos!.hashCode); - - @override - String toString() => 'DownloadUpdate[archiveSize=$archiveSize, includeEmbeddedVideos=$includeEmbeddedVideos]'; - - Map toJson() { - final json = {}; - if (this.archiveSize != null) { - json[r'archiveSize'] = this.archiveSize; - } else { - // json[r'archiveSize'] = null; - } - if (this.includeEmbeddedVideos != null) { - json[r'includeEmbeddedVideos'] = this.includeEmbeddedVideos; - } else { - // json[r'includeEmbeddedVideos'] = null; - } - return json; - } - - /// Returns a new [DownloadUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DownloadUpdate? fromJson(dynamic value) { - upgradeDto(value, "DownloadUpdate"); - if (value is Map) { - final json = value.cast(); - - return DownloadUpdate( - archiveSize: mapValueOfType(json, r'archiveSize'), - includeEmbeddedVideos: mapValueOfType(json, r'includeEmbeddedVideos'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DownloadUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DownloadUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DownloadUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DownloadUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/duplicate_detection_config.dart b/mobile/openapi/lib/model/duplicate_detection_config.dart deleted file mode 100644 index 43233826ef..0000000000 --- a/mobile/openapi/lib/model/duplicate_detection_config.dart +++ /dev/null @@ -1,112 +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 DuplicateDetectionConfig { - /// Returns a new [DuplicateDetectionConfig] instance. - DuplicateDetectionConfig({ - required this.enabled, - required this.maxDistance, - }); - - /// Whether the task is enabled - bool enabled; - - /// Maximum distance threshold for duplicate detection - /// - /// Minimum value: 0.001 - /// Maximum value: 0.1 - double maxDistance; - - @override - bool operator ==(Object other) => identical(this, other) || other is DuplicateDetectionConfig && - other.enabled == enabled && - other.maxDistance == maxDistance; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (maxDistance.hashCode); - - @override - String toString() => 'DuplicateDetectionConfig[enabled=$enabled, maxDistance=$maxDistance]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'maxDistance'] = this.maxDistance; - return json; - } - - /// Returns a new [DuplicateDetectionConfig] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DuplicateDetectionConfig? fromJson(dynamic value) { - upgradeDto(value, "DuplicateDetectionConfig"); - if (value is Map) { - final json = value.cast(); - - return DuplicateDetectionConfig( - enabled: mapValueOfType(json, r'enabled')!, - maxDistance: (mapValueOfType(json, r'maxDistance')!).toDouble(), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DuplicateDetectionConfig.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DuplicateDetectionConfig.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DuplicateDetectionConfig-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DuplicateDetectionConfig.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'maxDistance', - }; -} - diff --git a/mobile/openapi/lib/model/duplicate_response_dto.dart b/mobile/openapi/lib/model/duplicate_response_dto.dart deleted file mode 100644 index 6c85dc8013..0000000000 --- a/mobile/openapi/lib/model/duplicate_response_dto.dart +++ /dev/null @@ -1,109 +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 DuplicateResponseDto { - /// Returns a new [DuplicateResponseDto] instance. - DuplicateResponseDto({ - this.assets = const [], - required this.duplicateId, - }); - - /// Duplicate assets - List assets; - - /// Duplicate group ID - String duplicateId; - - @override - bool operator ==(Object other) => identical(this, other) || other is DuplicateResponseDto && - _deepEquality.equals(other.assets, assets) && - other.duplicateId == duplicateId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assets.hashCode) + - (duplicateId.hashCode); - - @override - String toString() => 'DuplicateResponseDto[assets=$assets, duplicateId=$duplicateId]'; - - Map toJson() { - final json = {}; - json[r'assets'] = this.assets; - json[r'duplicateId'] = this.duplicateId; - return json; - } - - /// Returns a new [DuplicateResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DuplicateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "DuplicateResponseDto"); - if (value is Map) { - final json = value.cast(); - - return DuplicateResponseDto( - assets: AssetResponseDto.listFromJson(json[r'assets']), - duplicateId: mapValueOfType(json, r'duplicateId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = DuplicateResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = DuplicateResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DuplicateResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = DuplicateResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assets', - 'duplicateId', - }; -} - diff --git a/mobile/openapi/lib/model/email_notifications_response.dart b/mobile/openapi/lib/model/email_notifications_response.dart deleted file mode 100644 index 08a3d580c6..0000000000 --- a/mobile/openapi/lib/model/email_notifications_response.dart +++ /dev/null @@ -1,118 +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 EmailNotificationsResponse { - /// Returns a new [EmailNotificationsResponse] instance. - EmailNotificationsResponse({ - required this.albumInvite, - required this.albumUpdate, - required this.enabled, - }); - - /// Whether to receive email notifications for album invites - bool albumInvite; - - /// Whether to receive email notifications for album updates - bool albumUpdate; - - /// Whether email notifications are enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is EmailNotificationsResponse && - other.albumInvite == albumInvite && - other.albumUpdate == albumUpdate && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumInvite.hashCode) + - (albumUpdate.hashCode) + - (enabled.hashCode); - - @override - String toString() => 'EmailNotificationsResponse[albumInvite=$albumInvite, albumUpdate=$albumUpdate, enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'albumInvite'] = this.albumInvite; - json[r'albumUpdate'] = this.albumUpdate; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [EmailNotificationsResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static EmailNotificationsResponse? fromJson(dynamic value) { - upgradeDto(value, "EmailNotificationsResponse"); - if (value is Map) { - final json = value.cast(); - - return EmailNotificationsResponse( - albumInvite: mapValueOfType(json, r'albumInvite')!, - albumUpdate: mapValueOfType(json, r'albumUpdate')!, - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = EmailNotificationsResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = EmailNotificationsResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of EmailNotificationsResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = EmailNotificationsResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumInvite', - 'albumUpdate', - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/email_notifications_update.dart b/mobile/openapi/lib/model/email_notifications_update.dart deleted file mode 100644 index e158e45598..0000000000 --- a/mobile/openapi/lib/model/email_notifications_update.dart +++ /dev/null @@ -1,145 +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 EmailNotificationsUpdate { - /// Returns a new [EmailNotificationsUpdate] instance. - EmailNotificationsUpdate({ - this.albumInvite, - this.albumUpdate, - this.enabled, - }); - - /// Whether to receive email notifications for album invites - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? albumInvite; - - /// Whether to receive email notifications for album updates - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? albumUpdate; - - /// Whether email notifications are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is EmailNotificationsUpdate && - other.albumInvite == albumInvite && - other.albumUpdate == albumUpdate && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumInvite == null ? 0 : albumInvite!.hashCode) + - (albumUpdate == null ? 0 : albumUpdate!.hashCode) + - (enabled == null ? 0 : enabled!.hashCode); - - @override - String toString() => 'EmailNotificationsUpdate[albumInvite=$albumInvite, albumUpdate=$albumUpdate, enabled=$enabled]'; - - Map toJson() { - final json = {}; - if (this.albumInvite != null) { - json[r'albumInvite'] = this.albumInvite; - } else { - // json[r'albumInvite'] = null; - } - if (this.albumUpdate != null) { - json[r'albumUpdate'] = this.albumUpdate; - } else { - // json[r'albumUpdate'] = null; - } - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - return json; - } - - /// Returns a new [EmailNotificationsUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static EmailNotificationsUpdate? fromJson(dynamic value) { - upgradeDto(value, "EmailNotificationsUpdate"); - if (value is Map) { - final json = value.cast(); - - return EmailNotificationsUpdate( - albumInvite: mapValueOfType(json, r'albumInvite'), - albumUpdate: mapValueOfType(json, r'albumUpdate'), - enabled: mapValueOfType(json, r'enabled'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = EmailNotificationsUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = EmailNotificationsUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of EmailNotificationsUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = EmailNotificationsUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart deleted file mode 100644 index 6bb58a8ab9..0000000000 --- a/mobile/openapi/lib/model/exif_response_dto.dart +++ /dev/null @@ -1,371 +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 ExifResponseDto { - /// Returns a new [ExifResponseDto] instance. - ExifResponseDto({ - this.city, - this.country, - this.dateTimeOriginal, - this.description, - this.exifImageHeight, - this.exifImageWidth, - this.exposureTime, - this.fNumber, - this.fileSizeInByte, - this.focalLength, - this.iso, - this.latitude, - this.lensModel, - this.longitude, - this.make, - this.model, - this.modifyDate, - this.orientation, - this.projectionType, - this.rating, - this.state, - this.timeZone, - }); - - /// City name - String? city; - - /// Country name - String? country; - - /// Original date/time - DateTime? dateTimeOriginal; - - /// Image description - String? description; - - /// Image height in pixels - num? exifImageHeight; - - /// Image width in pixels - num? exifImageWidth; - - /// Exposure time - String? exposureTime; - - /// F-number (aperture) - num? fNumber; - - /// File size in bytes - int? fileSizeInByte; - - /// Focal length in mm - num? focalLength; - - /// ISO sensitivity - num? iso; - - /// GPS latitude - num? latitude; - - /// Lens model - String? lensModel; - - /// GPS longitude - num? longitude; - - /// Camera make - String? make; - - /// Camera model - String? model; - - /// Modification date/time - DateTime? modifyDate; - - /// Image orientation - String? orientation; - - /// Projection type - String? projectionType; - - /// Rating - num? rating; - - /// State/province name - String? state; - - /// Time zone - String? timeZone; - - @override - bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto && - other.city == city && - other.country == country && - other.dateTimeOriginal == dateTimeOriginal && - other.description == description && - other.exifImageHeight == exifImageHeight && - other.exifImageWidth == exifImageWidth && - other.exposureTime == exposureTime && - other.fNumber == fNumber && - other.fileSizeInByte == fileSizeInByte && - other.focalLength == focalLength && - other.iso == iso && - other.latitude == latitude && - other.lensModel == lensModel && - other.longitude == longitude && - other.make == make && - other.model == model && - other.modifyDate == modifyDate && - other.orientation == orientation && - other.projectionType == projectionType && - other.rating == rating && - other.state == state && - other.timeZone == timeZone; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (exifImageHeight == null ? 0 : exifImageHeight!.hashCode) + - (exifImageWidth == null ? 0 : exifImageWidth!.hashCode) + - (exposureTime == null ? 0 : exposureTime!.hashCode) + - (fNumber == null ? 0 : fNumber!.hashCode) + - (fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) + - (focalLength == null ? 0 : focalLength!.hashCode) + - (iso == null ? 0 : iso!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (modifyDate == null ? 0 : modifyDate!.hashCode) + - (orientation == null ? 0 : orientation!.hashCode) + - (projectionType == null ? 0 : projectionType!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (timeZone == null ? 0 : timeZone!.hashCode); - - @override - String toString() => 'ExifResponseDto[city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]'; - - Map toJson() { - final json = {}; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); - } else { - // json[r'dateTimeOriginal'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.exifImageHeight != null) { - json[r'exifImageHeight'] = this.exifImageHeight; - } else { - // json[r'exifImageHeight'] = null; - } - if (this.exifImageWidth != null) { - json[r'exifImageWidth'] = this.exifImageWidth; - } else { - // json[r'exifImageWidth'] = null; - } - if (this.exposureTime != null) { - json[r'exposureTime'] = this.exposureTime; - } else { - // json[r'exposureTime'] = null; - } - if (this.fNumber != null) { - json[r'fNumber'] = this.fNumber; - } else { - // json[r'fNumber'] = null; - } - if (this.fileSizeInByte != null) { - json[r'fileSizeInByte'] = this.fileSizeInByte; - } else { - // json[r'fileSizeInByte'] = null; - } - if (this.focalLength != null) { - json[r'focalLength'] = this.focalLength; - } else { - // json[r'focalLength'] = null; - } - if (this.iso != null) { - json[r'iso'] = this.iso; - } else { - // json[r'iso'] = null; - } - if (this.latitude != null) { - json[r'latitude'] = this.latitude; - } else { - // json[r'latitude'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.longitude != null) { - json[r'longitude'] = this.longitude; - } else { - // json[r'longitude'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.modifyDate != null) { - json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); - } else { - // json[r'modifyDate'] = null; - } - if (this.orientation != null) { - json[r'orientation'] = this.orientation; - } else { - // json[r'orientation'] = null; - } - if (this.projectionType != null) { - json[r'projectionType'] = this.projectionType; - } else { - // json[r'projectionType'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.timeZone != null) { - json[r'timeZone'] = this.timeZone; - } else { - // json[r'timeZone'] = null; - } - return json; - } - - /// Returns a new [ExifResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ExifResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ExifResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ExifResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), - description: mapValueOfType(json, r'description'), - exifImageHeight: json[r'exifImageHeight'] == null - ? null - : num.parse('${json[r'exifImageHeight']}'), - exifImageWidth: json[r'exifImageWidth'] == null - ? null - : num.parse('${json[r'exifImageWidth']}'), - exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: json[r'fNumber'] == null - ? null - : num.parse('${json[r'fNumber']}'), - fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: json[r'focalLength'] == null - ? null - : num.parse('${json[r'focalLength']}'), - iso: json[r'iso'] == null - ? null - : num.parse('${json[r'iso']}'), - latitude: json[r'latitude'] == null - ? null - : num.parse('${json[r'latitude']}'), - lensModel: mapValueOfType(json, r'lensModel'), - longitude: json[r'longitude'] == null - ? null - : num.parse('${json[r'longitude']}'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - modifyDate: mapDateTime(json, r'modifyDate', r''), - orientation: mapValueOfType(json, r'orientation'), - projectionType: mapValueOfType(json, r'projectionType'), - rating: json[r'rating'] == null - ? null - : num.parse('${json[r'rating']}'), - state: mapValueOfType(json, r'state'), - timeZone: mapValueOfType(json, r'timeZone'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ExifResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ExifResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ExifResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ExifResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/face_dto.dart b/mobile/openapi/lib/model/face_dto.dart deleted file mode 100644 index ec5f5c8a6c..0000000000 --- a/mobile/openapi/lib/model/face_dto.dart +++ /dev/null @@ -1,100 +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 FaceDto { - /// Returns a new [FaceDto] instance. - FaceDto({ - required this.id, - }); - - /// Face ID - String id; - - @override - bool operator ==(Object other) => identical(this, other) || other is FaceDto && - other.id == id; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (id.hashCode); - - @override - String toString() => 'FaceDto[id=$id]'; - - Map toJson() { - final json = {}; - json[r'id'] = this.id; - return json; - } - - /// Returns a new [FaceDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static FaceDto? fromJson(dynamic value) { - upgradeDto(value, "FaceDto"); - if (value is Map) { - final json = value.cast(); - - return FaceDto( - id: mapValueOfType(json, r'id')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = FaceDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = FaceDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of FaceDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = FaceDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'id', - }; -} - diff --git a/mobile/openapi/lib/model/facial_recognition_config.dart b/mobile/openapi/lib/model/facial_recognition_config.dart deleted file mode 100644 index 4b9d7a6e9e..0000000000 --- a/mobile/openapi/lib/model/facial_recognition_config.dart +++ /dev/null @@ -1,144 +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 FacialRecognitionConfig { - /// Returns a new [FacialRecognitionConfig] instance. - FacialRecognitionConfig({ - required this.enabled, - required this.maxDistance, - required this.minFaces, - required this.minScore, - required this.modelName, - }); - - /// Whether the task is enabled - bool enabled; - - /// Maximum distance threshold for face recognition - /// - /// Minimum value: 0.1 - /// Maximum value: 2 - double maxDistance; - - /// Minimum number of faces required for recognition - /// - /// Minimum value: 1 - int minFaces; - - /// Minimum confidence score for face detection - /// - /// Minimum value: 0.1 - /// Maximum value: 1 - double minScore; - - /// Name of the model to use - String modelName; - - @override - bool operator ==(Object other) => identical(this, other) || other is FacialRecognitionConfig && - other.enabled == enabled && - other.maxDistance == maxDistance && - other.minFaces == minFaces && - other.minScore == minScore && - other.modelName == modelName; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (maxDistance.hashCode) + - (minFaces.hashCode) + - (minScore.hashCode) + - (modelName.hashCode); - - @override - String toString() => 'FacialRecognitionConfig[enabled=$enabled, maxDistance=$maxDistance, minFaces=$minFaces, minScore=$minScore, modelName=$modelName]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'maxDistance'] = this.maxDistance; - json[r'minFaces'] = this.minFaces; - json[r'minScore'] = this.minScore; - json[r'modelName'] = this.modelName; - return json; - } - - /// Returns a new [FacialRecognitionConfig] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static FacialRecognitionConfig? fromJson(dynamic value) { - upgradeDto(value, "FacialRecognitionConfig"); - if (value is Map) { - final json = value.cast(); - - return FacialRecognitionConfig( - enabled: mapValueOfType(json, r'enabled')!, - maxDistance: (mapValueOfType(json, r'maxDistance')!).toDouble(), - minFaces: mapValueOfType(json, r'minFaces')!, - minScore: (mapValueOfType(json, r'minScore')!).toDouble(), - modelName: mapValueOfType(json, r'modelName')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = FacialRecognitionConfig.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = FacialRecognitionConfig.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of FacialRecognitionConfig-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = FacialRecognitionConfig.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'maxDistance', - 'minFaces', - 'minScore', - 'modelName', - }; -} - diff --git a/mobile/openapi/lib/model/folders_response.dart b/mobile/openapi/lib/model/folders_response.dart deleted file mode 100644 index 906a95a83c..0000000000 --- a/mobile/openapi/lib/model/folders_response.dart +++ /dev/null @@ -1,109 +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 FoldersResponse { - /// Returns a new [FoldersResponse] instance. - FoldersResponse({ - this.enabled = false, - this.sidebarWeb = false, - }); - - /// Whether folders are enabled - bool enabled; - - /// Whether folders appear in web sidebar - bool sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is FoldersResponse && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (sidebarWeb.hashCode); - - @override - String toString() => 'FoldersResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'sidebarWeb'] = this.sidebarWeb; - return json; - } - - /// Returns a new [FoldersResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static FoldersResponse? fromJson(dynamic value) { - upgradeDto(value, "FoldersResponse"); - if (value is Map) { - final json = value.cast(); - - return FoldersResponse( - enabled: mapValueOfType(json, r'enabled')!, - sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = FoldersResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = FoldersResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of FoldersResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = FoldersResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'sidebarWeb', - }; -} - diff --git a/mobile/openapi/lib/model/folders_update.dart b/mobile/openapi/lib/model/folders_update.dart deleted file mode 100644 index edd58014d4..0000000000 --- a/mobile/openapi/lib/model/folders_update.dart +++ /dev/null @@ -1,127 +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 FoldersUpdate { - /// Returns a new [FoldersUpdate] instance. - FoldersUpdate({ - this.enabled, - this.sidebarWeb, - }); - - /// Whether folders are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Whether folders appear in web sidebar - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is FoldersUpdate && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled == null ? 0 : enabled!.hashCode) + - (sidebarWeb == null ? 0 : sidebarWeb!.hashCode); - - @override - String toString() => 'FoldersUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - if (this.sidebarWeb != null) { - json[r'sidebarWeb'] = this.sidebarWeb; - } else { - // json[r'sidebarWeb'] = null; - } - return json; - } - - /// Returns a new [FoldersUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static FoldersUpdate? fromJson(dynamic value) { - upgradeDto(value, "FoldersUpdate"); - if (value is Map) { - final json = value.cast(); - - return FoldersUpdate( - enabled: mapValueOfType(json, r'enabled'), - sidebarWeb: mapValueOfType(json, r'sidebarWeb'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = FoldersUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = FoldersUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of FoldersUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = FoldersUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/image_format.dart b/mobile/openapi/lib/model/image_format.dart deleted file mode 100644 index 1a0dde5def..0000000000 --- a/mobile/openapi/lib/model/image_format.dart +++ /dev/null @@ -1,85 +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; - -/// Image format -class ImageFormat { - /// Instantiate a new enum with the provided [value]. - const ImageFormat._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const jpeg = ImageFormat._(r'jpeg'); - static const webp = ImageFormat._(r'webp'); - - /// List of all possible values in this [enum][ImageFormat]. - static const values = [ - jpeg, - webp, - ]; - - static ImageFormat? fromJson(dynamic value) => ImageFormatTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ImageFormat.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [ImageFormat] to String, -/// and [decode] dynamic data back to [ImageFormat]. -class ImageFormatTypeTransformer { - factory ImageFormatTypeTransformer() => _instance ??= const ImageFormatTypeTransformer._(); - - const ImageFormatTypeTransformer._(); - - String encode(ImageFormat data) => data.value; - - /// Decodes a [dynamic value][data] to a ImageFormat. - /// - /// 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. - ImageFormat? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'jpeg': return ImageFormat.jpeg; - case r'webp': return ImageFormat.webp; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ImageFormatTypeTransformer] instance. - static ImageFormatTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/job_create_dto.dart b/mobile/openapi/lib/model/job_create_dto.dart deleted file mode 100644 index 3a3412384e..0000000000 --- a/mobile/openapi/lib/model/job_create_dto.dart +++ /dev/null @@ -1,100 +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 JobCreateDto { - /// Returns a new [JobCreateDto] instance. - JobCreateDto({ - required this.name, - }); - - /// Job name - ManualJobName name; - - @override - bool operator ==(Object other) => identical(this, other) || other is JobCreateDto && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (name.hashCode); - - @override - String toString() => 'JobCreateDto[name=$name]'; - - Map toJson() { - final json = {}; - json[r'name'] = this.name; - return json; - } - - /// Returns a new [JobCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static JobCreateDto? fromJson(dynamic value) { - upgradeDto(value, "JobCreateDto"); - if (value is Map) { - final json = value.cast(); - - return JobCreateDto( - name: ManualJobName.fromJson(json[r'name'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = JobCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = JobCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of JobCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = JobCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'name', - }; -} - diff --git a/mobile/openapi/lib/model/job_name.dart b/mobile/openapi/lib/model/job_name.dart deleted file mode 100644 index 96b9339b7d..0000000000 --- a/mobile/openapi/lib/model/job_name.dart +++ /dev/null @@ -1,247 +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; - -/// Job name -class JobName { - /// Instantiate a new enum with the provided [value]. - const JobName._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const assetDelete = JobName._(r'AssetDelete'); - static const assetDeleteCheck = JobName._(r'AssetDeleteCheck'); - static const assetDetectFacesQueueAll = JobName._(r'AssetDetectFacesQueueAll'); - static const assetDetectFaces = JobName._(r'AssetDetectFaces'); - static const assetDetectDuplicatesQueueAll = JobName._(r'AssetDetectDuplicatesQueueAll'); - static const assetDetectDuplicates = JobName._(r'AssetDetectDuplicates'); - static const assetEditThumbnailGeneration = JobName._(r'AssetEditThumbnailGeneration'); - static const assetEncodeVideoQueueAll = JobName._(r'AssetEncodeVideoQueueAll'); - static const assetEncodeVideo = JobName._(r'AssetEncodeVideo'); - static const assetEmptyTrash = JobName._(r'AssetEmptyTrash'); - static const assetExtractMetadataQueueAll = JobName._(r'AssetExtractMetadataQueueAll'); - static const assetExtractMetadata = JobName._(r'AssetExtractMetadata'); - static const assetFileMigration = JobName._(r'AssetFileMigration'); - static const assetGenerateThumbnailsQueueAll = JobName._(r'AssetGenerateThumbnailsQueueAll'); - static const assetGenerateThumbnails = JobName._(r'AssetGenerateThumbnails'); - static const auditLogCleanup = JobName._(r'AuditLogCleanup'); - static const auditTableCleanup = JobName._(r'AuditTableCleanup'); - static const databaseBackup = JobName._(r'DatabaseBackup'); - static const facialRecognitionQueueAll = JobName._(r'FacialRecognitionQueueAll'); - static const facialRecognition = JobName._(r'FacialRecognition'); - static const fileDelete = JobName._(r'FileDelete'); - static const fileMigrationQueueAll = JobName._(r'FileMigrationQueueAll'); - static const libraryDeleteCheck = JobName._(r'LibraryDeleteCheck'); - static const libraryDelete = JobName._(r'LibraryDelete'); - static const libraryRemoveAsset = JobName._(r'LibraryRemoveAsset'); - static const libraryScanAssetsQueueAll = JobName._(r'LibraryScanAssetsQueueAll'); - static const librarySyncAssets = JobName._(r'LibrarySyncAssets'); - static const librarySyncFilesQueueAll = JobName._(r'LibrarySyncFilesQueueAll'); - static const librarySyncFiles = JobName._(r'LibrarySyncFiles'); - static const libraryScanQueueAll = JobName._(r'LibraryScanQueueAll'); - static const memoryCleanup = JobName._(r'MemoryCleanup'); - static const memoryGenerate = JobName._(r'MemoryGenerate'); - static const notificationsCleanup = JobName._(r'NotificationsCleanup'); - static const notifyUserSignup = JobName._(r'NotifyUserSignup'); - static const notifyAlbumInvite = JobName._(r'NotifyAlbumInvite'); - static const notifyAlbumUpdate = JobName._(r'NotifyAlbumUpdate'); - static const userDelete = JobName._(r'UserDelete'); - static const userDeleteCheck = JobName._(r'UserDeleteCheck'); - static const userSyncUsage = JobName._(r'UserSyncUsage'); - static const personCleanup = JobName._(r'PersonCleanup'); - static const personFileMigration = JobName._(r'PersonFileMigration'); - static const personGenerateThumbnail = JobName._(r'PersonGenerateThumbnail'); - static const sessionCleanup = JobName._(r'SessionCleanup'); - static const sendMail = JobName._(r'SendMail'); - static const sidecarQueueAll = JobName._(r'SidecarQueueAll'); - static const sidecarCheck = JobName._(r'SidecarCheck'); - static const sidecarWrite = JobName._(r'SidecarWrite'); - static const smartSearchQueueAll = JobName._(r'SmartSearchQueueAll'); - static const smartSearch = JobName._(r'SmartSearch'); - static const storageTemplateMigration = JobName._(r'StorageTemplateMigration'); - static const storageTemplateMigrationSingle = JobName._(r'StorageTemplateMigrationSingle'); - static const tagCleanup = JobName._(r'TagCleanup'); - static const versionCheck = JobName._(r'VersionCheck'); - static const ocrQueueAll = JobName._(r'OcrQueueAll'); - static const ocr = JobName._(r'Ocr'); - static const workflowRun = JobName._(r'WorkflowRun'); - - /// List of all possible values in this [enum][JobName]. - static const values = [ - assetDelete, - assetDeleteCheck, - assetDetectFacesQueueAll, - assetDetectFaces, - assetDetectDuplicatesQueueAll, - assetDetectDuplicates, - assetEditThumbnailGeneration, - assetEncodeVideoQueueAll, - assetEncodeVideo, - assetEmptyTrash, - assetExtractMetadataQueueAll, - assetExtractMetadata, - assetFileMigration, - assetGenerateThumbnailsQueueAll, - assetGenerateThumbnails, - auditLogCleanup, - auditTableCleanup, - databaseBackup, - facialRecognitionQueueAll, - facialRecognition, - fileDelete, - fileMigrationQueueAll, - libraryDeleteCheck, - libraryDelete, - libraryRemoveAsset, - libraryScanAssetsQueueAll, - librarySyncAssets, - librarySyncFilesQueueAll, - librarySyncFiles, - libraryScanQueueAll, - memoryCleanup, - memoryGenerate, - notificationsCleanup, - notifyUserSignup, - notifyAlbumInvite, - notifyAlbumUpdate, - userDelete, - userDeleteCheck, - userSyncUsage, - personCleanup, - personFileMigration, - personGenerateThumbnail, - sessionCleanup, - sendMail, - sidecarQueueAll, - sidecarCheck, - sidecarWrite, - smartSearchQueueAll, - smartSearch, - storageTemplateMigration, - storageTemplateMigrationSingle, - tagCleanup, - versionCheck, - ocrQueueAll, - ocr, - workflowRun, - ]; - - static JobName? fromJson(dynamic value) => JobNameTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = JobName.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [JobName] to String, -/// and [decode] dynamic data back to [JobName]. -class JobNameTypeTransformer { - factory JobNameTypeTransformer() => _instance ??= const JobNameTypeTransformer._(); - - const JobNameTypeTransformer._(); - - String encode(JobName data) => data.value; - - /// Decodes a [dynamic value][data] to a JobName. - /// - /// 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. - JobName? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'AssetDelete': return JobName.assetDelete; - case r'AssetDeleteCheck': return JobName.assetDeleteCheck; - case r'AssetDetectFacesQueueAll': return JobName.assetDetectFacesQueueAll; - case r'AssetDetectFaces': return JobName.assetDetectFaces; - case r'AssetDetectDuplicatesQueueAll': return JobName.assetDetectDuplicatesQueueAll; - case r'AssetDetectDuplicates': return JobName.assetDetectDuplicates; - case r'AssetEditThumbnailGeneration': return JobName.assetEditThumbnailGeneration; - case r'AssetEncodeVideoQueueAll': return JobName.assetEncodeVideoQueueAll; - case r'AssetEncodeVideo': return JobName.assetEncodeVideo; - case r'AssetEmptyTrash': return JobName.assetEmptyTrash; - case r'AssetExtractMetadataQueueAll': return JobName.assetExtractMetadataQueueAll; - case r'AssetExtractMetadata': return JobName.assetExtractMetadata; - case r'AssetFileMigration': return JobName.assetFileMigration; - case r'AssetGenerateThumbnailsQueueAll': return JobName.assetGenerateThumbnailsQueueAll; - case r'AssetGenerateThumbnails': return JobName.assetGenerateThumbnails; - case r'AuditLogCleanup': return JobName.auditLogCleanup; - case r'AuditTableCleanup': return JobName.auditTableCleanup; - case r'DatabaseBackup': return JobName.databaseBackup; - case r'FacialRecognitionQueueAll': return JobName.facialRecognitionQueueAll; - case r'FacialRecognition': return JobName.facialRecognition; - case r'FileDelete': return JobName.fileDelete; - case r'FileMigrationQueueAll': return JobName.fileMigrationQueueAll; - case r'LibraryDeleteCheck': return JobName.libraryDeleteCheck; - case r'LibraryDelete': return JobName.libraryDelete; - case r'LibraryRemoveAsset': return JobName.libraryRemoveAsset; - case r'LibraryScanAssetsQueueAll': return JobName.libraryScanAssetsQueueAll; - case r'LibrarySyncAssets': return JobName.librarySyncAssets; - case r'LibrarySyncFilesQueueAll': return JobName.librarySyncFilesQueueAll; - case r'LibrarySyncFiles': return JobName.librarySyncFiles; - case r'LibraryScanQueueAll': return JobName.libraryScanQueueAll; - case r'MemoryCleanup': return JobName.memoryCleanup; - case r'MemoryGenerate': return JobName.memoryGenerate; - case r'NotificationsCleanup': return JobName.notificationsCleanup; - case r'NotifyUserSignup': return JobName.notifyUserSignup; - case r'NotifyAlbumInvite': return JobName.notifyAlbumInvite; - case r'NotifyAlbumUpdate': return JobName.notifyAlbumUpdate; - case r'UserDelete': return JobName.userDelete; - case r'UserDeleteCheck': return JobName.userDeleteCheck; - case r'UserSyncUsage': return JobName.userSyncUsage; - case r'PersonCleanup': return JobName.personCleanup; - case r'PersonFileMigration': return JobName.personFileMigration; - case r'PersonGenerateThumbnail': return JobName.personGenerateThumbnail; - case r'SessionCleanup': return JobName.sessionCleanup; - case r'SendMail': return JobName.sendMail; - case r'SidecarQueueAll': return JobName.sidecarQueueAll; - case r'SidecarCheck': return JobName.sidecarCheck; - case r'SidecarWrite': return JobName.sidecarWrite; - case r'SmartSearchQueueAll': return JobName.smartSearchQueueAll; - case r'SmartSearch': return JobName.smartSearch; - case r'StorageTemplateMigration': return JobName.storageTemplateMigration; - case r'StorageTemplateMigrationSingle': return JobName.storageTemplateMigrationSingle; - case r'TagCleanup': return JobName.tagCleanup; - case r'VersionCheck': return JobName.versionCheck; - case r'OcrQueueAll': return JobName.ocrQueueAll; - case r'Ocr': return JobName.ocr; - case r'WorkflowRun': return JobName.workflowRun; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [JobNameTypeTransformer] instance. - static JobNameTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/job_settings_dto.dart b/mobile/openapi/lib/model/job_settings_dto.dart deleted file mode 100644 index 73a0187ddd..0000000000 --- a/mobile/openapi/lib/model/job_settings_dto.dart +++ /dev/null @@ -1,102 +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 JobSettingsDto { - /// Returns a new [JobSettingsDto] instance. - JobSettingsDto({ - required this.concurrency, - }); - - /// Concurrency - /// - /// Minimum value: 1 - int concurrency; - - @override - bool operator ==(Object other) => identical(this, other) || other is JobSettingsDto && - other.concurrency == concurrency; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (concurrency.hashCode); - - @override - String toString() => 'JobSettingsDto[concurrency=$concurrency]'; - - Map toJson() { - final json = {}; - json[r'concurrency'] = this.concurrency; - return json; - } - - /// Returns a new [JobSettingsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static JobSettingsDto? fromJson(dynamic value) { - upgradeDto(value, "JobSettingsDto"); - if (value is Map) { - final json = value.cast(); - - return JobSettingsDto( - concurrency: mapValueOfType(json, r'concurrency')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = JobSettingsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = JobSettingsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of JobSettingsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = JobSettingsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'concurrency', - }; -} - diff --git a/mobile/openapi/lib/model/library_response_dto.dart b/mobile/openapi/lib/model/library_response_dto.dart deleted file mode 100644 index aa9158e591..0000000000 --- a/mobile/openapi/lib/model/library_response_dto.dart +++ /dev/null @@ -1,180 +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 LibraryResponseDto { - /// Returns a new [LibraryResponseDto] instance. - LibraryResponseDto({ - required this.assetCount, - required this.createdAt, - this.exclusionPatterns = const [], - required this.id, - this.importPaths = const [], - required this.name, - required this.ownerId, - required this.refreshedAt, - required this.updatedAt, - }); - - /// Number of assets - int assetCount; - - /// Creation date - DateTime createdAt; - - /// Exclusion patterns - List exclusionPatterns; - - /// Library ID - String id; - - /// Import paths - List importPaths; - - /// Library name - String name; - - /// Owner user ID - String ownerId; - - /// Last refresh date - DateTime? refreshedAt; - - /// Last update date - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is LibraryResponseDto && - other.assetCount == assetCount && - other.createdAt == createdAt && - _deepEquality.equals(other.exclusionPatterns, exclusionPatterns) && - other.id == id && - _deepEquality.equals(other.importPaths, importPaths) && - other.name == name && - other.ownerId == ownerId && - other.refreshedAt == refreshedAt && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetCount.hashCode) + - (createdAt.hashCode) + - (exclusionPatterns.hashCode) + - (id.hashCode) + - (importPaths.hashCode) + - (name.hashCode) + - (ownerId.hashCode) + - (refreshedAt == null ? 0 : refreshedAt!.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'LibraryResponseDto[assetCount=$assetCount, createdAt=$createdAt, exclusionPatterns=$exclusionPatterns, id=$id, importPaths=$importPaths, name=$name, ownerId=$ownerId, refreshedAt=$refreshedAt, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'assetCount'] = this.assetCount; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'exclusionPatterns'] = this.exclusionPatterns; - json[r'id'] = this.id; - json[r'importPaths'] = this.importPaths; - json[r'name'] = this.name; - json[r'ownerId'] = this.ownerId; - if (this.refreshedAt != null) { - json[r'refreshedAt'] = this.refreshedAt!.toUtc().toIso8601String(); - } else { - // json[r'refreshedAt'] = null; - } - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [LibraryResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static LibraryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LibraryResponseDto"); - if (value is Map) { - final json = value.cast(); - - return LibraryResponseDto( - assetCount: mapValueOfType(json, r'assetCount')!, - createdAt: mapDateTime(json, r'createdAt', r'')!, - exclusionPatterns: json[r'exclusionPatterns'] is Iterable - ? (json[r'exclusionPatterns'] as Iterable).cast().toList(growable: false) - : const [], - id: mapValueOfType(json, r'id')!, - importPaths: json[r'importPaths'] is Iterable - ? (json[r'importPaths'] as Iterable).cast().toList(growable: false) - : const [], - name: mapValueOfType(json, r'name')!, - ownerId: mapValueOfType(json, r'ownerId')!, - refreshedAt: mapDateTime(json, r'refreshedAt', r''), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = LibraryResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = LibraryResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of LibraryResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = LibraryResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetCount', - 'createdAt', - 'exclusionPatterns', - 'id', - 'importPaths', - 'name', - 'ownerId', - 'refreshedAt', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/library_stats_response_dto.dart b/mobile/openapi/lib/model/library_stats_response_dto.dart deleted file mode 100644 index 6eec3ae8d7..0000000000 --- a/mobile/openapi/lib/model/library_stats_response_dto.dart +++ /dev/null @@ -1,127 +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 LibraryStatsResponseDto { - /// Returns a new [LibraryStatsResponseDto] instance. - LibraryStatsResponseDto({ - this.photos = 0, - this.total = 0, - this.usage = 0, - this.videos = 0, - }); - - /// Number of photos - int photos; - - /// Total number of assets - int total; - - /// Storage usage in bytes - int usage; - - /// Number of videos - int videos; - - @override - bool operator ==(Object other) => identical(this, other) || other is LibraryStatsResponseDto && - other.photos == photos && - other.total == total && - other.usage == usage && - other.videos == videos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (photos.hashCode) + - (total.hashCode) + - (usage.hashCode) + - (videos.hashCode); - - @override - String toString() => 'LibraryStatsResponseDto[photos=$photos, total=$total, usage=$usage, videos=$videos]'; - - Map toJson() { - final json = {}; - json[r'photos'] = this.photos; - json[r'total'] = this.total; - json[r'usage'] = this.usage; - json[r'videos'] = this.videos; - return json; - } - - /// Returns a new [LibraryStatsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static LibraryStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LibraryStatsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return LibraryStatsResponseDto( - photos: mapValueOfType(json, r'photos')!, - total: mapValueOfType(json, r'total')!, - usage: mapValueOfType(json, r'usage')!, - videos: mapValueOfType(json, r'videos')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = LibraryStatsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = LibraryStatsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of LibraryStatsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = LibraryStatsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'photos', - 'total', - 'usage', - 'videos', - }; -} - diff --git a/mobile/openapi/lib/model/license_key_dto.dart b/mobile/openapi/lib/model/license_key_dto.dart deleted file mode 100644 index ea1fee9d7a..0000000000 --- a/mobile/openapi/lib/model/license_key_dto.dart +++ /dev/null @@ -1,109 +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 LicenseKeyDto { - /// Returns a new [LicenseKeyDto] instance. - LicenseKeyDto({ - required this.activationKey, - required this.licenseKey, - }); - - /// Activation key - String activationKey; - - /// License key (format: IM(SV|CL)(-XXXX){8}) - String licenseKey; - - @override - bool operator ==(Object other) => identical(this, other) || other is LicenseKeyDto && - other.activationKey == activationKey && - other.licenseKey == licenseKey; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (activationKey.hashCode) + - (licenseKey.hashCode); - - @override - String toString() => 'LicenseKeyDto[activationKey=$activationKey, licenseKey=$licenseKey]'; - - Map toJson() { - final json = {}; - json[r'activationKey'] = this.activationKey; - json[r'licenseKey'] = this.licenseKey; - return json; - } - - /// Returns a new [LicenseKeyDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static LicenseKeyDto? fromJson(dynamic value) { - upgradeDto(value, "LicenseKeyDto"); - if (value is Map) { - final json = value.cast(); - - return LicenseKeyDto( - activationKey: mapValueOfType(json, r'activationKey')!, - licenseKey: mapValueOfType(json, r'licenseKey')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = LicenseKeyDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = LicenseKeyDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of LicenseKeyDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = LicenseKeyDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'activationKey', - 'licenseKey', - }; -} - diff --git a/mobile/openapi/lib/model/license_response_dto.dart b/mobile/openapi/lib/model/license_response_dto.dart deleted file mode 100644 index 84ff72c1eb..0000000000 --- a/mobile/openapi/lib/model/license_response_dto.dart +++ /dev/null @@ -1,118 +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 LicenseResponseDto { - /// Returns a new [LicenseResponseDto] instance. - LicenseResponseDto({ - required this.activatedAt, - required this.activationKey, - required this.licenseKey, - }); - - /// Activation date - DateTime activatedAt; - - /// Activation key - String activationKey; - - /// License key (format: IM(SV|CL)(-XXXX){8}) - String licenseKey; - - @override - bool operator ==(Object other) => identical(this, other) || other is LicenseResponseDto && - other.activatedAt == activatedAt && - other.activationKey == activationKey && - other.licenseKey == licenseKey; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (activatedAt.hashCode) + - (activationKey.hashCode) + - (licenseKey.hashCode); - - @override - String toString() => 'LicenseResponseDto[activatedAt=$activatedAt, activationKey=$activationKey, licenseKey=$licenseKey]'; - - Map toJson() { - final json = {}; - json[r'activatedAt'] = this.activatedAt.toUtc().toIso8601String(); - json[r'activationKey'] = this.activationKey; - json[r'licenseKey'] = this.licenseKey; - return json; - } - - /// Returns a new [LicenseResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static LicenseResponseDto? fromJson(dynamic value) { - upgradeDto(value, "LicenseResponseDto"); - if (value is Map) { - final json = value.cast(); - - return LicenseResponseDto( - activatedAt: mapDateTime(json, r'activatedAt', r'')!, - activationKey: mapValueOfType(json, r'activationKey')!, - licenseKey: mapValueOfType(json, r'licenseKey')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = LicenseResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = LicenseResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of LicenseResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = LicenseResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'activatedAt', - 'activationKey', - 'licenseKey', - }; -} - diff --git a/mobile/openapi/lib/model/log_level.dart b/mobile/openapi/lib/model/log_level.dart deleted file mode 100644 index 2129096da2..0000000000 --- a/mobile/openapi/lib/model/log_level.dart +++ /dev/null @@ -1,97 +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 LogLevel { - /// Instantiate a new enum with the provided [value]. - const LogLevel._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const verbose = LogLevel._(r'verbose'); - static const debug = LogLevel._(r'debug'); - static const log = LogLevel._(r'log'); - static const warn = LogLevel._(r'warn'); - static const error = LogLevel._(r'error'); - static const fatal = LogLevel._(r'fatal'); - - /// List of all possible values in this [enum][LogLevel]. - static const values = [ - verbose, - debug, - log, - warn, - error, - fatal, - ]; - - static LogLevel? fromJson(dynamic value) => LogLevelTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = LogLevel.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [LogLevel] to String, -/// and [decode] dynamic data back to [LogLevel]. -class LogLevelTypeTransformer { - factory LogLevelTypeTransformer() => _instance ??= const LogLevelTypeTransformer._(); - - const LogLevelTypeTransformer._(); - - String encode(LogLevel data) => data.value; - - /// Decodes a [dynamic value][data] to a LogLevel. - /// - /// 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. - LogLevel? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'verbose': return LogLevel.verbose; - case r'debug': return LogLevel.debug; - case r'log': return LogLevel.log; - case r'warn': return LogLevel.warn; - case r'error': return LogLevel.error; - case r'fatal': return LogLevel.fatal; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [LogLevelTypeTransformer] instance. - static LogLevelTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/login_response_dto.dart b/mobile/openapi/lib/model/login_response_dto.dart index c6938c2393..dc8c992909 100644 --- a/mobile/openapi/lib/model/login_response_dto.dart +++ b/mobile/openapi/lib/model/login_response_dto.dart @@ -14,75 +14,61 @@ class LoginResponseDto { /// Returns a new [LoginResponseDto] instance. LoginResponseDto({ required this.accessToken, - required this.isAdmin, - required this.isOnboarded, - required this.name, - required this.profileImagePath, - required this.shouldChangePassword, - required this.userEmail, required this.userId, + required this.userEmail, + required this.name, + required this.isAdmin, + required this.shouldChangePassword, }); /// Access token String accessToken; - /// Is admin user - bool isAdmin; - - /// Is onboarded - bool isOnboarded; - - /// User name - String name; - - /// Profile image path - String profileImagePath; - - /// Should change password - bool shouldChangePassword; + /// User ID + String userId; /// User email String userEmail; - /// User ID - String userId; + /// User name + String name; + + /// Is admin user + bool isAdmin; + + /// Should change password + bool shouldChangePassword; @override bool operator ==(Object other) => identical(this, other) || other is LoginResponseDto && other.accessToken == accessToken && - other.isAdmin == isAdmin && - other.isOnboarded == isOnboarded && - other.name == name && - other.profileImagePath == profileImagePath && - other.shouldChangePassword == shouldChangePassword && + other.userId == userId && other.userEmail == userEmail && - other.userId == userId; + other.name == name && + other.isAdmin == isAdmin && + other.shouldChangePassword == shouldChangePassword; @override int get hashCode => // ignore: unnecessary_parenthesis (accessToken.hashCode) + - (isAdmin.hashCode) + - (isOnboarded.hashCode) + - (name.hashCode) + - (profileImagePath.hashCode) + - (shouldChangePassword.hashCode) + + (userId.hashCode) + (userEmail.hashCode) + - (userId.hashCode); + (name.hashCode) + + (isAdmin.hashCode) + + (shouldChangePassword.hashCode); @override - String toString() => 'LoginResponseDto[accessToken=$accessToken, isAdmin=$isAdmin, isOnboarded=$isOnboarded, name=$name, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, userEmail=$userEmail, userId=$userId]'; + String toString() => 'LoginResponseDto[accessToken=$accessToken, userId=$userId, userEmail=$userEmail, name=$name, isAdmin=$isAdmin, shouldChangePassword=$shouldChangePassword]'; Map toJson() { final json = {}; json[r'accessToken'] = this.accessToken; - json[r'isAdmin'] = this.isAdmin; - json[r'isOnboarded'] = this.isOnboarded; - json[r'name'] = this.name; - json[r'profileImagePath'] = this.profileImagePath; - json[r'shouldChangePassword'] = this.shouldChangePassword; - json[r'userEmail'] = this.userEmail; json[r'userId'] = this.userId; + json[r'userEmail'] = this.userEmail; + json[r'name'] = this.name; + json[r'isAdmin'] = this.isAdmin; + json[r'shouldChangePassword'] = this.shouldChangePassword; return json; } @@ -96,13 +82,11 @@ class LoginResponseDto { return LoginResponseDto( accessToken: mapValueOfType(json, r'accessToken')!, - isAdmin: mapValueOfType(json, r'isAdmin')!, - isOnboarded: mapValueOfType(json, r'isOnboarded')!, - name: mapValueOfType(json, r'name')!, - profileImagePath: mapValueOfType(json, r'profileImagePath')!, - shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, - userEmail: mapValueOfType(json, r'userEmail')!, userId: mapValueOfType(json, r'userId')!, + userEmail: mapValueOfType(json, r'userEmail')!, + name: mapValueOfType(json, r'name')!, + isAdmin: mapValueOfType(json, r'isAdmin')!, + shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, ); } return null; @@ -151,13 +135,11 @@ class LoginResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { 'accessToken', - 'isAdmin', - 'isOnboarded', - 'name', - 'profileImagePath', - 'shouldChangePassword', - 'userEmail', 'userId', + 'userEmail', + 'name', + 'isAdmin', + 'shouldChangePassword', }; } diff --git a/mobile/openapi/lib/model/logout_response_dto.dart b/mobile/openapi/lib/model/logout_response_dto.dart index b50db2c28b..6f035dd0d6 100644 --- a/mobile/openapi/lib/model/logout_response_dto.dart +++ b/mobile/openapi/lib/model/logout_response_dto.dart @@ -13,34 +13,34 @@ part of openapi.api; class LogoutResponseDto { /// Returns a new [LogoutResponseDto] instance. LogoutResponseDto({ - required this.redirectUri, required this.successful, + required this.redirectUri, }); - /// Redirect URI - String redirectUri; - /// Logout successful bool successful; + /// Redirect URI + String redirectUri; + @override bool operator ==(Object other) => identical(this, other) || other is LogoutResponseDto && - other.redirectUri == redirectUri && - other.successful == successful; + other.successful == successful && + other.redirectUri == redirectUri; @override int get hashCode => // ignore: unnecessary_parenthesis - (redirectUri.hashCode) + - (successful.hashCode); + (successful.hashCode) + + (redirectUri.hashCode); @override - String toString() => 'LogoutResponseDto[redirectUri=$redirectUri, successful=$successful]'; + String toString() => 'LogoutResponseDto[successful=$successful, redirectUri=$redirectUri]'; Map toJson() { final json = {}; - json[r'redirectUri'] = this.redirectUri; json[r'successful'] = this.successful; + json[r'redirectUri'] = this.redirectUri; return json; } @@ -53,8 +53,8 @@ class LogoutResponseDto { final json = value.cast(); return LogoutResponseDto( - redirectUri: mapValueOfType(json, r'redirectUri')!, successful: mapValueOfType(json, r'successful')!, + redirectUri: mapValueOfType(json, r'redirectUri')!, ); } return null; @@ -102,8 +102,8 @@ class LogoutResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'redirectUri', 'successful', + 'redirectUri', }; } diff --git a/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart b/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart deleted file mode 100644 index dc0cf5fac0..0000000000 --- a/mobile/openapi/lib/model/machine_learning_availability_checks_dto.dart +++ /dev/null @@ -1,116 +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 MachineLearningAvailabilityChecksDto { - /// Returns a new [MachineLearningAvailabilityChecksDto] instance. - MachineLearningAvailabilityChecksDto({ - required this.enabled, - required this.interval, - required this.timeout, - }); - - /// Enabled - bool enabled; - - num interval; - - num timeout; - - @override - bool operator ==(Object other) => identical(this, other) || other is MachineLearningAvailabilityChecksDto && - other.enabled == enabled && - other.interval == interval && - other.timeout == timeout; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (interval.hashCode) + - (timeout.hashCode); - - @override - String toString() => 'MachineLearningAvailabilityChecksDto[enabled=$enabled, interval=$interval, timeout=$timeout]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'interval'] = this.interval; - json[r'timeout'] = this.timeout; - return json; - } - - /// Returns a new [MachineLearningAvailabilityChecksDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MachineLearningAvailabilityChecksDto? fromJson(dynamic value) { - upgradeDto(value, "MachineLearningAvailabilityChecksDto"); - if (value is Map) { - final json = value.cast(); - - return MachineLearningAvailabilityChecksDto( - enabled: mapValueOfType(json, r'enabled')!, - interval: num.parse('${json[r'interval']}'), - timeout: num.parse('${json[r'timeout']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MachineLearningAvailabilityChecksDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MachineLearningAvailabilityChecksDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MachineLearningAvailabilityChecksDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MachineLearningAvailabilityChecksDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'interval', - 'timeout', - }; -} - diff --git a/mobile/openapi/lib/model/maintenance_action.dart b/mobile/openapi/lib/model/maintenance_action.dart deleted file mode 100644 index ebf5ec0f71..0000000000 --- a/mobile/openapi/lib/model/maintenance_action.dart +++ /dev/null @@ -1,91 +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; - -/// Maintenance action -class MaintenanceAction { - /// Instantiate a new enum with the provided [value]. - const MaintenanceAction._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const start = MaintenanceAction._(r'start'); - static const end = MaintenanceAction._(r'end'); - static const selectDatabaseRestore = MaintenanceAction._(r'select_database_restore'); - static const restoreDatabase = MaintenanceAction._(r'restore_database'); - - /// List of all possible values in this [enum][MaintenanceAction]. - static const values = [ - start, - end, - selectDatabaseRestore, - restoreDatabase, - ]; - - static MaintenanceAction? fromJson(dynamic value) => MaintenanceActionTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceAction.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [MaintenanceAction] to String, -/// and [decode] dynamic data back to [MaintenanceAction]. -class MaintenanceActionTypeTransformer { - factory MaintenanceActionTypeTransformer() => _instance ??= const MaintenanceActionTypeTransformer._(); - - const MaintenanceActionTypeTransformer._(); - - String encode(MaintenanceAction data) => data.value; - - /// Decodes a [dynamic value][data] to a MaintenanceAction. - /// - /// 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. - MaintenanceAction? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'start': return MaintenanceAction.start; - case r'end': return MaintenanceAction.end; - case r'select_database_restore': return MaintenanceAction.selectDatabaseRestore; - case r'restore_database': return MaintenanceAction.restoreDatabase; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [MaintenanceActionTypeTransformer] instance. - static MaintenanceActionTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/maintenance_auth_dto.dart b/mobile/openapi/lib/model/maintenance_auth_dto.dart deleted file mode 100644 index f9511bdd2b..0000000000 --- a/mobile/openapi/lib/model/maintenance_auth_dto.dart +++ /dev/null @@ -1,100 +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 MaintenanceAuthDto { - /// Returns a new [MaintenanceAuthDto] instance. - MaintenanceAuthDto({ - required this.username, - }); - - /// Maintenance username - String username; - - @override - bool operator ==(Object other) => identical(this, other) || other is MaintenanceAuthDto && - other.username == username; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (username.hashCode); - - @override - String toString() => 'MaintenanceAuthDto[username=$username]'; - - Map toJson() { - final json = {}; - json[r'username'] = this.username; - return json; - } - - /// Returns a new [MaintenanceAuthDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MaintenanceAuthDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceAuthDto"); - if (value is Map) { - final json = value.cast(); - - return MaintenanceAuthDto( - username: mapValueOfType(json, r'username')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceAuthDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MaintenanceAuthDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MaintenanceAuthDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MaintenanceAuthDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'username', - }; -} - diff --git a/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart b/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart deleted file mode 100644 index 1c364a6fdc..0000000000 --- a/mobile/openapi/lib/model/maintenance_detect_install_response_dto.dart +++ /dev/null @@ -1,99 +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 MaintenanceDetectInstallResponseDto { - /// Returns a new [MaintenanceDetectInstallResponseDto] instance. - MaintenanceDetectInstallResponseDto({ - this.storage = const [], - }); - - List storage; - - @override - bool operator ==(Object other) => identical(this, other) || other is MaintenanceDetectInstallResponseDto && - _deepEquality.equals(other.storage, storage); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (storage.hashCode); - - @override - String toString() => 'MaintenanceDetectInstallResponseDto[storage=$storage]'; - - Map toJson() { - final json = {}; - json[r'storage'] = this.storage; - return json; - } - - /// Returns a new [MaintenanceDetectInstallResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MaintenanceDetectInstallResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceDetectInstallResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MaintenanceDetectInstallResponseDto( - storage: MaintenanceDetectInstallStorageFolderDto.listFromJson(json[r'storage']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceDetectInstallResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MaintenanceDetectInstallResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MaintenanceDetectInstallResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MaintenanceDetectInstallResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'storage', - }; -} - diff --git a/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart b/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart deleted file mode 100644 index ad524914b4..0000000000 --- a/mobile/openapi/lib/model/maintenance_detect_install_storage_folder_dto.dart +++ /dev/null @@ -1,127 +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 MaintenanceDetectInstallStorageFolderDto { - /// Returns a new [MaintenanceDetectInstallStorageFolderDto] instance. - MaintenanceDetectInstallStorageFolderDto({ - required this.files, - required this.folder, - required this.readable, - required this.writable, - }); - - /// Number of files in the folder - num files; - - /// Storage folder - StorageFolder folder; - - /// Whether the folder is readable - bool readable; - - /// Whether the folder is writable - bool writable; - - @override - bool operator ==(Object other) => identical(this, other) || other is MaintenanceDetectInstallStorageFolderDto && - other.files == files && - other.folder == folder && - other.readable == readable && - other.writable == writable; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (files.hashCode) + - (folder.hashCode) + - (readable.hashCode) + - (writable.hashCode); - - @override - String toString() => 'MaintenanceDetectInstallStorageFolderDto[files=$files, folder=$folder, readable=$readable, writable=$writable]'; - - Map toJson() { - final json = {}; - json[r'files'] = this.files; - json[r'folder'] = this.folder; - json[r'readable'] = this.readable; - json[r'writable'] = this.writable; - return json; - } - - /// Returns a new [MaintenanceDetectInstallStorageFolderDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MaintenanceDetectInstallStorageFolderDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceDetectInstallStorageFolderDto"); - if (value is Map) { - final json = value.cast(); - - return MaintenanceDetectInstallStorageFolderDto( - files: num.parse('${json[r'files']}'), - folder: StorageFolder.fromJson(json[r'folder'])!, - readable: mapValueOfType(json, r'readable')!, - writable: mapValueOfType(json, r'writable')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceDetectInstallStorageFolderDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MaintenanceDetectInstallStorageFolderDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MaintenanceDetectInstallStorageFolderDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MaintenanceDetectInstallStorageFolderDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'files', - 'folder', - 'readable', - 'writable', - }; -} - diff --git a/mobile/openapi/lib/model/maintenance_login_dto.dart b/mobile/openapi/lib/model/maintenance_login_dto.dart deleted file mode 100644 index 64cf6b234b..0000000000 --- a/mobile/openapi/lib/model/maintenance_login_dto.dart +++ /dev/null @@ -1,109 +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 MaintenanceLoginDto { - /// Returns a new [MaintenanceLoginDto] instance. - MaintenanceLoginDto({ - this.token, - }); - - /// Maintenance token - /// - /// 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? token; - - @override - bool operator ==(Object other) => identical(this, other) || other is MaintenanceLoginDto && - other.token == token; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (token == null ? 0 : token!.hashCode); - - @override - String toString() => 'MaintenanceLoginDto[token=$token]'; - - Map toJson() { - final json = {}; - if (this.token != null) { - json[r'token'] = this.token; - } else { - // json[r'token'] = null; - } - return json; - } - - /// Returns a new [MaintenanceLoginDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MaintenanceLoginDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceLoginDto"); - if (value is Map) { - final json = value.cast(); - - return MaintenanceLoginDto( - token: mapValueOfType(json, r'token'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceLoginDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MaintenanceLoginDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MaintenanceLoginDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MaintenanceLoginDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/maintenance_status_response_dto.dart b/mobile/openapi/lib/model/maintenance_status_response_dto.dart deleted file mode 100644 index 52dbb5b95b..0000000000 --- a/mobile/openapi/lib/model/maintenance_status_response_dto.dart +++ /dev/null @@ -1,159 +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 MaintenanceStatusResponseDto { - /// Returns a new [MaintenanceStatusResponseDto] instance. - MaintenanceStatusResponseDto({ - required this.action, - required this.active, - this.error, - this.progress, - this.task, - }); - - /// Maintenance action - MaintenanceAction action; - - bool active; - - /// - /// 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? error; - - /// - /// 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. - /// - num? progress; - - /// - /// 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? task; - - @override - bool operator ==(Object other) => identical(this, other) || other is MaintenanceStatusResponseDto && - other.action == action && - other.active == active && - other.error == error && - other.progress == progress && - other.task == task; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (active.hashCode) + - (error == null ? 0 : error!.hashCode) + - (progress == null ? 0 : progress!.hashCode) + - (task == null ? 0 : task!.hashCode); - - @override - String toString() => 'MaintenanceStatusResponseDto[action=$action, active=$active, error=$error, progress=$progress, task=$task]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - json[r'active'] = this.active; - if (this.error != null) { - json[r'error'] = this.error; - } else { - // json[r'error'] = null; - } - if (this.progress != null) { - json[r'progress'] = this.progress; - } else { - // json[r'progress'] = null; - } - if (this.task != null) { - json[r'task'] = this.task; - } else { - // json[r'task'] = null; - } - return json; - } - - /// Returns a new [MaintenanceStatusResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MaintenanceStatusResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MaintenanceStatusResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MaintenanceStatusResponseDto( - action: MaintenanceAction.fromJson(json[r'action'])!, - active: mapValueOfType(json, r'active')!, - error: mapValueOfType(json, r'error'), - progress: num.parse('${json[r'progress']}'), - task: mapValueOfType(json, r'task'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MaintenanceStatusResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MaintenanceStatusResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MaintenanceStatusResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MaintenanceStatusResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - 'active', - }; -} - diff --git a/mobile/openapi/lib/model/manual_job_name.dart b/mobile/openapi/lib/model/manual_job_name.dart deleted file mode 100644 index d09790a81a..0000000000 --- a/mobile/openapi/lib/model/manual_job_name.dart +++ /dev/null @@ -1,97 +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; - -/// Job name -class ManualJobName { - /// Instantiate a new enum with the provided [value]. - const ManualJobName._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const personCleanup = ManualJobName._(r'person-cleanup'); - static const tagCleanup = ManualJobName._(r'tag-cleanup'); - static const userCleanup = ManualJobName._(r'user-cleanup'); - static const memoryCleanup = ManualJobName._(r'memory-cleanup'); - static const memoryCreate = ManualJobName._(r'memory-create'); - static const backupDatabase = ManualJobName._(r'backup-database'); - - /// List of all possible values in this [enum][ManualJobName]. - static const values = [ - personCleanup, - tagCleanup, - userCleanup, - memoryCleanup, - memoryCreate, - backupDatabase, - ]; - - static ManualJobName? fromJson(dynamic value) => ManualJobNameTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ManualJobName.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [ManualJobName] to String, -/// and [decode] dynamic data back to [ManualJobName]. -class ManualJobNameTypeTransformer { - factory ManualJobNameTypeTransformer() => _instance ??= const ManualJobNameTypeTransformer._(); - - const ManualJobNameTypeTransformer._(); - - String encode(ManualJobName data) => data.value; - - /// Decodes a [dynamic value][data] to a ManualJobName. - /// - /// 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. - ManualJobName? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'person-cleanup': return ManualJobName.personCleanup; - case r'tag-cleanup': return ManualJobName.tagCleanup; - case r'user-cleanup': return ManualJobName.userCleanup; - case r'memory-cleanup': return ManualJobName.memoryCleanup; - case r'memory-create': return ManualJobName.memoryCreate; - case r'backup-database': return ManualJobName.backupDatabase; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ManualJobNameTypeTransformer] instance. - static ManualJobNameTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/map_marker_response_dto.dart b/mobile/openapi/lib/model/map_marker_response_dto.dart deleted file mode 100644 index c0a47a5458..0000000000 --- a/mobile/openapi/lib/model/map_marker_response_dto.dart +++ /dev/null @@ -1,157 +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 MapMarkerResponseDto { - /// Returns a new [MapMarkerResponseDto] instance. - MapMarkerResponseDto({ - required this.city, - required this.country, - required this.id, - required this.lat, - required this.lon, - required this.state, - }); - - /// City name - String? city; - - /// Country name - String? country; - - /// Asset ID - String id; - - /// Latitude - double lat; - - /// Longitude - double lon; - - /// State/Province name - String? state; - - @override - bool operator ==(Object other) => identical(this, other) || other is MapMarkerResponseDto && - other.city == city && - other.country == country && - other.id == id && - other.lat == lat && - other.lon == lon && - other.state == state; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (id.hashCode) + - (lat.hashCode) + - (lon.hashCode) + - (state == null ? 0 : state!.hashCode); - - @override - String toString() => 'MapMarkerResponseDto[city=$city, country=$country, id=$id, lat=$lat, lon=$lon, state=$state]'; - - Map toJson() { - final json = {}; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - json[r'id'] = this.id; - json[r'lat'] = this.lat; - json[r'lon'] = this.lon; - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - return json; - } - - /// Returns a new [MapMarkerResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MapMarkerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MapMarkerResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MapMarkerResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - id: mapValueOfType(json, r'id')!, - lat: (mapValueOfType(json, r'lat')!).toDouble(), - lon: (mapValueOfType(json, r'lon')!).toDouble(), - state: mapValueOfType(json, r'state'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MapMarkerResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MapMarkerResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MapMarkerResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MapMarkerResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'city', - 'country', - 'id', - 'lat', - 'lon', - 'state', - }; -} - diff --git a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart b/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart deleted file mode 100644 index 85435485e6..0000000000 --- a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart +++ /dev/null @@ -1,130 +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 MapReverseGeocodeResponseDto { - /// Returns a new [MapReverseGeocodeResponseDto] instance. - MapReverseGeocodeResponseDto({ - required this.city, - required this.country, - required this.state, - }); - - /// City name - String? city; - - /// Country name - String? country; - - /// State/Province name - String? state; - - @override - bool operator ==(Object other) => identical(this, other) || other is MapReverseGeocodeResponseDto && - other.city == city && - other.country == country && - other.state == state; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (state == null ? 0 : state!.hashCode); - - @override - String toString() => 'MapReverseGeocodeResponseDto[city=$city, country=$country, state=$state]'; - - Map toJson() { - final json = {}; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - return json; - } - - /// Returns a new [MapReverseGeocodeResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MapReverseGeocodeResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MapReverseGeocodeResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MapReverseGeocodeResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - state: mapValueOfType(json, r'state'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MapReverseGeocodeResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MapReverseGeocodeResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MapReverseGeocodeResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MapReverseGeocodeResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'city', - 'country', - 'state', - }; -} - diff --git a/mobile/openapi/lib/model/memories_response.dart b/mobile/openapi/lib/model/memories_response.dart deleted file mode 100644 index 63d4094cd0..0000000000 --- a/mobile/openapi/lib/model/memories_response.dart +++ /dev/null @@ -1,109 +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 MemoriesResponse { - /// Returns a new [MemoriesResponse] instance. - MemoriesResponse({ - this.duration = 5, - this.enabled = true, - }); - - /// Memory duration in seconds - int duration; - - /// Whether memories are enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoriesResponse && - other.duration == duration && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (duration.hashCode) + - (enabled.hashCode); - - @override - String toString() => 'MemoriesResponse[duration=$duration, enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'duration'] = this.duration; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [MemoriesResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoriesResponse? fromJson(dynamic value) { - upgradeDto(value, "MemoriesResponse"); - if (value is Map) { - final json = value.cast(); - - return MemoriesResponse( - duration: mapValueOfType(json, r'duration')!, - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoriesResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoriesResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoriesResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoriesResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'duration', - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/memories_update.dart b/mobile/openapi/lib/model/memories_update.dart deleted file mode 100644 index d27cef022d..0000000000 --- a/mobile/openapi/lib/model/memories_update.dart +++ /dev/null @@ -1,129 +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 MemoriesUpdate { - /// Returns a new [MemoriesUpdate] instance. - MemoriesUpdate({ - this.duration, - this.enabled, - }); - - /// Memory duration in seconds - /// - /// Minimum value: 1 - /// - /// 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. - /// - int? duration; - - /// Whether memories are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate && - other.duration == duration && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (duration == null ? 0 : duration!.hashCode) + - (enabled == null ? 0 : enabled!.hashCode); - - @override - String toString() => 'MemoriesUpdate[duration=$duration, enabled=$enabled]'; - - Map toJson() { - final json = {}; - if (this.duration != null) { - json[r'duration'] = this.duration; - } else { - // json[r'duration'] = null; - } - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - return json; - } - - /// Returns a new [MemoriesUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoriesUpdate? fromJson(dynamic value) { - upgradeDto(value, "MemoriesUpdate"); - if (value is Map) { - final json = value.cast(); - - return MemoriesUpdate( - duration: mapValueOfType(json, r'duration'), - enabled: mapValueOfType(json, r'enabled'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoriesUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoriesUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoriesUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoriesUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/memory_create_dto.dart b/mobile/openapi/lib/model/memory_create_dto.dart deleted file mode 100644 index 7fd938b31a..0000000000 --- a/mobile/openapi/lib/model/memory_create_dto.dart +++ /dev/null @@ -1,163 +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 MemoryCreateDto { - /// Returns a new [MemoryCreateDto] instance. - MemoryCreateDto({ - this.assetIds = const [], - required this.data, - this.isSaved, - required this.memoryAt, - this.seenAt, - required this.type, - }); - - /// Asset IDs to associate with memory - List assetIds; - - OnThisDayDto data; - - /// Is memory saved - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isSaved; - - /// Memory date - DateTime memoryAt; - - /// Date when memory was seen - /// - /// 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? seenAt; - - /// Memory type - MemoryType type; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoryCreateDto && - _deepEquality.equals(other.assetIds, assetIds) && - other.data == data && - other.isSaved == isSaved && - other.memoryAt == memoryAt && - other.seenAt == seenAt && - other.type == type; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode) + - (data.hashCode) + - (isSaved == null ? 0 : isSaved!.hashCode) + - (memoryAt.hashCode) + - (seenAt == null ? 0 : seenAt!.hashCode) + - (type.hashCode); - - @override - String toString() => 'MemoryCreateDto[assetIds=$assetIds, data=$data, isSaved=$isSaved, memoryAt=$memoryAt, seenAt=$seenAt, type=$type]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - json[r'data'] = this.data; - if (this.isSaved != null) { - json[r'isSaved'] = this.isSaved; - } else { - // json[r'isSaved'] = null; - } - json[r'memoryAt'] = this.memoryAt.toUtc().toIso8601String(); - if (this.seenAt != null) { - json[r'seenAt'] = this.seenAt!.toUtc().toIso8601String(); - } else { - // json[r'seenAt'] = null; - } - json[r'type'] = this.type; - return json; - } - - /// Returns a new [MemoryCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoryCreateDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryCreateDto"); - if (value is Map) { - final json = value.cast(); - - return MemoryCreateDto( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - data: OnThisDayDto.fromJson(json[r'data'])!, - isSaved: mapValueOfType(json, r'isSaved'), - memoryAt: mapDateTime(json, r'memoryAt', r'')!, - seenAt: mapDateTime(json, r'seenAt', r''), - type: MemoryType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoryCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoryCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoryCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoryCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'data', - 'memoryAt', - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/memory_response_dto.dart b/mobile/openapi/lib/model/memory_response_dto.dart deleted file mode 100644 index 1835095cf7..0000000000 --- a/mobile/openapi/lib/model/memory_response_dto.dart +++ /dev/null @@ -1,242 +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 MemoryResponseDto { - /// Returns a new [MemoryResponseDto] instance. - MemoryResponseDto({ - this.assets = const [], - required this.createdAt, - required this.data, - this.deletedAt, - this.hideAt, - required this.id, - required this.isSaved, - required this.memoryAt, - required this.ownerId, - this.seenAt, - this.showAt, - required this.type, - required this.updatedAt, - }); - - List assets; - - /// Creation date - DateTime createdAt; - - OnThisDayDto data; - - /// Deletion date - /// - /// 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? deletedAt; - - /// Date when memory should be hidden - /// - /// 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? hideAt; - - /// Memory ID - String id; - - /// Is memory saved - bool isSaved; - - /// Memory date - DateTime memoryAt; - - /// Owner user ID - String ownerId; - - /// Date when memory was seen - /// - /// 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? seenAt; - - /// Date when memory should be shown - /// - /// 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? showAt; - - /// Memory type - MemoryType type; - - /// Last update date - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoryResponseDto && - _deepEquality.equals(other.assets, assets) && - other.createdAt == createdAt && - other.data == data && - other.deletedAt == deletedAt && - other.hideAt == hideAt && - other.id == id && - other.isSaved == isSaved && - other.memoryAt == memoryAt && - other.ownerId == ownerId && - other.seenAt == seenAt && - other.showAt == showAt && - other.type == type && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assets.hashCode) + - (createdAt.hashCode) + - (data.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (hideAt == null ? 0 : hideAt!.hashCode) + - (id.hashCode) + - (isSaved.hashCode) + - (memoryAt.hashCode) + - (ownerId.hashCode) + - (seenAt == null ? 0 : seenAt!.hashCode) + - (showAt == null ? 0 : showAt!.hashCode) + - (type.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'MemoryResponseDto[assets=$assets, createdAt=$createdAt, data=$data, deletedAt=$deletedAt, hideAt=$hideAt, id=$id, isSaved=$isSaved, memoryAt=$memoryAt, ownerId=$ownerId, seenAt=$seenAt, showAt=$showAt, type=$type, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'assets'] = this.assets; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'data'] = this.data; - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); - } else { - // json[r'deletedAt'] = null; - } - if (this.hideAt != null) { - json[r'hideAt'] = this.hideAt!.toUtc().toIso8601String(); - } else { - // json[r'hideAt'] = null; - } - json[r'id'] = this.id; - json[r'isSaved'] = this.isSaved; - json[r'memoryAt'] = this.memoryAt.toUtc().toIso8601String(); - json[r'ownerId'] = this.ownerId; - if (this.seenAt != null) { - json[r'seenAt'] = this.seenAt!.toUtc().toIso8601String(); - } else { - // json[r'seenAt'] = null; - } - if (this.showAt != null) { - json[r'showAt'] = this.showAt!.toUtc().toIso8601String(); - } else { - // json[r'showAt'] = null; - } - json[r'type'] = this.type; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [MemoryResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MemoryResponseDto( - assets: AssetResponseDto.listFromJson(json[r'assets']), - createdAt: mapDateTime(json, r'createdAt', r'')!, - data: OnThisDayDto.fromJson(json[r'data'])!, - deletedAt: mapDateTime(json, r'deletedAt', r''), - hideAt: mapDateTime(json, r'hideAt', r''), - id: mapValueOfType(json, r'id')!, - isSaved: mapValueOfType(json, r'isSaved')!, - memoryAt: mapDateTime(json, r'memoryAt', r'')!, - ownerId: mapValueOfType(json, r'ownerId')!, - seenAt: mapDateTime(json, r'seenAt', r''), - showAt: mapDateTime(json, r'showAt', r''), - type: MemoryType.fromJson(json[r'type'])!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoryResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoryResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoryResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoryResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assets', - 'createdAt', - 'data', - 'id', - 'isSaved', - 'memoryAt', - 'ownerId', - 'type', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/memory_search_order.dart b/mobile/openapi/lib/model/memory_search_order.dart deleted file mode 100644 index bdf5b59894..0000000000 --- a/mobile/openapi/lib/model/memory_search_order.dart +++ /dev/null @@ -1,88 +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 MemorySearchOrder { - /// Instantiate a new enum with the provided [value]. - const MemorySearchOrder._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const asc = MemorySearchOrder._(r'asc'); - static const desc = MemorySearchOrder._(r'desc'); - static const random = MemorySearchOrder._(r'random'); - - /// List of all possible values in this [enum][MemorySearchOrder]. - static const values = [ - asc, - desc, - random, - ]; - - static MemorySearchOrder? fromJson(dynamic value) => MemorySearchOrderTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemorySearchOrder.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [MemorySearchOrder] to String, -/// and [decode] dynamic data back to [MemorySearchOrder]. -class MemorySearchOrderTypeTransformer { - factory MemorySearchOrderTypeTransformer() => _instance ??= const MemorySearchOrderTypeTransformer._(); - - const MemorySearchOrderTypeTransformer._(); - - String encode(MemorySearchOrder data) => data.value; - - /// Decodes a [dynamic value][data] to a MemorySearchOrder. - /// - /// 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. - MemorySearchOrder? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'asc': return MemorySearchOrder.asc; - case r'desc': return MemorySearchOrder.desc; - case r'random': return MemorySearchOrder.random; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [MemorySearchOrderTypeTransformer] instance. - static MemorySearchOrderTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/memory_statistics_response_dto.dart b/mobile/openapi/lib/model/memory_statistics_response_dto.dart deleted file mode 100644 index bde78de481..0000000000 --- a/mobile/openapi/lib/model/memory_statistics_response_dto.dart +++ /dev/null @@ -1,100 +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 MemoryStatisticsResponseDto { - /// Returns a new [MemoryStatisticsResponseDto] instance. - MemoryStatisticsResponseDto({ - required this.total, - }); - - /// Total number of memories - int total; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoryStatisticsResponseDto && - other.total == total; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (total.hashCode); - - @override - String toString() => 'MemoryStatisticsResponseDto[total=$total]'; - - Map toJson() { - final json = {}; - json[r'total'] = this.total; - return json; - } - - /// Returns a new [MemoryStatisticsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoryStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryStatisticsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return MemoryStatisticsResponseDto( - total: mapValueOfType(json, r'total')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoryStatisticsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoryStatisticsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoryStatisticsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoryStatisticsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'total', - }; -} - diff --git a/mobile/openapi/lib/model/memory_type.dart b/mobile/openapi/lib/model/memory_type.dart deleted file mode 100644 index aee7bd1ba1..0000000000 --- a/mobile/openapi/lib/model/memory_type.dart +++ /dev/null @@ -1,82 +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 MemoryType { - /// Instantiate a new enum with the provided [value]. - const MemoryType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const onThisDay = MemoryType._(r'on_this_day'); - - /// List of all possible values in this [enum][MemoryType]. - static const values = [ - onThisDay, - ]; - - static MemoryType? fromJson(dynamic value) => MemoryTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoryType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [MemoryType] to String, -/// and [decode] dynamic data back to [MemoryType]. -class MemoryTypeTypeTransformer { - factory MemoryTypeTypeTransformer() => _instance ??= const MemoryTypeTypeTransformer._(); - - const MemoryTypeTypeTransformer._(); - - String encode(MemoryType data) => data.value; - - /// Decodes a [dynamic value][data] to a MemoryType. - /// - /// 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. - MemoryType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'on_this_day': return MemoryType.onThisDay; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [MemoryTypeTypeTransformer] instance. - static MemoryTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/memory_update_dto.dart b/mobile/openapi/lib/model/memory_update_dto.dart deleted file mode 100644 index 4905b161bf..0000000000 --- a/mobile/openapi/lib/model/memory_update_dto.dart +++ /dev/null @@ -1,145 +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 MemoryUpdateDto { - /// Returns a new [MemoryUpdateDto] instance. - MemoryUpdateDto({ - this.isSaved, - this.memoryAt, - this.seenAt, - }); - - /// Is memory saved - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isSaved; - - /// Memory date - /// - /// 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? memoryAt; - - /// Date when memory was seen - /// - /// 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? seenAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is MemoryUpdateDto && - other.isSaved == isSaved && - other.memoryAt == memoryAt && - other.seenAt == seenAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isSaved == null ? 0 : isSaved!.hashCode) + - (memoryAt == null ? 0 : memoryAt!.hashCode) + - (seenAt == null ? 0 : seenAt!.hashCode); - - @override - String toString() => 'MemoryUpdateDto[isSaved=$isSaved, memoryAt=$memoryAt, seenAt=$seenAt]'; - - Map toJson() { - final json = {}; - if (this.isSaved != null) { - json[r'isSaved'] = this.isSaved; - } else { - // json[r'isSaved'] = null; - } - if (this.memoryAt != null) { - json[r'memoryAt'] = this.memoryAt!.toUtc().toIso8601String(); - } else { - // json[r'memoryAt'] = null; - } - if (this.seenAt != null) { - json[r'seenAt'] = this.seenAt!.toUtc().toIso8601String(); - } else { - // json[r'seenAt'] = null; - } - return json; - } - - /// Returns a new [MemoryUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MemoryUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "MemoryUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return MemoryUpdateDto( - isSaved: mapValueOfType(json, r'isSaved'), - memoryAt: mapDateTime(json, r'memoryAt', r''), - seenAt: mapDateTime(json, r'seenAt', r''), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MemoryUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MemoryUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MemoryUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MemoryUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/merge_person_dto.dart b/mobile/openapi/lib/model/merge_person_dto.dart deleted file mode 100644 index 8a647890c3..0000000000 --- a/mobile/openapi/lib/model/merge_person_dto.dart +++ /dev/null @@ -1,102 +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 MergePersonDto { - /// Returns a new [MergePersonDto] instance. - MergePersonDto({ - this.ids = const [], - }); - - /// Person IDs to merge - List ids; - - @override - bool operator ==(Object other) => identical(this, other) || other is MergePersonDto && - _deepEquality.equals(other.ids, ids); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (ids.hashCode); - - @override - String toString() => 'MergePersonDto[ids=$ids]'; - - Map toJson() { - final json = {}; - json[r'ids'] = this.ids; - return json; - } - - /// Returns a new [MergePersonDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MergePersonDto? fromJson(dynamic value) { - upgradeDto(value, "MergePersonDto"); - if (value is Map) { - final json = value.cast(); - - return MergePersonDto( - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MergePersonDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MergePersonDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MergePersonDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MergePersonDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart deleted file mode 100644 index 4a7ca403ab..0000000000 --- a/mobile/openapi/lib/model/metadata_search_dto.dart +++ /dev/null @@ -1,825 +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 MetadataSearchDto { - /// Returns a new [MetadataSearchDto] instance. - MetadataSearchDto({ - this.albumIds = const [], - this.checksum, - this.city, - this.country, - this.createdAfter, - this.createdBefore, - this.description, - this.deviceAssetId, - this.deviceId, - this.encodedVideoPath, - this.id, - this.isEncoded, - this.isFavorite, - this.isMotion, - this.isNotInAlbum, - this.isOffline, - this.lensModel, - this.libraryId, - this.make, - this.model, - this.ocr, - this.order = AssetOrder.desc, - this.originalFileName, - this.originalPath, - this.page, - this.personIds = const [], - this.previewPath, - this.rating, - this.size, - this.state, - this.tagIds = const [], - this.takenAfter, - this.takenBefore, - this.thumbnailPath, - this.trashedAfter, - this.trashedBefore, - this.type, - this.updatedAfter, - this.updatedBefore, - this.visibility, - this.withDeleted, - this.withExif, - this.withPeople, - this.withStacked, - }); - - /// Filter by album IDs - List albumIds; - - /// Filter by file checksum - /// - /// 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? checksum; - - /// Filter by city name - String? city; - - /// Filter by country name - String? country; - - /// Filter by creation date (after) - /// - /// 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? createdAfter; - - /// Filter by creation date (before) - /// - /// 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? createdBefore; - - /// Filter by description text - /// - /// 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? description; - - /// Filter by device asset ID - /// - /// 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? deviceAssetId; - - /// Device ID to filter by - /// - /// 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? deviceId; - - /// Filter by encoded video file path - /// - /// 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? encodedVideoPath; - - /// Filter by asset ID - /// - /// 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? id; - - /// Filter by encoded status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isEncoded; - - /// Filter by favorite status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Filter by motion photo status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isMotion; - - /// Filter assets not in any album - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isNotInAlbum; - - /// Filter by offline status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isOffline; - - /// Filter by lens model - String? lensModel; - - /// Library ID to filter by - String? libraryId; - - /// Filter by camera make - /// - /// 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? make; - - /// Filter by camera model - String? model; - - /// Filter by OCR text content - /// - /// 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? ocr; - - /// Sort order - AssetOrder order; - - /// Filter by original file name - /// - /// 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? originalFileName; - - /// Filter by original file path - /// - /// 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? originalPath; - - /// Page number - /// - /// Minimum value: 1 - /// - /// 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. - /// - num? page; - - /// Filter by person IDs - List personIds; - - /// Filter by preview file path - /// - /// 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? previewPath; - - /// Filter by rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Number of results to return - /// - /// Minimum value: 1 - /// Maximum value: 1000 - /// - /// 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. - /// - num? size; - - /// Filter by state/province name - String? state; - - /// Filter by tag IDs - List? tagIds; - - /// Filter by taken date (after) - /// - /// 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? takenAfter; - - /// Filter by taken date (before) - /// - /// 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? takenBefore; - - /// Filter by thumbnail file path - /// - /// 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? thumbnailPath; - - /// Filter by trash date (after) - /// - /// 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? trashedAfter; - - /// Filter by trash date (before) - /// - /// 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? trashedBefore; - - /// Asset type filter - /// - /// 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. - /// - AssetTypeEnum? type; - - /// Filter by update date (after) - /// - /// 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? updatedAfter; - - /// Filter by update date (before) - /// - /// 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? updatedBefore; - - /// Filter by visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - /// Include deleted assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withDeleted; - - /// Include EXIF data in response - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withExif; - - /// Include assets with people - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withPeople; - - /// Include stacked assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withStacked; - - @override - bool operator ==(Object other) => identical(this, other) || other is MetadataSearchDto && - _deepEquality.equals(other.albumIds, albumIds) && - other.checksum == checksum && - other.city == city && - other.country == country && - other.createdAfter == createdAfter && - other.createdBefore == createdBefore && - other.description == description && - other.deviceAssetId == deviceAssetId && - other.deviceId == deviceId && - other.encodedVideoPath == encodedVideoPath && - other.id == id && - other.isEncoded == isEncoded && - other.isFavorite == isFavorite && - other.isMotion == isMotion && - other.isNotInAlbum == isNotInAlbum && - other.isOffline == isOffline && - other.lensModel == lensModel && - other.libraryId == libraryId && - other.make == make && - other.model == model && - other.ocr == ocr && - other.order == order && - other.originalFileName == originalFileName && - other.originalPath == originalPath && - other.page == page && - _deepEquality.equals(other.personIds, personIds) && - other.previewPath == previewPath && - other.rating == rating && - other.size == size && - other.state == state && - _deepEquality.equals(other.tagIds, tagIds) && - other.takenAfter == takenAfter && - other.takenBefore == takenBefore && - other.thumbnailPath == thumbnailPath && - other.trashedAfter == trashedAfter && - other.trashedBefore == trashedBefore && - other.type == type && - other.updatedAfter == updatedAfter && - other.updatedBefore == updatedBefore && - other.visibility == visibility && - other.withDeleted == withDeleted && - other.withExif == withExif && - other.withPeople == withPeople && - other.withStacked == withStacked; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumIds.hashCode) + - (checksum == null ? 0 : checksum!.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (createdAfter == null ? 0 : createdAfter!.hashCode) + - (createdBefore == null ? 0 : createdBefore!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (deviceAssetId == null ? 0 : deviceAssetId!.hashCode) + - (deviceId == null ? 0 : deviceId!.hashCode) + - (encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) + - (id == null ? 0 : id!.hashCode) + - (isEncoded == null ? 0 : isEncoded!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isMotion == null ? 0 : isMotion!.hashCode) + - (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + - (isOffline == null ? 0 : isOffline!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (ocr == null ? 0 : ocr!.hashCode) + - (order.hashCode) + - (originalFileName == null ? 0 : originalFileName!.hashCode) + - (originalPath == null ? 0 : originalPath!.hashCode) + - (page == null ? 0 : page!.hashCode) + - (personIds.hashCode) + - (previewPath == null ? 0 : previewPath!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (tagIds == null ? 0 : tagIds!.hashCode) + - (takenAfter == null ? 0 : takenAfter!.hashCode) + - (takenBefore == null ? 0 : takenBefore!.hashCode) + - (thumbnailPath == null ? 0 : thumbnailPath!.hashCode) + - (trashedAfter == null ? 0 : trashedAfter!.hashCode) + - (trashedBefore == null ? 0 : trashedBefore!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (updatedAfter == null ? 0 : updatedAfter!.hashCode) + - (updatedBefore == null ? 0 : updatedBefore!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode) + - (withDeleted == null ? 0 : withDeleted!.hashCode) + - (withExif == null ? 0 : withExif!.hashCode) + - (withPeople == null ? 0 : withPeople!.hashCode) + - (withStacked == null ? 0 : withStacked!.hashCode); - - @override - String toString() => 'MetadataSearchDto[albumIds=$albumIds, checksum=$checksum, city=$city, country=$country, createdAfter=$createdAfter, createdBefore=$createdBefore, description=$description, deviceAssetId=$deviceAssetId, deviceId=$deviceId, encodedVideoPath=$encodedVideoPath, id=$id, isEncoded=$isEncoded, isFavorite=$isFavorite, isMotion=$isMotion, isNotInAlbum=$isNotInAlbum, isOffline=$isOffline, lensModel=$lensModel, libraryId=$libraryId, make=$make, model=$model, ocr=$ocr, order=$order, originalFileName=$originalFileName, originalPath=$originalPath, page=$page, personIds=$personIds, previewPath=$previewPath, rating=$rating, size=$size, state=$state, tagIds=$tagIds, takenAfter=$takenAfter, takenBefore=$takenBefore, thumbnailPath=$thumbnailPath, trashedAfter=$trashedAfter, trashedBefore=$trashedBefore, type=$type, updatedAfter=$updatedAfter, updatedBefore=$updatedBefore, visibility=$visibility, withDeleted=$withDeleted, withExif=$withExif, withPeople=$withPeople, withStacked=$withStacked]'; - - Map toJson() { - final json = {}; - json[r'albumIds'] = this.albumIds; - if (this.checksum != null) { - json[r'checksum'] = this.checksum; - } else { - // json[r'checksum'] = null; - } - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.createdAfter != null) { - json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); - } else { - // json[r'createdAfter'] = null; - } - if (this.createdBefore != null) { - json[r'createdBefore'] = this.createdBefore!.toUtc().toIso8601String(); - } else { - // json[r'createdBefore'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.deviceAssetId != null) { - json[r'deviceAssetId'] = this.deviceAssetId; - } else { - // json[r'deviceAssetId'] = null; - } - if (this.deviceId != null) { - json[r'deviceId'] = this.deviceId; - } else { - // json[r'deviceId'] = null; - } - if (this.encodedVideoPath != null) { - json[r'encodedVideoPath'] = this.encodedVideoPath; - } else { - // json[r'encodedVideoPath'] = null; - } - if (this.id != null) { - json[r'id'] = this.id; - } else { - // json[r'id'] = null; - } - if (this.isEncoded != null) { - json[r'isEncoded'] = this.isEncoded; - } else { - // json[r'isEncoded'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isMotion != null) { - json[r'isMotion'] = this.isMotion; - } else { - // json[r'isMotion'] = null; - } - if (this.isNotInAlbum != null) { - json[r'isNotInAlbum'] = this.isNotInAlbum; - } else { - // json[r'isNotInAlbum'] = null; - } - if (this.isOffline != null) { - json[r'isOffline'] = this.isOffline; - } else { - // json[r'isOffline'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.ocr != null) { - json[r'ocr'] = this.ocr; - } else { - // json[r'ocr'] = null; - } - json[r'order'] = this.order; - if (this.originalFileName != null) { - json[r'originalFileName'] = this.originalFileName; - } else { - // json[r'originalFileName'] = null; - } - if (this.originalPath != null) { - json[r'originalPath'] = this.originalPath; - } else { - // json[r'originalPath'] = null; - } - if (this.page != null) { - json[r'page'] = this.page; - } else { - // json[r'page'] = null; - } - json[r'personIds'] = this.personIds; - if (this.previewPath != null) { - json[r'previewPath'] = this.previewPath; - } else { - // json[r'previewPath'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.size != null) { - json[r'size'] = this.size; - } else { - // json[r'size'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.tagIds != null) { - json[r'tagIds'] = this.tagIds; - } else { - // json[r'tagIds'] = null; - } - if (this.takenAfter != null) { - json[r'takenAfter'] = this.takenAfter!.toUtc().toIso8601String(); - } else { - // json[r'takenAfter'] = null; - } - if (this.takenBefore != null) { - json[r'takenBefore'] = this.takenBefore!.toUtc().toIso8601String(); - } else { - // json[r'takenBefore'] = null; - } - if (this.thumbnailPath != null) { - json[r'thumbnailPath'] = this.thumbnailPath; - } else { - // json[r'thumbnailPath'] = null; - } - if (this.trashedAfter != null) { - json[r'trashedAfter'] = this.trashedAfter!.toUtc().toIso8601String(); - } else { - // json[r'trashedAfter'] = null; - } - if (this.trashedBefore != null) { - json[r'trashedBefore'] = this.trashedBefore!.toUtc().toIso8601String(); - } else { - // json[r'trashedBefore'] = null; - } - if (this.type != null) { - json[r'type'] = this.type; - } else { - // json[r'type'] = null; - } - if (this.updatedAfter != null) { - json[r'updatedAfter'] = this.updatedAfter!.toUtc().toIso8601String(); - } else { - // json[r'updatedAfter'] = null; - } - if (this.updatedBefore != null) { - json[r'updatedBefore'] = this.updatedBefore!.toUtc().toIso8601String(); - } else { - // json[r'updatedBefore'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - if (this.withDeleted != null) { - json[r'withDeleted'] = this.withDeleted; - } else { - // json[r'withDeleted'] = null; - } - if (this.withExif != null) { - json[r'withExif'] = this.withExif; - } else { - // json[r'withExif'] = null; - } - if (this.withPeople != null) { - json[r'withPeople'] = this.withPeople; - } else { - // json[r'withPeople'] = null; - } - if (this.withStacked != null) { - json[r'withStacked'] = this.withStacked; - } else { - // json[r'withStacked'] = null; - } - return json; - } - - /// Returns a new [MetadataSearchDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MetadataSearchDto? fromJson(dynamic value) { - upgradeDto(value, "MetadataSearchDto"); - if (value is Map) { - final json = value.cast(); - - return MetadataSearchDto( - albumIds: json[r'albumIds'] is Iterable - ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) - : const [], - checksum: mapValueOfType(json, r'checksum'), - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), - description: mapValueOfType(json, r'description'), - deviceAssetId: mapValueOfType(json, r'deviceAssetId'), - deviceId: mapValueOfType(json, r'deviceId'), - encodedVideoPath: mapValueOfType(json, r'encodedVideoPath'), - id: mapValueOfType(json, r'id'), - isEncoded: mapValueOfType(json, r'isEncoded'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isMotion: mapValueOfType(json, r'isMotion'), - isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), - isOffline: mapValueOfType(json, r'isOffline'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - ocr: mapValueOfType(json, r'ocr'), - order: AssetOrder.fromJson(json[r'order']) ?? AssetOrder.desc, - originalFileName: mapValueOfType(json, r'originalFileName'), - originalPath: mapValueOfType(json, r'originalPath'), - page: num.parse('${json[r'page']}'), - personIds: json[r'personIds'] is Iterable - ? (json[r'personIds'] as Iterable).cast().toList(growable: false) - : const [], - previewPath: mapValueOfType(json, r'previewPath'), - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), - tagIds: json[r'tagIds'] is Iterable - ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) - : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - thumbnailPath: mapValueOfType(json, r'thumbnailPath'), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), - type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), - visibility: AssetVisibility.fromJson(json[r'visibility']), - withDeleted: mapValueOfType(json, r'withDeleted'), - withExif: mapValueOfType(json, r'withExif'), - withPeople: mapValueOfType(json, r'withPeople'), - withStacked: mapValueOfType(json, r'withStacked'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MetadataSearchDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MetadataSearchDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MetadataSearchDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MetadataSearchDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/mirror_axis.dart b/mobile/openapi/lib/model/mirror_axis.dart deleted file mode 100644 index 4deeeb047c..0000000000 --- a/mobile/openapi/lib/model/mirror_axis.dart +++ /dev/null @@ -1,85 +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; - -/// Axis to mirror along -class MirrorAxis { - /// Instantiate a new enum with the provided [value]. - const MirrorAxis._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const horizontal = MirrorAxis._(r'horizontal'); - static const vertical = MirrorAxis._(r'vertical'); - - /// List of all possible values in this [enum][MirrorAxis]. - static const values = [ - horizontal, - vertical, - ]; - - static MirrorAxis? fromJson(dynamic value) => MirrorAxisTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MirrorAxis.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [MirrorAxis] to String, -/// and [decode] dynamic data back to [MirrorAxis]. -class MirrorAxisTypeTransformer { - factory MirrorAxisTypeTransformer() => _instance ??= const MirrorAxisTypeTransformer._(); - - const MirrorAxisTypeTransformer._(); - - String encode(MirrorAxis data) => data.value; - - /// Decodes a [dynamic value][data] to a MirrorAxis. - /// - /// 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. - MirrorAxis? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'horizontal': return MirrorAxis.horizontal; - case r'vertical': return MirrorAxis.vertical; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [MirrorAxisTypeTransformer] instance. - static MirrorAxisTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/mirror_parameters.dart b/mobile/openapi/lib/model/mirror_parameters.dart deleted file mode 100644 index e8b8db685b..0000000000 --- a/mobile/openapi/lib/model/mirror_parameters.dart +++ /dev/null @@ -1,100 +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 MirrorParameters { - /// Returns a new [MirrorParameters] instance. - MirrorParameters({ - required this.axis, - }); - - /// Axis to mirror along - MirrorAxis axis; - - @override - bool operator ==(Object other) => identical(this, other) || other is MirrorParameters && - other.axis == axis; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (axis.hashCode); - - @override - String toString() => 'MirrorParameters[axis=$axis]'; - - Map toJson() { - final json = {}; - json[r'axis'] = this.axis; - return json; - } - - /// Returns a new [MirrorParameters] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static MirrorParameters? fromJson(dynamic value) { - upgradeDto(value, "MirrorParameters"); - if (value is Map) { - final json = value.cast(); - - return MirrorParameters( - axis: MirrorAxis.fromJson(json[r'axis'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = MirrorParameters.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = MirrorParameters.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of MirrorParameters-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = MirrorParameters.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'axis', - }; -} - diff --git a/mobile/openapi/lib/model/notification_create_dto.dart b/mobile/openapi/lib/model/notification_create_dto.dart deleted file mode 100644 index 1288da8670..0000000000 --- a/mobile/openapi/lib/model/notification_create_dto.dart +++ /dev/null @@ -1,187 +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 NotificationCreateDto { - /// Returns a new [NotificationCreateDto] instance. - NotificationCreateDto({ - this.data, - this.description, - this.level, - this.readAt, - required this.title, - this.type, - required this.userId, - }); - - /// Additional notification data - /// - /// 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. - /// - Object? data; - - /// Notification description - String? description; - - /// Notification level - /// - /// 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. - /// - NotificationLevel? level; - - /// Date when notification was read - DateTime? readAt; - - /// Notification title - String title; - - /// Notification type - /// - /// 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. - /// - NotificationType? type; - - /// User ID to send notification to - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is NotificationCreateDto && - other.data == data && - other.description == description && - other.level == level && - other.readAt == readAt && - other.title == title && - other.type == type && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (data == null ? 0 : data!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (level == null ? 0 : level!.hashCode) + - (readAt == null ? 0 : readAt!.hashCode) + - (title.hashCode) + - (type == null ? 0 : type!.hashCode) + - (userId.hashCode); - - @override - String toString() => 'NotificationCreateDto[data=$data, description=$description, level=$level, readAt=$readAt, title=$title, type=$type, userId=$userId]'; - - Map toJson() { - final json = {}; - if (this.data != null) { - json[r'data'] = this.data; - } else { - // json[r'data'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.level != null) { - json[r'level'] = this.level; - } else { - // json[r'level'] = null; - } - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); - } else { - // json[r'readAt'] = null; - } - json[r'title'] = this.title; - if (this.type != null) { - json[r'type'] = this.type; - } else { - // json[r'type'] = null; - } - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [NotificationCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static NotificationCreateDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationCreateDto"); - if (value is Map) { - final json = value.cast(); - - return NotificationCreateDto( - data: mapValueOfType(json, r'data'), - description: mapValueOfType(json, r'description'), - level: NotificationLevel.fromJson(json[r'level']), - readAt: mapDateTime(json, r'readAt', r''), - title: mapValueOfType(json, r'title')!, - type: NotificationType.fromJson(json[r'type']), - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = NotificationCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of NotificationCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = NotificationCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'title', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/notification_delete_all_dto.dart b/mobile/openapi/lib/model/notification_delete_all_dto.dart deleted file mode 100644 index 1b398a4f33..0000000000 --- a/mobile/openapi/lib/model/notification_delete_all_dto.dart +++ /dev/null @@ -1,102 +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 NotificationDeleteAllDto { - /// Returns a new [NotificationDeleteAllDto] instance. - NotificationDeleteAllDto({ - this.ids = const [], - }); - - /// Notification IDs to delete - List ids; - - @override - bool operator ==(Object other) => identical(this, other) || other is NotificationDeleteAllDto && - _deepEquality.equals(other.ids, ids); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (ids.hashCode); - - @override - String toString() => 'NotificationDeleteAllDto[ids=$ids]'; - - Map toJson() { - final json = {}; - json[r'ids'] = this.ids; - return json; - } - - /// Returns a new [NotificationDeleteAllDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static NotificationDeleteAllDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationDeleteAllDto"); - if (value is Map) { - final json = value.cast(); - - return NotificationDeleteAllDto( - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationDeleteAllDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = NotificationDeleteAllDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of NotificationDeleteAllDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = NotificationDeleteAllDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/notification_dto.dart b/mobile/openapi/lib/model/notification_dto.dart deleted file mode 100644 index 30d43de115..0000000000 --- a/mobile/openapi/lib/model/notification_dto.dart +++ /dev/null @@ -1,190 +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 NotificationDto { - /// Returns a new [NotificationDto] instance. - NotificationDto({ - required this.createdAt, - this.data, - this.description, - required this.id, - required this.level, - this.readAt, - required this.title, - required this.type, - }); - - /// Creation date - DateTime createdAt; - - /// Additional notification data - /// - /// 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. - /// - Object? data; - - /// Notification description - /// - /// 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? description; - - /// Notification ID - String id; - - /// Notification level - NotificationLevel level; - - /// Date when notification was read - /// - /// 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? readAt; - - /// Notification title - String title; - - /// Notification type - NotificationType type; - - @override - bool operator ==(Object other) => identical(this, other) || other is NotificationDto && - other.createdAt == createdAt && - other.data == data && - other.description == description && - other.id == id && - other.level == level && - other.readAt == readAt && - other.title == title && - other.type == type; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (createdAt.hashCode) + - (data == null ? 0 : data!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (id.hashCode) + - (level.hashCode) + - (readAt == null ? 0 : readAt!.hashCode) + - (title.hashCode) + - (type.hashCode); - - @override - String toString() => 'NotificationDto[createdAt=$createdAt, data=$data, description=$description, id=$id, level=$level, readAt=$readAt, title=$title, type=$type]'; - - Map toJson() { - final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.data != null) { - json[r'data'] = this.data; - } else { - // json[r'data'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - json[r'id'] = this.id; - json[r'level'] = this.level; - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); - } else { - // json[r'readAt'] = null; - } - json[r'title'] = this.title; - json[r'type'] = this.type; - return json; - } - - /// Returns a new [NotificationDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static NotificationDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationDto"); - if (value is Map) { - final json = value.cast(); - - return NotificationDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, - data: mapValueOfType(json, r'data'), - description: mapValueOfType(json, r'description'), - id: mapValueOfType(json, r'id')!, - level: NotificationLevel.fromJson(json[r'level'])!, - readAt: mapDateTime(json, r'readAt', r''), - title: mapValueOfType(json, r'title')!, - type: NotificationType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = NotificationDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of NotificationDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = NotificationDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'id', - 'level', - 'title', - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/notification_level.dart b/mobile/openapi/lib/model/notification_level.dart deleted file mode 100644 index 554863ae4f..0000000000 --- a/mobile/openapi/lib/model/notification_level.dart +++ /dev/null @@ -1,91 +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 NotificationLevel { - /// Instantiate a new enum with the provided [value]. - const NotificationLevel._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const success = NotificationLevel._(r'success'); - static const error = NotificationLevel._(r'error'); - static const warning = NotificationLevel._(r'warning'); - static const info = NotificationLevel._(r'info'); - - /// List of all possible values in this [enum][NotificationLevel]. - static const values = [ - success, - error, - warning, - info, - ]; - - static NotificationLevel? fromJson(dynamic value) => NotificationLevelTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationLevel.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [NotificationLevel] to String, -/// and [decode] dynamic data back to [NotificationLevel]. -class NotificationLevelTypeTransformer { - factory NotificationLevelTypeTransformer() => _instance ??= const NotificationLevelTypeTransformer._(); - - const NotificationLevelTypeTransformer._(); - - String encode(NotificationLevel data) => data.value; - - /// Decodes a [dynamic value][data] to a NotificationLevel. - /// - /// 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. - NotificationLevel? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'success': return NotificationLevel.success; - case r'error': return NotificationLevel.error; - case r'warning': return NotificationLevel.warning; - case r'info': return NotificationLevel.info; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [NotificationLevelTypeTransformer] instance. - static NotificationLevelTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/notification_type.dart b/mobile/openapi/lib/model/notification_type.dart deleted file mode 100644 index b5885aa441..0000000000 --- a/mobile/openapi/lib/model/notification_type.dart +++ /dev/null @@ -1,97 +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 NotificationType { - /// Instantiate a new enum with the provided [value]. - const NotificationType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const jobFailed = NotificationType._(r'JobFailed'); - static const backupFailed = NotificationType._(r'BackupFailed'); - static const systemMessage = NotificationType._(r'SystemMessage'); - static const albumInvite = NotificationType._(r'AlbumInvite'); - static const albumUpdate = NotificationType._(r'AlbumUpdate'); - static const custom = NotificationType._(r'Custom'); - - /// List of all possible values in this [enum][NotificationType]. - static const values = [ - jobFailed, - backupFailed, - systemMessage, - albumInvite, - albumUpdate, - custom, - ]; - - static NotificationType? fromJson(dynamic value) => NotificationTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [NotificationType] to String, -/// and [decode] dynamic data back to [NotificationType]. -class NotificationTypeTypeTransformer { - factory NotificationTypeTypeTransformer() => _instance ??= const NotificationTypeTypeTransformer._(); - - const NotificationTypeTypeTransformer._(); - - String encode(NotificationType data) => data.value; - - /// Decodes a [dynamic value][data] to a NotificationType. - /// - /// 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. - NotificationType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'JobFailed': return NotificationType.jobFailed; - case r'BackupFailed': return NotificationType.backupFailed; - case r'SystemMessage': return NotificationType.systemMessage; - case r'AlbumInvite': return NotificationType.albumInvite; - case r'AlbumUpdate': return NotificationType.albumUpdate; - case r'Custom': return NotificationType.custom; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [NotificationTypeTypeTransformer] instance. - static NotificationTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/notification_update_all_dto.dart b/mobile/openapi/lib/model/notification_update_all_dto.dart deleted file mode 100644 index a157058324..0000000000 --- a/mobile/openapi/lib/model/notification_update_all_dto.dart +++ /dev/null @@ -1,114 +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 NotificationUpdateAllDto { - /// Returns a new [NotificationUpdateAllDto] instance. - NotificationUpdateAllDto({ - this.ids = const [], - this.readAt, - }); - - /// Notification IDs to update - List ids; - - /// Date when notifications were read - DateTime? readAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateAllDto && - _deepEquality.equals(other.ids, ids) && - other.readAt == readAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (ids.hashCode) + - (readAt == null ? 0 : readAt!.hashCode); - - @override - String toString() => 'NotificationUpdateAllDto[ids=$ids, readAt=$readAt]'; - - Map toJson() { - final json = {}; - json[r'ids'] = this.ids; - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); - } else { - // json[r'readAt'] = null; - } - return json; - } - - /// Returns a new [NotificationUpdateAllDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static NotificationUpdateAllDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationUpdateAllDto"); - if (value is Map) { - final json = value.cast(); - - return NotificationUpdateAllDto( - ids: json[r'ids'] is Iterable - ? (json[r'ids'] as Iterable).cast().toList(growable: false) - : const [], - readAt: mapDateTime(json, r'readAt', r''), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationUpdateAllDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = NotificationUpdateAllDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of NotificationUpdateAllDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = NotificationUpdateAllDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ids', - }; -} - diff --git a/mobile/openapi/lib/model/notification_update_dto.dart b/mobile/openapi/lib/model/notification_update_dto.dart deleted file mode 100644 index eddf9c7e12..0000000000 --- a/mobile/openapi/lib/model/notification_update_dto.dart +++ /dev/null @@ -1,103 +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 NotificationUpdateDto { - /// Returns a new [NotificationUpdateDto] instance. - NotificationUpdateDto({ - this.readAt, - }); - - /// Date when notification was read - DateTime? readAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto && - other.readAt == readAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (readAt == null ? 0 : readAt!.hashCode); - - @override - String toString() => 'NotificationUpdateDto[readAt=$readAt]'; - - Map toJson() { - final json = {}; - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); - } else { - // json[r'readAt'] = null; - } - return json; - } - - /// Returns a new [NotificationUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static NotificationUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "NotificationUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return NotificationUpdateDto( - readAt: mapDateTime(json, r'readAt', r''), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = NotificationUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = NotificationUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of NotificationUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = NotificationUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart b/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart deleted file mode 100644 index 7eedc45673..0000000000 --- a/mobile/openapi/lib/model/o_auth_authorize_response_dto.dart +++ /dev/null @@ -1,100 +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 OAuthAuthorizeResponseDto { - /// Returns a new [OAuthAuthorizeResponseDto] instance. - OAuthAuthorizeResponseDto({ - required this.url, - }); - - /// OAuth authorization URL - String url; - - @override - bool operator ==(Object other) => identical(this, other) || other is OAuthAuthorizeResponseDto && - other.url == url; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (url.hashCode); - - @override - String toString() => 'OAuthAuthorizeResponseDto[url=$url]'; - - Map toJson() { - final json = {}; - json[r'url'] = this.url; - return json; - } - - /// Returns a new [OAuthAuthorizeResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OAuthAuthorizeResponseDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthAuthorizeResponseDto"); - if (value is Map) { - final json = value.cast(); - - return OAuthAuthorizeResponseDto( - url: mapValueOfType(json, r'url')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OAuthAuthorizeResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OAuthAuthorizeResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OAuthAuthorizeResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OAuthAuthorizeResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'url', - }; -} - diff --git a/mobile/openapi/lib/model/o_auth_callback_dto.dart b/mobile/openapi/lib/model/o_auth_callback_dto.dart deleted file mode 100644 index d94374935a..0000000000 --- a/mobile/openapi/lib/model/o_auth_callback_dto.dart +++ /dev/null @@ -1,136 +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 OAuthCallbackDto { - /// Returns a new [OAuthCallbackDto] instance. - OAuthCallbackDto({ - this.codeVerifier, - this.state, - required this.url, - }); - - /// OAuth code verifier (PKCE) - /// - /// 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? codeVerifier; - - /// OAuth state parameter - /// - /// 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? state; - - /// OAuth callback URL - String url; - - @override - bool operator ==(Object other) => identical(this, other) || other is OAuthCallbackDto && - other.codeVerifier == codeVerifier && - other.state == state && - other.url == url; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (codeVerifier == null ? 0 : codeVerifier!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (url.hashCode); - - @override - String toString() => 'OAuthCallbackDto[codeVerifier=$codeVerifier, state=$state, url=$url]'; - - Map toJson() { - final json = {}; - if (this.codeVerifier != null) { - json[r'codeVerifier'] = this.codeVerifier; - } else { - // json[r'codeVerifier'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - json[r'url'] = this.url; - return json; - } - - /// Returns a new [OAuthCallbackDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OAuthCallbackDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthCallbackDto"); - if (value is Map) { - final json = value.cast(); - - return OAuthCallbackDto( - codeVerifier: mapValueOfType(json, r'codeVerifier'), - state: mapValueOfType(json, r'state'), - url: mapValueOfType(json, r'url')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OAuthCallbackDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OAuthCallbackDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OAuthCallbackDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OAuthCallbackDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'url', - }; -} - diff --git a/mobile/openapi/lib/model/o_auth_config_dto.dart b/mobile/openapi/lib/model/o_auth_config_dto.dart deleted file mode 100644 index 1c9ce8d5b8..0000000000 --- a/mobile/openapi/lib/model/o_auth_config_dto.dart +++ /dev/null @@ -1,136 +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 OAuthConfigDto { - /// Returns a new [OAuthConfigDto] instance. - OAuthConfigDto({ - this.codeChallenge, - required this.redirectUri, - this.state, - }); - - /// OAuth code challenge (PKCE) - /// - /// 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? codeChallenge; - - /// OAuth redirect URI - String redirectUri; - - /// OAuth state parameter - /// - /// 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? state; - - @override - bool operator ==(Object other) => identical(this, other) || other is OAuthConfigDto && - other.codeChallenge == codeChallenge && - other.redirectUri == redirectUri && - other.state == state; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (codeChallenge == null ? 0 : codeChallenge!.hashCode) + - (redirectUri.hashCode) + - (state == null ? 0 : state!.hashCode); - - @override - String toString() => 'OAuthConfigDto[codeChallenge=$codeChallenge, redirectUri=$redirectUri, state=$state]'; - - Map toJson() { - final json = {}; - if (this.codeChallenge != null) { - json[r'codeChallenge'] = this.codeChallenge; - } else { - // json[r'codeChallenge'] = null; - } - json[r'redirectUri'] = this.redirectUri; - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - return json; - } - - /// Returns a new [OAuthConfigDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OAuthConfigDto? fromJson(dynamic value) { - upgradeDto(value, "OAuthConfigDto"); - if (value is Map) { - final json = value.cast(); - - return OAuthConfigDto( - codeChallenge: mapValueOfType(json, r'codeChallenge'), - redirectUri: mapValueOfType(json, r'redirectUri')!, - state: mapValueOfType(json, r'state'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OAuthConfigDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OAuthConfigDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OAuthConfigDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OAuthConfigDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'redirectUri', - }; -} - diff --git a/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart b/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart deleted file mode 100644 index 77466d61d9..0000000000 --- a/mobile/openapi/lib/model/o_auth_token_endpoint_auth_method.dart +++ /dev/null @@ -1,85 +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; - -/// Token endpoint auth method -class OAuthTokenEndpointAuthMethod { - /// Instantiate a new enum with the provided [value]. - const OAuthTokenEndpointAuthMethod._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const post = OAuthTokenEndpointAuthMethod._(r'client_secret_post'); - static const basic = OAuthTokenEndpointAuthMethod._(r'client_secret_basic'); - - /// List of all possible values in this [enum][OAuthTokenEndpointAuthMethod]. - static const values = [ - post, - basic, - ]; - - static OAuthTokenEndpointAuthMethod? fromJson(dynamic value) => OAuthTokenEndpointAuthMethodTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OAuthTokenEndpointAuthMethod.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [OAuthTokenEndpointAuthMethod] to String, -/// and [decode] dynamic data back to [OAuthTokenEndpointAuthMethod]. -class OAuthTokenEndpointAuthMethodTypeTransformer { - factory OAuthTokenEndpointAuthMethodTypeTransformer() => _instance ??= const OAuthTokenEndpointAuthMethodTypeTransformer._(); - - const OAuthTokenEndpointAuthMethodTypeTransformer._(); - - String encode(OAuthTokenEndpointAuthMethod data) => data.value; - - /// Decodes a [dynamic value][data] to a OAuthTokenEndpointAuthMethod. - /// - /// 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. - OAuthTokenEndpointAuthMethod? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'client_secret_post': return OAuthTokenEndpointAuthMethod.post; - case r'client_secret_basic': return OAuthTokenEndpointAuthMethod.basic; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [OAuthTokenEndpointAuthMethodTypeTransformer] instance. - static OAuthTokenEndpointAuthMethodTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/ocr_config.dart b/mobile/openapi/lib/model/ocr_config.dart deleted file mode 100644 index d97cd5ffca..0000000000 --- a/mobile/openapi/lib/model/ocr_config.dart +++ /dev/null @@ -1,144 +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 OcrConfig { - /// Returns a new [OcrConfig] instance. - OcrConfig({ - required this.enabled, - required this.maxResolution, - required this.minDetectionScore, - required this.minRecognitionScore, - required this.modelName, - }); - - /// Whether the task is enabled - bool enabled; - - /// Maximum resolution for OCR processing - /// - /// Minimum value: 1 - int maxResolution; - - /// Minimum confidence score for text detection - /// - /// Minimum value: 0.1 - /// Maximum value: 1 - double minDetectionScore; - - /// Minimum confidence score for text recognition - /// - /// Minimum value: 0.1 - /// Maximum value: 1 - double minRecognitionScore; - - /// Name of the model to use - String modelName; - - @override - bool operator ==(Object other) => identical(this, other) || other is OcrConfig && - other.enabled == enabled && - other.maxResolution == maxResolution && - other.minDetectionScore == minDetectionScore && - other.minRecognitionScore == minRecognitionScore && - other.modelName == modelName; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (maxResolution.hashCode) + - (minDetectionScore.hashCode) + - (minRecognitionScore.hashCode) + - (modelName.hashCode); - - @override - String toString() => 'OcrConfig[enabled=$enabled, maxResolution=$maxResolution, minDetectionScore=$minDetectionScore, minRecognitionScore=$minRecognitionScore, modelName=$modelName]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'maxResolution'] = this.maxResolution; - json[r'minDetectionScore'] = this.minDetectionScore; - json[r'minRecognitionScore'] = this.minRecognitionScore; - json[r'modelName'] = this.modelName; - return json; - } - - /// Returns a new [OcrConfig] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OcrConfig? fromJson(dynamic value) { - upgradeDto(value, "OcrConfig"); - if (value is Map) { - final json = value.cast(); - - return OcrConfig( - enabled: mapValueOfType(json, r'enabled')!, - maxResolution: mapValueOfType(json, r'maxResolution')!, - minDetectionScore: (mapValueOfType(json, r'minDetectionScore')!).toDouble(), - minRecognitionScore: (mapValueOfType(json, r'minRecognitionScore')!).toDouble(), - modelName: mapValueOfType(json, r'modelName')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OcrConfig.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OcrConfig.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OcrConfig-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OcrConfig.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'maxResolution', - 'minDetectionScore', - 'minRecognitionScore', - 'modelName', - }; -} - diff --git a/mobile/openapi/lib/model/on_this_day_dto.dart b/mobile/openapi/lib/model/on_this_day_dto.dart deleted file mode 100644 index 93ec956f58..0000000000 --- a/mobile/openapi/lib/model/on_this_day_dto.dart +++ /dev/null @@ -1,102 +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 OnThisDayDto { - /// Returns a new [OnThisDayDto] instance. - OnThisDayDto({ - required this.year, - }); - - /// Year for on this day memory - /// - /// Minimum value: 1 - num year; - - @override - bool operator ==(Object other) => identical(this, other) || other is OnThisDayDto && - other.year == year; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (year.hashCode); - - @override - String toString() => 'OnThisDayDto[year=$year]'; - - Map toJson() { - final json = {}; - json[r'year'] = this.year; - return json; - } - - /// Returns a new [OnThisDayDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OnThisDayDto? fromJson(dynamic value) { - upgradeDto(value, "OnThisDayDto"); - if (value is Map) { - final json = value.cast(); - - return OnThisDayDto( - year: num.parse('${json[r'year']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OnThisDayDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OnThisDayDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OnThisDayDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OnThisDayDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'year', - }; -} - diff --git a/mobile/openapi/lib/model/onboarding_dto.dart b/mobile/openapi/lib/model/onboarding_dto.dart deleted file mode 100644 index 8499bc9b9a..0000000000 --- a/mobile/openapi/lib/model/onboarding_dto.dart +++ /dev/null @@ -1,100 +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 OnboardingDto { - /// Returns a new [OnboardingDto] instance. - OnboardingDto({ - required this.isOnboarded, - }); - - /// Is user onboarded - bool isOnboarded; - - @override - bool operator ==(Object other) => identical(this, other) || other is OnboardingDto && - other.isOnboarded == isOnboarded; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isOnboarded.hashCode); - - @override - String toString() => 'OnboardingDto[isOnboarded=$isOnboarded]'; - - Map toJson() { - final json = {}; - json[r'isOnboarded'] = this.isOnboarded; - return json; - } - - /// Returns a new [OnboardingDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OnboardingDto? fromJson(dynamic value) { - upgradeDto(value, "OnboardingDto"); - if (value is Map) { - final json = value.cast(); - - return OnboardingDto( - isOnboarded: mapValueOfType(json, r'isOnboarded')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OnboardingDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OnboardingDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OnboardingDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OnboardingDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'isOnboarded', - }; -} - diff --git a/mobile/openapi/lib/model/onboarding_response_dto.dart b/mobile/openapi/lib/model/onboarding_response_dto.dart deleted file mode 100644 index 2b0dbe2b96..0000000000 --- a/mobile/openapi/lib/model/onboarding_response_dto.dart +++ /dev/null @@ -1,100 +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 OnboardingResponseDto { - /// Returns a new [OnboardingResponseDto] instance. - OnboardingResponseDto({ - required this.isOnboarded, - }); - - /// Is user onboarded - bool isOnboarded; - - @override - bool operator ==(Object other) => identical(this, other) || other is OnboardingResponseDto && - other.isOnboarded == isOnboarded; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isOnboarded.hashCode); - - @override - String toString() => 'OnboardingResponseDto[isOnboarded=$isOnboarded]'; - - Map toJson() { - final json = {}; - json[r'isOnboarded'] = this.isOnboarded; - return json; - } - - /// Returns a new [OnboardingResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static OnboardingResponseDto? fromJson(dynamic value) { - upgradeDto(value, "OnboardingResponseDto"); - if (value is Map) { - final json = value.cast(); - - return OnboardingResponseDto( - isOnboarded: mapValueOfType(json, r'isOnboarded')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = OnboardingResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = OnboardingResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of OnboardingResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = OnboardingResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'isOnboarded', - }; -} - diff --git a/mobile/openapi/lib/model/partner_create_dto.dart b/mobile/openapi/lib/model/partner_create_dto.dart deleted file mode 100644 index 30aa96ff30..0000000000 --- a/mobile/openapi/lib/model/partner_create_dto.dart +++ /dev/null @@ -1,100 +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 PartnerCreateDto { - /// Returns a new [PartnerCreateDto] instance. - PartnerCreateDto({ - required this.sharedWithId, - }); - - /// User ID to share with - String sharedWithId; - - @override - bool operator ==(Object other) => identical(this, other) || other is PartnerCreateDto && - other.sharedWithId == sharedWithId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (sharedWithId.hashCode); - - @override - String toString() => 'PartnerCreateDto[sharedWithId=$sharedWithId]'; - - Map toJson() { - final json = {}; - json[r'sharedWithId'] = this.sharedWithId; - return json; - } - - /// Returns a new [PartnerCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PartnerCreateDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerCreateDto"); - if (value is Map) { - final json = value.cast(); - - return PartnerCreateDto( - sharedWithId: mapValueOfType(json, r'sharedWithId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PartnerCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PartnerCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PartnerCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PartnerCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'sharedWithId', - }; -} - diff --git a/mobile/openapi/lib/model/partner_direction.dart b/mobile/openapi/lib/model/partner_direction.dart deleted file mode 100644 index c43c0df75d..0000000000 --- a/mobile/openapi/lib/model/partner_direction.dart +++ /dev/null @@ -1,85 +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 PartnerDirection { - /// Instantiate a new enum with the provided [value]. - const PartnerDirection._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const by = PartnerDirection._(r'shared-by'); - static const with_ = PartnerDirection._(r'shared-with'); - - /// List of all possible values in this [enum][PartnerDirection]. - static const values = [ - by, - with_, - ]; - - static PartnerDirection? fromJson(dynamic value) => PartnerDirectionTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PartnerDirection.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [PartnerDirection] to String, -/// and [decode] dynamic data back to [PartnerDirection]. -class PartnerDirectionTypeTransformer { - factory PartnerDirectionTypeTransformer() => _instance ??= const PartnerDirectionTypeTransformer._(); - - const PartnerDirectionTypeTransformer._(); - - String encode(PartnerDirection data) => data.value; - - /// Decodes a [dynamic value][data] to a PartnerDirection. - /// - /// 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. - PartnerDirection? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'shared-by': return PartnerDirection.by; - case r'shared-with': return PartnerDirection.with_; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [PartnerDirectionTypeTransformer] instance. - static PartnerDirectionTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/partner_response_dto.dart b/mobile/openapi/lib/model/partner_response_dto.dart deleted file mode 100644 index 5789938d18..0000000000 --- a/mobile/openapi/lib/model/partner_response_dto.dart +++ /dev/null @@ -1,163 +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 PartnerResponseDto { - /// Returns a new [PartnerResponseDto] instance. - PartnerResponseDto({ - required this.avatarColor, - required this.email, - required this.id, - this.inTimeline, - required this.name, - required this.profileChangedAt, - required this.profileImagePath, - }); - - /// Avatar color - UserAvatarColor avatarColor; - - /// User email - String email; - - /// User ID - String id; - - /// Show in timeline - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? inTimeline; - - /// User name - String name; - - /// Profile change date - DateTime profileChangedAt; - - /// Profile image path - String profileImagePath; - - @override - bool operator ==(Object other) => identical(this, other) || other is PartnerResponseDto && - other.avatarColor == avatarColor && - other.email == email && - other.id == id && - other.inTimeline == inTimeline && - other.name == name && - other.profileChangedAt == profileChangedAt && - other.profileImagePath == profileImagePath; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (avatarColor.hashCode) + - (email.hashCode) + - (id.hashCode) + - (inTimeline == null ? 0 : inTimeline!.hashCode) + - (name.hashCode) + - (profileChangedAt.hashCode) + - (profileImagePath.hashCode); - - @override - String toString() => 'PartnerResponseDto[avatarColor=$avatarColor, email=$email, id=$id, inTimeline=$inTimeline, name=$name, profileChangedAt=$profileChangedAt, profileImagePath=$profileImagePath]'; - - Map toJson() { - final json = {}; - json[r'avatarColor'] = this.avatarColor; - json[r'email'] = this.email; - json[r'id'] = this.id; - if (this.inTimeline != null) { - json[r'inTimeline'] = this.inTimeline; - } else { - // json[r'inTimeline'] = null; - } - json[r'name'] = this.name; - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - json[r'profileImagePath'] = this.profileImagePath; - return json; - } - - /// Returns a new [PartnerResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PartnerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PartnerResponseDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, - email: mapValueOfType(json, r'email')!, - id: mapValueOfType(json, r'id')!, - inTimeline: mapValueOfType(json, r'inTimeline'), - name: mapValueOfType(json, r'name')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - profileImagePath: mapValueOfType(json, r'profileImagePath')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PartnerResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PartnerResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PartnerResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PartnerResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'avatarColor', - 'email', - 'id', - 'name', - 'profileChangedAt', - 'profileImagePath', - }; -} - diff --git a/mobile/openapi/lib/model/partner_update_dto.dart b/mobile/openapi/lib/model/partner_update_dto.dart deleted file mode 100644 index db3516e3a1..0000000000 --- a/mobile/openapi/lib/model/partner_update_dto.dart +++ /dev/null @@ -1,100 +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 PartnerUpdateDto { - /// Returns a new [PartnerUpdateDto] instance. - PartnerUpdateDto({ - required this.inTimeline, - }); - - /// Show partner assets in timeline - bool inTimeline; - - @override - bool operator ==(Object other) => identical(this, other) || other is PartnerUpdateDto && - other.inTimeline == inTimeline; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (inTimeline.hashCode); - - @override - String toString() => 'PartnerUpdateDto[inTimeline=$inTimeline]'; - - Map toJson() { - final json = {}; - json[r'inTimeline'] = this.inTimeline; - return json; - } - - /// Returns a new [PartnerUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PartnerUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PartnerUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return PartnerUpdateDto( - inTimeline: mapValueOfType(json, r'inTimeline')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PartnerUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PartnerUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PartnerUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PartnerUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'inTimeline', - }; -} - diff --git a/mobile/openapi/lib/model/people_response.dart b/mobile/openapi/lib/model/people_response.dart deleted file mode 100644 index c09560e08c..0000000000 --- a/mobile/openapi/lib/model/people_response.dart +++ /dev/null @@ -1,109 +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 PeopleResponse { - /// Returns a new [PeopleResponse] instance. - PeopleResponse({ - this.enabled = true, - this.sidebarWeb = false, - }); - - /// Whether people are enabled - bool enabled; - - /// Whether people appear in web sidebar - bool sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is PeopleResponse && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (sidebarWeb.hashCode); - - @override - String toString() => 'PeopleResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'sidebarWeb'] = this.sidebarWeb; - return json; - } - - /// Returns a new [PeopleResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PeopleResponse? fromJson(dynamic value) { - upgradeDto(value, "PeopleResponse"); - if (value is Map) { - final json = value.cast(); - - return PeopleResponse( - enabled: mapValueOfType(json, r'enabled')!, - sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PeopleResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PeopleResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PeopleResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PeopleResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'sidebarWeb', - }; -} - diff --git a/mobile/openapi/lib/model/people_response_dto.dart b/mobile/openapi/lib/model/people_response_dto.dart deleted file mode 100644 index f345657e73..0000000000 --- a/mobile/openapi/lib/model/people_response_dto.dart +++ /dev/null @@ -1,136 +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 PeopleResponseDto { - /// Returns a new [PeopleResponseDto] instance. - PeopleResponseDto({ - this.hasNextPage, - required this.hidden, - this.people = const [], - required this.total, - }); - - /// Whether there are more pages - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? hasNextPage; - - /// Number of hidden people - int hidden; - - /// List of people - List people; - - /// Total number of people - int total; - - @override - bool operator ==(Object other) => identical(this, other) || other is PeopleResponseDto && - other.hasNextPage == hasNextPage && - other.hidden == hidden && - _deepEquality.equals(other.people, people) && - other.total == total; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (hasNextPage == null ? 0 : hasNextPage!.hashCode) + - (hidden.hashCode) + - (people.hashCode) + - (total.hashCode); - - @override - String toString() => 'PeopleResponseDto[hasNextPage=$hasNextPage, hidden=$hidden, people=$people, total=$total]'; - - Map toJson() { - final json = {}; - if (this.hasNextPage != null) { - json[r'hasNextPage'] = this.hasNextPage; - } else { - // json[r'hasNextPage'] = null; - } - json[r'hidden'] = this.hidden; - json[r'people'] = this.people; - json[r'total'] = this.total; - return json; - } - - /// Returns a new [PeopleResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PeopleResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PeopleResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PeopleResponseDto( - hasNextPage: mapValueOfType(json, r'hasNextPage'), - hidden: mapValueOfType(json, r'hidden')!, - people: PersonResponseDto.listFromJson(json[r'people']), - total: mapValueOfType(json, r'total')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PeopleResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PeopleResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PeopleResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PeopleResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'hidden', - 'people', - 'total', - }; -} - diff --git a/mobile/openapi/lib/model/people_update.dart b/mobile/openapi/lib/model/people_update.dart deleted file mode 100644 index fe16479bac..0000000000 --- a/mobile/openapi/lib/model/people_update.dart +++ /dev/null @@ -1,127 +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 PeopleUpdate { - /// Returns a new [PeopleUpdate] instance. - PeopleUpdate({ - this.enabled, - this.sidebarWeb, - }); - - /// Whether people are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Whether people appear in web sidebar - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is PeopleUpdate && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled == null ? 0 : enabled!.hashCode) + - (sidebarWeb == null ? 0 : sidebarWeb!.hashCode); - - @override - String toString() => 'PeopleUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - if (this.sidebarWeb != null) { - json[r'sidebarWeb'] = this.sidebarWeb; - } else { - // json[r'sidebarWeb'] = null; - } - return json; - } - - /// Returns a new [PeopleUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PeopleUpdate? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdate"); - if (value is Map) { - final json = value.cast(); - - return PeopleUpdate( - enabled: mapValueOfType(json, r'enabled'), - sidebarWeb: mapValueOfType(json, r'sidebarWeb'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PeopleUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PeopleUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PeopleUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PeopleUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/people_update_dto.dart b/mobile/openapi/lib/model/people_update_dto.dart deleted file mode 100644 index c9ce74d659..0000000000 --- a/mobile/openapi/lib/model/people_update_dto.dart +++ /dev/null @@ -1,100 +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 PeopleUpdateDto { - /// Returns a new [PeopleUpdateDto] instance. - PeopleUpdateDto({ - this.people = const [], - }); - - /// People to update - List people; - - @override - bool operator ==(Object other) => identical(this, other) || other is PeopleUpdateDto && - _deepEquality.equals(other.people, people); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (people.hashCode); - - @override - String toString() => 'PeopleUpdateDto[people=$people]'; - - Map toJson() { - final json = {}; - json[r'people'] = this.people; - return json; - } - - /// Returns a new [PeopleUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PeopleUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return PeopleUpdateDto( - people: PeopleUpdateItem.listFromJson(json[r'people']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PeopleUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PeopleUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PeopleUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PeopleUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'people', - }; -} - diff --git a/mobile/openapi/lib/model/people_update_item.dart b/mobile/openapi/lib/model/people_update_item.dart deleted file mode 100644 index 5e20aeb464..0000000000 --- a/mobile/openapi/lib/model/people_update_item.dart +++ /dev/null @@ -1,196 +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 PeopleUpdateItem { - /// Returns a new [PeopleUpdateItem] instance. - PeopleUpdateItem({ - this.birthDate, - this.color, - this.featureFaceAssetId, - required this.id, - this.isFavorite, - this.isHidden, - this.name, - }); - - /// Person date of birth - DateTime? birthDate; - - /// Person color (hex) - String? color; - - /// Asset ID used for feature face thumbnail - /// - /// 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? featureFaceAssetId; - - /// Person ID - String id; - - /// Mark as favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Person visibility (hidden) - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isHidden; - - /// Person name - /// - /// 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? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is PeopleUpdateItem && - other.birthDate == birthDate && - other.color == color && - other.featureFaceAssetId == featureFaceAssetId && - other.id == id && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + - (id.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isHidden == null ? 0 : isHidden!.hashCode) + - (name == null ? 0 : name!.hashCode); - - @override - String toString() => 'PeopleUpdateItem[birthDate=$birthDate, color=$color, featureFaceAssetId=$featureFaceAssetId, id=$id, isFavorite=$isFavorite, isHidden=$isHidden, name=$name]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - if (this.featureFaceAssetId != null) { - json[r'featureFaceAssetId'] = this.featureFaceAssetId; - } else { - // json[r'featureFaceAssetId'] = null; - } - json[r'id'] = this.id; - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isHidden != null) { - json[r'isHidden'] = this.isHidden; - } else { - // json[r'isHidden'] = null; - } - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - return json; - } - - /// Returns a new [PeopleUpdateItem] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PeopleUpdateItem? fromJson(dynamic value) { - upgradeDto(value, "PeopleUpdateItem"); - if (value is Map) { - final json = value.cast(); - - return PeopleUpdateItem( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - featureFaceAssetId: mapValueOfType(json, r'featureFaceAssetId'), - id: mapValueOfType(json, r'id')!, - isFavorite: mapValueOfType(json, r'isFavorite'), - isHidden: mapValueOfType(json, r'isHidden'), - name: mapValueOfType(json, r'name'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PeopleUpdateItem.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PeopleUpdateItem.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PeopleUpdateItem-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PeopleUpdateItem.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'id', - }; -} - diff --git a/mobile/openapi/lib/model/permission.dart b/mobile/openapi/lib/model/permission.dart index 9092ede786..6944b97e02 100644 --- a/mobile/openapi/lib/model/permission.dart +++ b/mobile/openapi/lib/model/permission.dart @@ -24,320 +24,48 @@ class Permission { String toJson() => value; static const all = Permission._(r'all'); - static const activityPeriodCreate = Permission._(r'activity.create'); - static const activityPeriodRead = Permission._(r'activity.read'); - static const activityPeriodUpdate = Permission._(r'activity.update'); - static const activityPeriodDelete = Permission._(r'activity.delete'); - static const activityPeriodStatistics = Permission._(r'activity.statistics'); static const apiKeyPeriodCreate = Permission._(r'apiKey.create'); static const apiKeyPeriodRead = Permission._(r'apiKey.read'); static const apiKeyPeriodUpdate = Permission._(r'apiKey.update'); static const apiKeyPeriodDelete = Permission._(r'apiKey.delete'); - static const assetPeriodRead = Permission._(r'asset.read'); - static const assetPeriodUpdate = Permission._(r'asset.update'); - static const assetPeriodDelete = Permission._(r'asset.delete'); - static const assetPeriodStatistics = Permission._(r'asset.statistics'); - static const assetPeriodShare = Permission._(r'asset.share'); - static const assetPeriodView = Permission._(r'asset.view'); - static const assetPeriodDownload = Permission._(r'asset.download'); - static const assetPeriodUpload = Permission._(r'asset.upload'); - static const assetPeriodReplace = Permission._(r'asset.replace'); - static const assetPeriodCopy = Permission._(r'asset.copy'); - static const assetPeriodDerive = Permission._(r'asset.derive'); - static const assetPeriodEditPeriodGet = Permission._(r'asset.edit.get'); - static const assetPeriodEditPeriodCreate = Permission._(r'asset.edit.create'); - static const assetPeriodEditPeriodDelete = Permission._(r'asset.edit.delete'); - static const albumPeriodCreate = Permission._(r'album.create'); - static const albumPeriodRead = Permission._(r'album.read'); - static const albumPeriodUpdate = Permission._(r'album.update'); - static const albumPeriodDelete = Permission._(r'album.delete'); - static const albumPeriodStatistics = Permission._(r'album.statistics'); - static const albumPeriodShare = Permission._(r'album.share'); - static const albumPeriodDownload = Permission._(r'album.download'); - static const albumAssetPeriodCreate = Permission._(r'albumAsset.create'); - static const albumAssetPeriodDelete = Permission._(r'albumAsset.delete'); - static const albumUserPeriodCreate = Permission._(r'albumUser.create'); - static const albumUserPeriodUpdate = Permission._(r'albumUser.update'); - static const albumUserPeriodDelete = Permission._(r'albumUser.delete'); static const authPeriodChangePassword = Permission._(r'auth.changePassword'); static const authDevicePeriodDelete = Permission._(r'authDevice.delete'); - static const archivePeriodRead = Permission._(r'archive.read'); - static const backupPeriodList = Permission._(r'backup.list'); - static const backupPeriodDownload = Permission._(r'backup.download'); - static const backupPeriodUpload = Permission._(r'backup.upload'); - static const backupPeriodDelete = Permission._(r'backup.delete'); - static const duplicatePeriodRead = Permission._(r'duplicate.read'); - static const duplicatePeriodDelete = Permission._(r'duplicate.delete'); - static const facePeriodCreate = Permission._(r'face.create'); - static const facePeriodRead = Permission._(r'face.read'); - static const facePeriodUpdate = Permission._(r'face.update'); - static const facePeriodDelete = Permission._(r'face.delete'); - static const folderPeriodRead = Permission._(r'folder.read'); - static const jobPeriodCreate = Permission._(r'job.create'); - static const jobPeriodRead = Permission._(r'job.read'); - static const libraryPeriodCreate = Permission._(r'library.create'); - static const libraryPeriodRead = Permission._(r'library.read'); - static const libraryPeriodUpdate = Permission._(r'library.update'); - static const libraryPeriodDelete = Permission._(r'library.delete'); - static const libraryPeriodStatistics = Permission._(r'library.statistics'); - static const timelinePeriodRead = Permission._(r'timeline.read'); - static const timelinePeriodDownload = Permission._(r'timeline.download'); - static const maintenance = Permission._(r'maintenance'); - static const mapPeriodRead = Permission._(r'map.read'); - static const mapPeriodSearch = Permission._(r'map.search'); - static const memoryPeriodCreate = Permission._(r'memory.create'); - static const memoryPeriodRead = Permission._(r'memory.read'); - static const memoryPeriodUpdate = Permission._(r'memory.update'); - static const memoryPeriodDelete = Permission._(r'memory.delete'); - static const memoryPeriodStatistics = Permission._(r'memory.statistics'); - static const memoryAssetPeriodCreate = Permission._(r'memoryAsset.create'); - static const memoryAssetPeriodDelete = Permission._(r'memoryAsset.delete'); - static const notificationPeriodCreate = Permission._(r'notification.create'); - static const notificationPeriodRead = Permission._(r'notification.read'); - static const notificationPeriodUpdate = Permission._(r'notification.update'); - static const notificationPeriodDelete = Permission._(r'notification.delete'); - static const partnerPeriodCreate = Permission._(r'partner.create'); - static const partnerPeriodRead = Permission._(r'partner.read'); - static const partnerPeriodUpdate = Permission._(r'partner.update'); - static const partnerPeriodDelete = Permission._(r'partner.delete'); - static const personPeriodCreate = Permission._(r'person.create'); - static const personPeriodRead = Permission._(r'person.read'); - static const personPeriodUpdate = Permission._(r'person.update'); - static const personPeriodDelete = Permission._(r'person.delete'); - static const personPeriodStatistics = Permission._(r'person.statistics'); - static const personPeriodMerge = Permission._(r'person.merge'); - static const personPeriodReassign = Permission._(r'person.reassign'); - static const pinCodePeriodCreate = Permission._(r'pinCode.create'); - static const pinCodePeriodUpdate = Permission._(r'pinCode.update'); - static const pinCodePeriodDelete = Permission._(r'pinCode.delete'); - static const pluginPeriodCreate = Permission._(r'plugin.create'); - static const pluginPeriodRead = Permission._(r'plugin.read'); - static const pluginPeriodUpdate = Permission._(r'plugin.update'); - static const pluginPeriodDelete = Permission._(r'plugin.delete'); - static const serverPeriodAbout = Permission._(r'server.about'); - static const serverPeriodApkLinks = Permission._(r'server.apkLinks'); - static const serverPeriodStorage = Permission._(r'server.storage'); - static const serverPeriodStatistics = Permission._(r'server.statistics'); - static const serverPeriodVersionCheck = Permission._(r'server.versionCheck'); - static const serverLicensePeriodRead = Permission._(r'serverLicense.read'); - static const serverLicensePeriodUpdate = Permission._(r'serverLicense.update'); - static const serverLicensePeriodDelete = Permission._(r'serverLicense.delete'); static const sessionPeriodCreate = Permission._(r'session.create'); static const sessionPeriodRead = Permission._(r'session.read'); static const sessionPeriodUpdate = Permission._(r'session.update'); static const sessionPeriodDelete = Permission._(r'session.delete'); - static const sessionPeriodLock = Permission._(r'session.lock'); - static const sharedLinkPeriodCreate = Permission._(r'sharedLink.create'); - static const sharedLinkPeriodRead = Permission._(r'sharedLink.read'); - static const sharedLinkPeriodUpdate = Permission._(r'sharedLink.update'); - static const sharedLinkPeriodDelete = Permission._(r'sharedLink.delete'); - static const stackPeriodCreate = Permission._(r'stack.create'); - static const stackPeriodRead = Permission._(r'stack.read'); - static const stackPeriodUpdate = Permission._(r'stack.update'); - static const stackPeriodDelete = Permission._(r'stack.delete'); - static const syncPeriodStream = Permission._(r'sync.stream'); - static const syncCheckpointPeriodRead = Permission._(r'syncCheckpoint.read'); - static const syncCheckpointPeriodUpdate = Permission._(r'syncCheckpoint.update'); - static const syncCheckpointPeriodDelete = Permission._(r'syncCheckpoint.delete'); - static const systemConfigPeriodRead = Permission._(r'systemConfig.read'); - static const systemConfigPeriodUpdate = Permission._(r'systemConfig.update'); static const systemMetadataPeriodRead = Permission._(r'systemMetadata.read'); static const systemMetadataPeriodUpdate = Permission._(r'systemMetadata.update'); - static const tagPeriodCreate = Permission._(r'tag.create'); - static const tagPeriodRead = Permission._(r'tag.read'); - static const tagPeriodUpdate = Permission._(r'tag.update'); - static const tagPeriodDelete = Permission._(r'tag.delete'); - static const tagPeriodAsset = Permission._(r'tag.asset'); static const userPeriodRead = Permission._(r'user.read'); static const userPeriodUpdate = Permission._(r'user.update'); - static const userLicensePeriodCreate = Permission._(r'userLicense.create'); - static const userLicensePeriodRead = Permission._(r'userLicense.read'); - static const userLicensePeriodUpdate = Permission._(r'userLicense.update'); - static const userLicensePeriodDelete = Permission._(r'userLicense.delete'); - static const userOnboardingPeriodRead = Permission._(r'userOnboarding.read'); - static const userOnboardingPeriodUpdate = Permission._(r'userOnboarding.update'); - static const userOnboardingPeriodDelete = Permission._(r'userOnboarding.delete'); - static const userPreferencePeriodRead = Permission._(r'userPreference.read'); - static const userPreferencePeriodUpdate = Permission._(r'userPreference.update'); - static const userProfileImagePeriodCreate = Permission._(r'userProfileImage.create'); - static const userProfileImagePeriodRead = Permission._(r'userProfileImage.read'); - static const userProfileImagePeriodUpdate = Permission._(r'userProfileImage.update'); - static const userProfileImagePeriodDelete = Permission._(r'userProfileImage.delete'); - static const queuePeriodRead = Permission._(r'queue.read'); - static const queuePeriodUpdate = Permission._(r'queue.update'); - static const queueJobPeriodCreate = Permission._(r'queueJob.create'); - static const queueJobPeriodRead = Permission._(r'queueJob.read'); - static const queueJobPeriodUpdate = Permission._(r'queueJob.update'); - static const queueJobPeriodDelete = Permission._(r'queueJob.delete'); - static const workflowPeriodCreate = Permission._(r'workflow.create'); - static const workflowPeriodRead = Permission._(r'workflow.read'); - static const workflowPeriodUpdate = Permission._(r'workflow.update'); - static const workflowPeriodDelete = Permission._(r'workflow.delete'); + static const serverPeriodAbout = Permission._(r'server.about'); static const adminUserPeriodCreate = Permission._(r'adminUser.create'); static const adminUserPeriodRead = Permission._(r'adminUser.read'); static const adminUserPeriodUpdate = Permission._(r'adminUser.update'); static const adminUserPeriodDelete = Permission._(r'adminUser.delete'); - static const adminSessionPeriodRead = Permission._(r'adminSession.read'); - static const adminAuthPeriodUnlinkAll = Permission._(r'adminAuth.unlinkAll'); /// List of all possible values in this [enum][Permission]. static const values = [ all, - activityPeriodCreate, - activityPeriodRead, - activityPeriodUpdate, - activityPeriodDelete, - activityPeriodStatistics, apiKeyPeriodCreate, apiKeyPeriodRead, apiKeyPeriodUpdate, apiKeyPeriodDelete, - assetPeriodRead, - assetPeriodUpdate, - assetPeriodDelete, - assetPeriodStatistics, - assetPeriodShare, - assetPeriodView, - assetPeriodDownload, - assetPeriodUpload, - assetPeriodReplace, - assetPeriodCopy, - assetPeriodDerive, - assetPeriodEditPeriodGet, - assetPeriodEditPeriodCreate, - assetPeriodEditPeriodDelete, - albumPeriodCreate, - albumPeriodRead, - albumPeriodUpdate, - albumPeriodDelete, - albumPeriodStatistics, - albumPeriodShare, - albumPeriodDownload, - albumAssetPeriodCreate, - albumAssetPeriodDelete, - albumUserPeriodCreate, - albumUserPeriodUpdate, - albumUserPeriodDelete, authPeriodChangePassword, authDevicePeriodDelete, - archivePeriodRead, - backupPeriodList, - backupPeriodDownload, - backupPeriodUpload, - backupPeriodDelete, - duplicatePeriodRead, - duplicatePeriodDelete, - facePeriodCreate, - facePeriodRead, - facePeriodUpdate, - facePeriodDelete, - folderPeriodRead, - jobPeriodCreate, - jobPeriodRead, - libraryPeriodCreate, - libraryPeriodRead, - libraryPeriodUpdate, - libraryPeriodDelete, - libraryPeriodStatistics, - timelinePeriodRead, - timelinePeriodDownload, - maintenance, - mapPeriodRead, - mapPeriodSearch, - memoryPeriodCreate, - memoryPeriodRead, - memoryPeriodUpdate, - memoryPeriodDelete, - memoryPeriodStatistics, - memoryAssetPeriodCreate, - memoryAssetPeriodDelete, - notificationPeriodCreate, - notificationPeriodRead, - notificationPeriodUpdate, - notificationPeriodDelete, - partnerPeriodCreate, - partnerPeriodRead, - partnerPeriodUpdate, - partnerPeriodDelete, - personPeriodCreate, - personPeriodRead, - personPeriodUpdate, - personPeriodDelete, - personPeriodStatistics, - personPeriodMerge, - personPeriodReassign, - pinCodePeriodCreate, - pinCodePeriodUpdate, - pinCodePeriodDelete, - pluginPeriodCreate, - pluginPeriodRead, - pluginPeriodUpdate, - pluginPeriodDelete, - serverPeriodAbout, - serverPeriodApkLinks, - serverPeriodStorage, - serverPeriodStatistics, - serverPeriodVersionCheck, - serverLicensePeriodRead, - serverLicensePeriodUpdate, - serverLicensePeriodDelete, sessionPeriodCreate, sessionPeriodRead, sessionPeriodUpdate, sessionPeriodDelete, - sessionPeriodLock, - sharedLinkPeriodCreate, - sharedLinkPeriodRead, - sharedLinkPeriodUpdate, - sharedLinkPeriodDelete, - stackPeriodCreate, - stackPeriodRead, - stackPeriodUpdate, - stackPeriodDelete, - syncPeriodStream, - syncCheckpointPeriodRead, - syncCheckpointPeriodUpdate, - syncCheckpointPeriodDelete, - systemConfigPeriodRead, - systemConfigPeriodUpdate, systemMetadataPeriodRead, systemMetadataPeriodUpdate, - tagPeriodCreate, - tagPeriodRead, - tagPeriodUpdate, - tagPeriodDelete, - tagPeriodAsset, userPeriodRead, userPeriodUpdate, - userLicensePeriodCreate, - userLicensePeriodRead, - userLicensePeriodUpdate, - userLicensePeriodDelete, - userOnboardingPeriodRead, - userOnboardingPeriodUpdate, - userOnboardingPeriodDelete, - userPreferencePeriodRead, - userPreferencePeriodUpdate, - userProfileImagePeriodCreate, - userProfileImagePeriodRead, - userProfileImagePeriodUpdate, - userProfileImagePeriodDelete, - queuePeriodRead, - queuePeriodUpdate, - queueJobPeriodCreate, - queueJobPeriodRead, - queueJobPeriodUpdate, - queueJobPeriodDelete, - workflowPeriodCreate, - workflowPeriodRead, - workflowPeriodUpdate, - workflowPeriodDelete, + serverPeriodAbout, adminUserPeriodCreate, adminUserPeriodRead, adminUserPeriodUpdate, adminUserPeriodDelete, - adminSessionPeriodRead, - adminAuthPeriodUnlinkAll, ]; static Permission? fromJson(dynamic value) => PermissionTypeTransformer().decode(value); @@ -377,161 +105,25 @@ class PermissionTypeTransformer { if (data != null) { switch (data) { case r'all': return Permission.all; - case r'activity.create': return Permission.activityPeriodCreate; - case r'activity.read': return Permission.activityPeriodRead; - case r'activity.update': return Permission.activityPeriodUpdate; - case r'activity.delete': return Permission.activityPeriodDelete; - case r'activity.statistics': return Permission.activityPeriodStatistics; case r'apiKey.create': return Permission.apiKeyPeriodCreate; case r'apiKey.read': return Permission.apiKeyPeriodRead; case r'apiKey.update': return Permission.apiKeyPeriodUpdate; case r'apiKey.delete': return Permission.apiKeyPeriodDelete; - case r'asset.read': return Permission.assetPeriodRead; - case r'asset.update': return Permission.assetPeriodUpdate; - case r'asset.delete': return Permission.assetPeriodDelete; - case r'asset.statistics': return Permission.assetPeriodStatistics; - case r'asset.share': return Permission.assetPeriodShare; - case r'asset.view': return Permission.assetPeriodView; - case r'asset.download': return Permission.assetPeriodDownload; - case r'asset.upload': return Permission.assetPeriodUpload; - case r'asset.replace': return Permission.assetPeriodReplace; - case r'asset.copy': return Permission.assetPeriodCopy; - case r'asset.derive': return Permission.assetPeriodDerive; - case r'asset.edit.get': return Permission.assetPeriodEditPeriodGet; - case r'asset.edit.create': return Permission.assetPeriodEditPeriodCreate; - case r'asset.edit.delete': return Permission.assetPeriodEditPeriodDelete; - case r'album.create': return Permission.albumPeriodCreate; - case r'album.read': return Permission.albumPeriodRead; - case r'album.update': return Permission.albumPeriodUpdate; - case r'album.delete': return Permission.albumPeriodDelete; - case r'album.statistics': return Permission.albumPeriodStatistics; - case r'album.share': return Permission.albumPeriodShare; - case r'album.download': return Permission.albumPeriodDownload; - case r'albumAsset.create': return Permission.albumAssetPeriodCreate; - case r'albumAsset.delete': return Permission.albumAssetPeriodDelete; - case r'albumUser.create': return Permission.albumUserPeriodCreate; - case r'albumUser.update': return Permission.albumUserPeriodUpdate; - case r'albumUser.delete': return Permission.albumUserPeriodDelete; case r'auth.changePassword': return Permission.authPeriodChangePassword; case r'authDevice.delete': return Permission.authDevicePeriodDelete; - case r'archive.read': return Permission.archivePeriodRead; - case r'backup.list': return Permission.backupPeriodList; - case r'backup.download': return Permission.backupPeriodDownload; - case r'backup.upload': return Permission.backupPeriodUpload; - case r'backup.delete': return Permission.backupPeriodDelete; - case r'duplicate.read': return Permission.duplicatePeriodRead; - case r'duplicate.delete': return Permission.duplicatePeriodDelete; - case r'face.create': return Permission.facePeriodCreate; - case r'face.read': return Permission.facePeriodRead; - case r'face.update': return Permission.facePeriodUpdate; - case r'face.delete': return Permission.facePeriodDelete; - case r'folder.read': return Permission.folderPeriodRead; - case r'job.create': return Permission.jobPeriodCreate; - case r'job.read': return Permission.jobPeriodRead; - case r'library.create': return Permission.libraryPeriodCreate; - case r'library.read': return Permission.libraryPeriodRead; - case r'library.update': return Permission.libraryPeriodUpdate; - case r'library.delete': return Permission.libraryPeriodDelete; - case r'library.statistics': return Permission.libraryPeriodStatistics; - case r'timeline.read': return Permission.timelinePeriodRead; - case r'timeline.download': return Permission.timelinePeriodDownload; - case r'maintenance': return Permission.maintenance; - case r'map.read': return Permission.mapPeriodRead; - case r'map.search': return Permission.mapPeriodSearch; - case r'memory.create': return Permission.memoryPeriodCreate; - case r'memory.read': return Permission.memoryPeriodRead; - case r'memory.update': return Permission.memoryPeriodUpdate; - case r'memory.delete': return Permission.memoryPeriodDelete; - case r'memory.statistics': return Permission.memoryPeriodStatistics; - case r'memoryAsset.create': return Permission.memoryAssetPeriodCreate; - case r'memoryAsset.delete': return Permission.memoryAssetPeriodDelete; - case r'notification.create': return Permission.notificationPeriodCreate; - case r'notification.read': return Permission.notificationPeriodRead; - case r'notification.update': return Permission.notificationPeriodUpdate; - case r'notification.delete': return Permission.notificationPeriodDelete; - case r'partner.create': return Permission.partnerPeriodCreate; - case r'partner.read': return Permission.partnerPeriodRead; - case r'partner.update': return Permission.partnerPeriodUpdate; - case r'partner.delete': return Permission.partnerPeriodDelete; - case r'person.create': return Permission.personPeriodCreate; - case r'person.read': return Permission.personPeriodRead; - case r'person.update': return Permission.personPeriodUpdate; - case r'person.delete': return Permission.personPeriodDelete; - case r'person.statistics': return Permission.personPeriodStatistics; - case r'person.merge': return Permission.personPeriodMerge; - case r'person.reassign': return Permission.personPeriodReassign; - case r'pinCode.create': return Permission.pinCodePeriodCreate; - case r'pinCode.update': return Permission.pinCodePeriodUpdate; - case r'pinCode.delete': return Permission.pinCodePeriodDelete; - case r'plugin.create': return Permission.pluginPeriodCreate; - case r'plugin.read': return Permission.pluginPeriodRead; - case r'plugin.update': return Permission.pluginPeriodUpdate; - case r'plugin.delete': return Permission.pluginPeriodDelete; - case r'server.about': return Permission.serverPeriodAbout; - case r'server.apkLinks': return Permission.serverPeriodApkLinks; - case r'server.storage': return Permission.serverPeriodStorage; - case r'server.statistics': return Permission.serverPeriodStatistics; - case r'server.versionCheck': return Permission.serverPeriodVersionCheck; - case r'serverLicense.read': return Permission.serverLicensePeriodRead; - case r'serverLicense.update': return Permission.serverLicensePeriodUpdate; - case r'serverLicense.delete': return Permission.serverLicensePeriodDelete; case r'session.create': return Permission.sessionPeriodCreate; case r'session.read': return Permission.sessionPeriodRead; case r'session.update': return Permission.sessionPeriodUpdate; case r'session.delete': return Permission.sessionPeriodDelete; - case r'session.lock': return Permission.sessionPeriodLock; - case r'sharedLink.create': return Permission.sharedLinkPeriodCreate; - case r'sharedLink.read': return Permission.sharedLinkPeriodRead; - case r'sharedLink.update': return Permission.sharedLinkPeriodUpdate; - case r'sharedLink.delete': return Permission.sharedLinkPeriodDelete; - case r'stack.create': return Permission.stackPeriodCreate; - case r'stack.read': return Permission.stackPeriodRead; - case r'stack.update': return Permission.stackPeriodUpdate; - case r'stack.delete': return Permission.stackPeriodDelete; - case r'sync.stream': return Permission.syncPeriodStream; - case r'syncCheckpoint.read': return Permission.syncCheckpointPeriodRead; - case r'syncCheckpoint.update': return Permission.syncCheckpointPeriodUpdate; - case r'syncCheckpoint.delete': return Permission.syncCheckpointPeriodDelete; - case r'systemConfig.read': return Permission.systemConfigPeriodRead; - case r'systemConfig.update': return Permission.systemConfigPeriodUpdate; case r'systemMetadata.read': return Permission.systemMetadataPeriodRead; case r'systemMetadata.update': return Permission.systemMetadataPeriodUpdate; - case r'tag.create': return Permission.tagPeriodCreate; - case r'tag.read': return Permission.tagPeriodRead; - case r'tag.update': return Permission.tagPeriodUpdate; - case r'tag.delete': return Permission.tagPeriodDelete; - case r'tag.asset': return Permission.tagPeriodAsset; case r'user.read': return Permission.userPeriodRead; case r'user.update': return Permission.userPeriodUpdate; - case r'userLicense.create': return Permission.userLicensePeriodCreate; - case r'userLicense.read': return Permission.userLicensePeriodRead; - case r'userLicense.update': return Permission.userLicensePeriodUpdate; - case r'userLicense.delete': return Permission.userLicensePeriodDelete; - case r'userOnboarding.read': return Permission.userOnboardingPeriodRead; - case r'userOnboarding.update': return Permission.userOnboardingPeriodUpdate; - case r'userOnboarding.delete': return Permission.userOnboardingPeriodDelete; - case r'userPreference.read': return Permission.userPreferencePeriodRead; - case r'userPreference.update': return Permission.userPreferencePeriodUpdate; - case r'userProfileImage.create': return Permission.userProfileImagePeriodCreate; - case r'userProfileImage.read': return Permission.userProfileImagePeriodRead; - case r'userProfileImage.update': return Permission.userProfileImagePeriodUpdate; - case r'userProfileImage.delete': return Permission.userProfileImagePeriodDelete; - case r'queue.read': return Permission.queuePeriodRead; - case r'queue.update': return Permission.queuePeriodUpdate; - case r'queueJob.create': return Permission.queueJobPeriodCreate; - case r'queueJob.read': return Permission.queueJobPeriodRead; - case r'queueJob.update': return Permission.queueJobPeriodUpdate; - case r'queueJob.delete': return Permission.queueJobPeriodDelete; - case r'workflow.create': return Permission.workflowPeriodCreate; - case r'workflow.read': return Permission.workflowPeriodRead; - case r'workflow.update': return Permission.workflowPeriodUpdate; - case r'workflow.delete': return Permission.workflowPeriodDelete; + case r'server.about': return Permission.serverPeriodAbout; case r'adminUser.create': return Permission.adminUserPeriodCreate; case r'adminUser.read': return Permission.adminUserPeriodRead; case r'adminUser.update': return Permission.adminUserPeriodUpdate; case r'adminUser.delete': return Permission.adminUserPeriodDelete; - case r'adminSession.read': return Permission.adminSessionPeriodRead; - case r'adminAuth.unlinkAll': return Permission.adminAuthPeriodUnlinkAll; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/mobile/openapi/lib/model/person_create_dto.dart b/mobile/openapi/lib/model/person_create_dto.dart deleted file mode 100644 index f2ba702c2f..0000000000 --- a/mobile/openapi/lib/model/person_create_dto.dart +++ /dev/null @@ -1,169 +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 PersonCreateDto { - /// Returns a new [PersonCreateDto] instance. - PersonCreateDto({ - this.birthDate, - this.color, - this.isFavorite, - this.isHidden, - this.name, - }); - - /// Person date of birth - DateTime? birthDate; - - /// Person color (hex) - String? color; - - /// Mark as favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Person visibility (hidden) - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isHidden; - - /// Person name - /// - /// 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? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is PersonCreateDto && - other.birthDate == birthDate && - other.color == color && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isHidden == null ? 0 : isHidden!.hashCode) + - (name == null ? 0 : name!.hashCode); - - @override - String toString() => 'PersonCreateDto[birthDate=$birthDate, color=$color, isFavorite=$isFavorite, isHidden=$isHidden, name=$name]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isHidden != null) { - json[r'isHidden'] = this.isHidden; - } else { - // json[r'isHidden'] = null; - } - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - return json; - } - - /// Returns a new [PersonCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PersonCreateDto? fromJson(dynamic value) { - upgradeDto(value, "PersonCreateDto"); - if (value is Map) { - final json = value.cast(); - - return PersonCreateDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isHidden: mapValueOfType(json, r'isHidden'), - name: mapValueOfType(json, r'name'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PersonCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PersonCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PersonCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PersonCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/person_response_dto.dart b/mobile/openapi/lib/model/person_response_dto.dart deleted file mode 100644 index 455dfb98d6..0000000000 --- a/mobile/openapi/lib/model/person_response_dto.dart +++ /dev/null @@ -1,194 +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 PersonResponseDto { - /// Returns a new [PersonResponseDto] instance. - PersonResponseDto({ - required this.birthDate, - this.color, - required this.id, - this.isFavorite, - required this.isHidden, - required this.name, - required this.thumbnailPath, - this.updatedAt, - }); - - /// Person date of birth - DateTime? birthDate; - - /// Person color (hex) - /// - /// 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? color; - - /// Person ID - String id; - - /// Is favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Is hidden - bool isHidden; - - /// Person name - String name; - - /// Thumbnail path - String thumbnailPath; - - /// Last update date - /// - /// 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? updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is PersonResponseDto && - other.birthDate == birthDate && - other.color == color && - other.id == id && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name && - other.thumbnailPath == thumbnailPath && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (id.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isHidden.hashCode) + - (name.hashCode) + - (thumbnailPath.hashCode) + - (updatedAt == null ? 0 : updatedAt!.hashCode); - - @override - String toString() => 'PersonResponseDto[birthDate=$birthDate, color=$color, id=$id, isFavorite=$isFavorite, isHidden=$isHidden, name=$name, thumbnailPath=$thumbnailPath, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - json[r'id'] = this.id; - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - json[r'isHidden'] = this.isHidden; - json[r'name'] = this.name; - json[r'thumbnailPath'] = this.thumbnailPath; - if (this.updatedAt != null) { - json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String(); - } else { - // json[r'updatedAt'] = null; - } - return json; - } - - /// Returns a new [PersonResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PersonResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PersonResponseDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - id: mapValueOfType(json, r'id')!, - isFavorite: mapValueOfType(json, r'isFavorite'), - isHidden: mapValueOfType(json, r'isHidden')!, - name: mapValueOfType(json, r'name')!, - thumbnailPath: mapValueOfType(json, r'thumbnailPath')!, - updatedAt: mapDateTime(json, r'updatedAt', r''), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PersonResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PersonResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PersonResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PersonResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'birthDate', - 'id', - 'isHidden', - 'name', - 'thumbnailPath', - }; -} - diff --git a/mobile/openapi/lib/model/person_statistics_response_dto.dart b/mobile/openapi/lib/model/person_statistics_response_dto.dart deleted file mode 100644 index d2b45c8ccb..0000000000 --- a/mobile/openapi/lib/model/person_statistics_response_dto.dart +++ /dev/null @@ -1,100 +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 PersonStatisticsResponseDto { - /// Returns a new [PersonStatisticsResponseDto] instance. - PersonStatisticsResponseDto({ - required this.assets, - }); - - /// Number of assets - int assets; - - @override - bool operator ==(Object other) => identical(this, other) || other is PersonStatisticsResponseDto && - other.assets == assets; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assets.hashCode); - - @override - String toString() => 'PersonStatisticsResponseDto[assets=$assets]'; - - Map toJson() { - final json = {}; - json[r'assets'] = this.assets; - return json; - } - - /// Returns a new [PersonStatisticsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PersonStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonStatisticsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PersonStatisticsResponseDto( - assets: mapValueOfType(json, r'assets')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PersonStatisticsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PersonStatisticsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PersonStatisticsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PersonStatisticsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assets', - }; -} - diff --git a/mobile/openapi/lib/model/person_update_dto.dart b/mobile/openapi/lib/model/person_update_dto.dart deleted file mode 100644 index b56940e51d..0000000000 --- a/mobile/openapi/lib/model/person_update_dto.dart +++ /dev/null @@ -1,187 +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 PersonUpdateDto { - /// Returns a new [PersonUpdateDto] instance. - PersonUpdateDto({ - this.birthDate, - this.color, - this.featureFaceAssetId, - this.isFavorite, - this.isHidden, - this.name, - }); - - /// Person date of birth - DateTime? birthDate; - - /// Person color (hex) - String? color; - - /// Asset ID used for feature face thumbnail - /// - /// 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? featureFaceAssetId; - - /// Mark as favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Person visibility (hidden) - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isHidden; - - /// Person name - /// - /// 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? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is PersonUpdateDto && - other.birthDate == birthDate && - other.color == color && - other.featureFaceAssetId == featureFaceAssetId && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isHidden == null ? 0 : isHidden!.hashCode) + - (name == null ? 0 : name!.hashCode); - - @override - String toString() => 'PersonUpdateDto[birthDate=$birthDate, color=$color, featureFaceAssetId=$featureFaceAssetId, isFavorite=$isFavorite, isHidden=$isHidden, name=$name]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - if (this.featureFaceAssetId != null) { - json[r'featureFaceAssetId'] = this.featureFaceAssetId; - } else { - // json[r'featureFaceAssetId'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isHidden != null) { - json[r'isHidden'] = this.isHidden; - } else { - // json[r'isHidden'] = null; - } - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - return json; - } - - /// Returns a new [PersonUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PersonUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "PersonUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return PersonUpdateDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - featureFaceAssetId: mapValueOfType(json, r'featureFaceAssetId'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isHidden: mapValueOfType(json, r'isHidden'), - name: mapValueOfType(json, r'name'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PersonUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PersonUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PersonUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PersonUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/person_with_faces_response_dto.dart b/mobile/openapi/lib/model/person_with_faces_response_dto.dart deleted file mode 100644 index f31c04b69f..0000000000 --- a/mobile/openapi/lib/model/person_with_faces_response_dto.dart +++ /dev/null @@ -1,203 +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 PersonWithFacesResponseDto { - /// Returns a new [PersonWithFacesResponseDto] instance. - PersonWithFacesResponseDto({ - required this.birthDate, - this.color, - this.faces = const [], - required this.id, - this.isFavorite, - required this.isHidden, - required this.name, - required this.thumbnailPath, - this.updatedAt, - }); - - /// Person date of birth - DateTime? birthDate; - - /// Person color (hex) - /// - /// 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? color; - - /// Face detections - List faces; - - /// Person ID - String id; - - /// Is favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Is hidden - bool isHidden; - - /// Person name - String name; - - /// Thumbnail path - String thumbnailPath; - - /// Last update date - /// - /// 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? updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is PersonWithFacesResponseDto && - other.birthDate == birthDate && - other.color == color && - _deepEquality.equals(other.faces, faces) && - other.id == id && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name && - other.thumbnailPath == thumbnailPath && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (faces.hashCode) + - (id.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isHidden.hashCode) + - (name.hashCode) + - (thumbnailPath.hashCode) + - (updatedAt == null ? 0 : updatedAt!.hashCode); - - @override - String toString() => 'PersonWithFacesResponseDto[birthDate=$birthDate, color=$color, faces=$faces, id=$id, isFavorite=$isFavorite, isHidden=$isHidden, name=$name, thumbnailPath=$thumbnailPath, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - json[r'faces'] = this.faces; - json[r'id'] = this.id; - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - json[r'isHidden'] = this.isHidden; - json[r'name'] = this.name; - json[r'thumbnailPath'] = this.thumbnailPath; - if (this.updatedAt != null) { - json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String(); - } else { - // json[r'updatedAt'] = null; - } - return json; - } - - /// Returns a new [PersonWithFacesResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PersonWithFacesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PersonWithFacesResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PersonWithFacesResponseDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - faces: AssetFaceWithoutPersonResponseDto.listFromJson(json[r'faces']), - id: mapValueOfType(json, r'id')!, - isFavorite: mapValueOfType(json, r'isFavorite'), - isHidden: mapValueOfType(json, r'isHidden')!, - name: mapValueOfType(json, r'name')!, - thumbnailPath: mapValueOfType(json, r'thumbnailPath')!, - updatedAt: mapDateTime(json, r'updatedAt', r''), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PersonWithFacesResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PersonWithFacesResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PersonWithFacesResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PersonWithFacesResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'birthDate', - 'faces', - 'id', - 'isHidden', - 'name', - 'thumbnailPath', - }; -} - diff --git a/mobile/openapi/lib/model/pin_code_change_dto.dart b/mobile/openapi/lib/model/pin_code_change_dto.dart deleted file mode 100644 index 068cc9e91b..0000000000 --- a/mobile/openapi/lib/model/pin_code_change_dto.dart +++ /dev/null @@ -1,136 +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 PinCodeChangeDto { - /// Returns a new [PinCodeChangeDto] instance. - PinCodeChangeDto({ - required this.newPinCode, - this.password, - this.pinCode, - }); - - /// New PIN code (4-6 digits) - String newPinCode; - - /// User password (required if PIN code is not provided) - /// - /// 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? password; - - /// New PIN code (4-6 digits) - /// - /// 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? pinCode; - - @override - bool operator ==(Object other) => identical(this, other) || other is PinCodeChangeDto && - other.newPinCode == newPinCode && - other.password == password && - other.pinCode == pinCode; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (newPinCode.hashCode) + - (password == null ? 0 : password!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode); - - @override - String toString() => 'PinCodeChangeDto[newPinCode=$newPinCode, password=$password, pinCode=$pinCode]'; - - Map toJson() { - final json = {}; - json[r'newPinCode'] = this.newPinCode; - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - return json; - } - - /// Returns a new [PinCodeChangeDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PinCodeChangeDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeChangeDto"); - if (value is Map) { - final json = value.cast(); - - return PinCodeChangeDto( - newPinCode: mapValueOfType(json, r'newPinCode')!, - password: mapValueOfType(json, r'password'), - pinCode: mapValueOfType(json, r'pinCode'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PinCodeChangeDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PinCodeChangeDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PinCodeChangeDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PinCodeChangeDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'newPinCode', - }; -} - diff --git a/mobile/openapi/lib/model/pin_code_reset_dto.dart b/mobile/openapi/lib/model/pin_code_reset_dto.dart deleted file mode 100644 index c37be76f18..0000000000 --- a/mobile/openapi/lib/model/pin_code_reset_dto.dart +++ /dev/null @@ -1,127 +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 PinCodeResetDto { - /// Returns a new [PinCodeResetDto] instance. - PinCodeResetDto({ - this.password, - this.pinCode, - }); - - /// User password (required if PIN code is not provided) - /// - /// 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? password; - - /// New PIN code (4-6 digits) - /// - /// 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? pinCode; - - @override - bool operator ==(Object other) => identical(this, other) || other is PinCodeResetDto && - other.password == password && - other.pinCode == pinCode; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (password == null ? 0 : password!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode); - - @override - String toString() => 'PinCodeResetDto[password=$password, pinCode=$pinCode]'; - - Map toJson() { - final json = {}; - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - return json; - } - - /// Returns a new [PinCodeResetDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PinCodeResetDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeResetDto"); - if (value is Map) { - final json = value.cast(); - - return PinCodeResetDto( - password: mapValueOfType(json, r'password'), - pinCode: mapValueOfType(json, r'pinCode'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PinCodeResetDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PinCodeResetDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PinCodeResetDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PinCodeResetDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/pin_code_setup_dto.dart b/mobile/openapi/lib/model/pin_code_setup_dto.dart deleted file mode 100644 index e2f08f102b..0000000000 --- a/mobile/openapi/lib/model/pin_code_setup_dto.dart +++ /dev/null @@ -1,100 +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 PinCodeSetupDto { - /// Returns a new [PinCodeSetupDto] instance. - PinCodeSetupDto({ - required this.pinCode, - }); - - /// PIN code (4-6 digits) - String pinCode; - - @override - bool operator ==(Object other) => identical(this, other) || other is PinCodeSetupDto && - other.pinCode == pinCode; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (pinCode.hashCode); - - @override - String toString() => 'PinCodeSetupDto[pinCode=$pinCode]'; - - Map toJson() { - final json = {}; - json[r'pinCode'] = this.pinCode; - return json; - } - - /// Returns a new [PinCodeSetupDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PinCodeSetupDto? fromJson(dynamic value) { - upgradeDto(value, "PinCodeSetupDto"); - if (value is Map) { - final json = value.cast(); - - return PinCodeSetupDto( - pinCode: mapValueOfType(json, r'pinCode')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PinCodeSetupDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PinCodeSetupDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PinCodeSetupDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PinCodeSetupDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'pinCode', - }; -} - diff --git a/mobile/openapi/lib/model/places_response_dto.dart b/mobile/openapi/lib/model/places_response_dto.dart deleted file mode 100644 index 94aa58eba4..0000000000 --- a/mobile/openapi/lib/model/places_response_dto.dart +++ /dev/null @@ -1,154 +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 PlacesResponseDto { - /// Returns a new [PlacesResponseDto] instance. - PlacesResponseDto({ - this.admin1name, - this.admin2name, - required this.latitude, - required this.longitude, - required this.name, - }); - - /// Administrative level 1 name (state/province) - /// - /// 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? admin1name; - - /// Administrative level 2 name (county/district) - /// - /// 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? admin2name; - - /// Latitude coordinate - num latitude; - - /// Longitude coordinate - num longitude; - - /// Place name - String name; - - @override - bool operator ==(Object other) => identical(this, other) || other is PlacesResponseDto && - other.admin1name == admin1name && - other.admin2name == admin2name && - other.latitude == latitude && - other.longitude == longitude && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (admin1name == null ? 0 : admin1name!.hashCode) + - (admin2name == null ? 0 : admin2name!.hashCode) + - (latitude.hashCode) + - (longitude.hashCode) + - (name.hashCode); - - @override - String toString() => 'PlacesResponseDto[admin1name=$admin1name, admin2name=$admin2name, latitude=$latitude, longitude=$longitude, name=$name]'; - - Map toJson() { - final json = {}; - if (this.admin1name != null) { - json[r'admin1name'] = this.admin1name; - } else { - // json[r'admin1name'] = null; - } - if (this.admin2name != null) { - json[r'admin2name'] = this.admin2name; - } else { - // json[r'admin2name'] = null; - } - json[r'latitude'] = this.latitude; - json[r'longitude'] = this.longitude; - json[r'name'] = this.name; - return json; - } - - /// Returns a new [PlacesResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PlacesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PlacesResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PlacesResponseDto( - admin1name: mapValueOfType(json, r'admin1name'), - admin2name: mapValueOfType(json, r'admin2name'), - latitude: num.parse('${json[r'latitude']}'), - longitude: num.parse('${json[r'longitude']}'), - name: mapValueOfType(json, r'name')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PlacesResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PlacesResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PlacesResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PlacesResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'latitude', - 'longitude', - 'name', - }; -} - diff --git a/mobile/openapi/lib/model/plugin_action_response_dto.dart b/mobile/openapi/lib/model/plugin_action_response_dto.dart deleted file mode 100644 index 34fa314ba9..0000000000 --- a/mobile/openapi/lib/model/plugin_action_response_dto.dart +++ /dev/null @@ -1,158 +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 PluginActionResponseDto { - /// Returns a new [PluginActionResponseDto] instance. - PluginActionResponseDto({ - required this.description, - required this.id, - required this.methodName, - required this.pluginId, - required this.schema, - this.supportedContexts = const [], - required this.title, - }); - - /// Action description - String description; - - /// Action ID - String id; - - /// Method name - String methodName; - - /// Plugin ID - String pluginId; - - /// Action schema - Object? schema; - - /// Supported contexts - List supportedContexts; - - /// Action title - String title; - - @override - bool operator ==(Object other) => identical(this, other) || other is PluginActionResponseDto && - other.description == description && - other.id == id && - other.methodName == methodName && - other.pluginId == pluginId && - other.schema == schema && - _deepEquality.equals(other.supportedContexts, supportedContexts) && - other.title == title; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (description.hashCode) + - (id.hashCode) + - (methodName.hashCode) + - (pluginId.hashCode) + - (schema == null ? 0 : schema!.hashCode) + - (supportedContexts.hashCode) + - (title.hashCode); - - @override - String toString() => 'PluginActionResponseDto[description=$description, id=$id, methodName=$methodName, pluginId=$pluginId, schema=$schema, supportedContexts=$supportedContexts, title=$title]'; - - Map toJson() { - final json = {}; - json[r'description'] = this.description; - json[r'id'] = this.id; - json[r'methodName'] = this.methodName; - json[r'pluginId'] = this.pluginId; - if (this.schema != null) { - json[r'schema'] = this.schema; - } else { - // json[r'schema'] = null; - } - json[r'supportedContexts'] = this.supportedContexts; - json[r'title'] = this.title; - return json; - } - - /// Returns a new [PluginActionResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PluginActionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginActionResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PluginActionResponseDto( - description: mapValueOfType(json, r'description')!, - id: mapValueOfType(json, r'id')!, - methodName: mapValueOfType(json, r'methodName')!, - pluginId: mapValueOfType(json, r'pluginId')!, - schema: mapValueOfType(json, r'schema'), - supportedContexts: PluginContextType.listFromJson(json[r'supportedContexts']), - title: mapValueOfType(json, r'title')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginActionResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PluginActionResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PluginActionResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PluginActionResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'description', - 'id', - 'methodName', - 'pluginId', - 'schema', - 'supportedContexts', - 'title', - }; -} - diff --git a/mobile/openapi/lib/model/plugin_context_type.dart b/mobile/openapi/lib/model/plugin_context_type.dart deleted file mode 100644 index 6f4ac91fdb..0000000000 --- a/mobile/openapi/lib/model/plugin_context_type.dart +++ /dev/null @@ -1,88 +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; - -/// Context type -class PluginContextType { - /// Instantiate a new enum with the provided [value]. - const PluginContextType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const asset = PluginContextType._(r'asset'); - static const album = PluginContextType._(r'album'); - static const person = PluginContextType._(r'person'); - - /// List of all possible values in this [enum][PluginContextType]. - static const values = [ - asset, - album, - person, - ]; - - static PluginContextType? fromJson(dynamic value) => PluginContextTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginContextType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [PluginContextType] to String, -/// and [decode] dynamic data back to [PluginContextType]. -class PluginContextTypeTypeTransformer { - factory PluginContextTypeTypeTransformer() => _instance ??= const PluginContextTypeTypeTransformer._(); - - const PluginContextTypeTypeTransformer._(); - - String encode(PluginContextType data) => data.value; - - /// Decodes a [dynamic value][data] to a PluginContextType. - /// - /// 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. - PluginContextType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'asset': return PluginContextType.asset; - case r'album': return PluginContextType.album; - case r'person': return PluginContextType.person; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [PluginContextTypeTypeTransformer] instance. - static PluginContextTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/plugin_filter_response_dto.dart b/mobile/openapi/lib/model/plugin_filter_response_dto.dart deleted file mode 100644 index ea6411a9c1..0000000000 --- a/mobile/openapi/lib/model/plugin_filter_response_dto.dart +++ /dev/null @@ -1,158 +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 PluginFilterResponseDto { - /// Returns a new [PluginFilterResponseDto] instance. - PluginFilterResponseDto({ - required this.description, - required this.id, - required this.methodName, - required this.pluginId, - required this.schema, - this.supportedContexts = const [], - required this.title, - }); - - /// Filter description - String description; - - /// Filter ID - String id; - - /// Method name - String methodName; - - /// Plugin ID - String pluginId; - - /// Filter schema - Object? schema; - - /// Supported contexts - List supportedContexts; - - /// Filter title - String title; - - @override - bool operator ==(Object other) => identical(this, other) || other is PluginFilterResponseDto && - other.description == description && - other.id == id && - other.methodName == methodName && - other.pluginId == pluginId && - other.schema == schema && - _deepEquality.equals(other.supportedContexts, supportedContexts) && - other.title == title; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (description.hashCode) + - (id.hashCode) + - (methodName.hashCode) + - (pluginId.hashCode) + - (schema == null ? 0 : schema!.hashCode) + - (supportedContexts.hashCode) + - (title.hashCode); - - @override - String toString() => 'PluginFilterResponseDto[description=$description, id=$id, methodName=$methodName, pluginId=$pluginId, schema=$schema, supportedContexts=$supportedContexts, title=$title]'; - - Map toJson() { - final json = {}; - json[r'description'] = this.description; - json[r'id'] = this.id; - json[r'methodName'] = this.methodName; - json[r'pluginId'] = this.pluginId; - if (this.schema != null) { - json[r'schema'] = this.schema; - } else { - // json[r'schema'] = null; - } - json[r'supportedContexts'] = this.supportedContexts; - json[r'title'] = this.title; - return json; - } - - /// Returns a new [PluginFilterResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PluginFilterResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginFilterResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PluginFilterResponseDto( - description: mapValueOfType(json, r'description')!, - id: mapValueOfType(json, r'id')!, - methodName: mapValueOfType(json, r'methodName')!, - pluginId: mapValueOfType(json, r'pluginId')!, - schema: mapValueOfType(json, r'schema'), - supportedContexts: PluginContextType.listFromJson(json[r'supportedContexts']), - title: mapValueOfType(json, r'title')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginFilterResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PluginFilterResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PluginFilterResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PluginFilterResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'description', - 'id', - 'methodName', - 'pluginId', - 'schema', - 'supportedContexts', - 'title', - }; -} - diff --git a/mobile/openapi/lib/model/plugin_response_dto.dart b/mobile/openapi/lib/model/plugin_response_dto.dart deleted file mode 100644 index 7a99896475..0000000000 --- a/mobile/openapi/lib/model/plugin_response_dto.dart +++ /dev/null @@ -1,181 +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 PluginResponseDto { - /// Returns a new [PluginResponseDto] instance. - PluginResponseDto({ - this.actions = const [], - required this.author, - required this.createdAt, - required this.description, - this.filters = const [], - required this.id, - required this.name, - required this.title, - required this.updatedAt, - required this.version, - }); - - /// Plugin actions - List actions; - - /// Plugin author - String author; - - /// Creation date - String createdAt; - - /// Plugin description - String description; - - /// Plugin filters - List filters; - - /// Plugin ID - String id; - - /// Plugin name - String name; - - /// Plugin title - String title; - - /// Last update date - String updatedAt; - - /// Plugin version - String version; - - @override - bool operator ==(Object other) => identical(this, other) || other is PluginResponseDto && - _deepEquality.equals(other.actions, actions) && - other.author == author && - other.createdAt == createdAt && - other.description == description && - _deepEquality.equals(other.filters, filters) && - other.id == id && - other.name == name && - other.title == title && - other.updatedAt == updatedAt && - other.version == version; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actions.hashCode) + - (author.hashCode) + - (createdAt.hashCode) + - (description.hashCode) + - (filters.hashCode) + - (id.hashCode) + - (name.hashCode) + - (title.hashCode) + - (updatedAt.hashCode) + - (version.hashCode); - - @override - String toString() => 'PluginResponseDto[actions=$actions, author=$author, createdAt=$createdAt, description=$description, filters=$filters, id=$id, name=$name, title=$title, updatedAt=$updatedAt, version=$version]'; - - Map toJson() { - final json = {}; - json[r'actions'] = this.actions; - json[r'author'] = this.author; - json[r'createdAt'] = this.createdAt; - json[r'description'] = this.description; - json[r'filters'] = this.filters; - json[r'id'] = this.id; - json[r'name'] = this.name; - json[r'title'] = this.title; - json[r'updatedAt'] = this.updatedAt; - json[r'version'] = this.version; - return json; - } - - /// Returns a new [PluginResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PluginResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PluginResponseDto( - actions: PluginActionResponseDto.listFromJson(json[r'actions']), - author: mapValueOfType(json, r'author')!, - createdAt: mapValueOfType(json, r'createdAt')!, - description: mapValueOfType(json, r'description')!, - filters: PluginFilterResponseDto.listFromJson(json[r'filters']), - id: mapValueOfType(json, r'id')!, - name: mapValueOfType(json, r'name')!, - title: mapValueOfType(json, r'title')!, - updatedAt: mapValueOfType(json, r'updatedAt')!, - version: mapValueOfType(json, r'version')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PluginResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PluginResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PluginResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'actions', - 'author', - 'createdAt', - 'description', - 'filters', - 'id', - 'name', - 'title', - 'updatedAt', - 'version', - }; -} - diff --git a/mobile/openapi/lib/model/plugin_trigger_response_dto.dart b/mobile/openapi/lib/model/plugin_trigger_response_dto.dart deleted file mode 100644 index 16a9604bcd..0000000000 --- a/mobile/openapi/lib/model/plugin_trigger_response_dto.dart +++ /dev/null @@ -1,109 +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 PluginTriggerResponseDto { - /// Returns a new [PluginTriggerResponseDto] instance. - PluginTriggerResponseDto({ - required this.contextType, - required this.type, - }); - - /// Context type - PluginContextType contextType; - - /// Trigger type - PluginTriggerType type; - - @override - bool operator ==(Object other) => identical(this, other) || other is PluginTriggerResponseDto && - other.contextType == contextType && - other.type == type; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (contextType.hashCode) + - (type.hashCode); - - @override - String toString() => 'PluginTriggerResponseDto[contextType=$contextType, type=$type]'; - - Map toJson() { - final json = {}; - json[r'contextType'] = this.contextType; - json[r'type'] = this.type; - return json; - } - - /// Returns a new [PluginTriggerResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PluginTriggerResponseDto? fromJson(dynamic value) { - upgradeDto(value, "PluginTriggerResponseDto"); - if (value is Map) { - final json = value.cast(); - - return PluginTriggerResponseDto( - contextType: PluginContextType.fromJson(json[r'contextType'])!, - type: PluginTriggerType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginTriggerResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PluginTriggerResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PluginTriggerResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PluginTriggerResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'contextType', - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/plugin_trigger_type.dart b/mobile/openapi/lib/model/plugin_trigger_type.dart deleted file mode 100644 index 9ae64acf6c..0000000000 --- a/mobile/openapi/lib/model/plugin_trigger_type.dart +++ /dev/null @@ -1,85 +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; - -/// Trigger type -class PluginTriggerType { - /// Instantiate a new enum with the provided [value]. - const PluginTriggerType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const assetCreate = PluginTriggerType._(r'AssetCreate'); - static const personRecognized = PluginTriggerType._(r'PersonRecognized'); - - /// List of all possible values in this [enum][PluginTriggerType]. - static const values = [ - assetCreate, - personRecognized, - ]; - - static PluginTriggerType? fromJson(dynamic value) => PluginTriggerTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PluginTriggerType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [PluginTriggerType] to String, -/// and [decode] dynamic data back to [PluginTriggerType]. -class PluginTriggerTypeTypeTransformer { - factory PluginTriggerTypeTypeTransformer() => _instance ??= const PluginTriggerTypeTypeTransformer._(); - - const PluginTriggerTypeTypeTransformer._(); - - String encode(PluginTriggerType data) => data.value; - - /// Decodes a [dynamic value][data] to a PluginTriggerType. - /// - /// 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. - PluginTriggerType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'AssetCreate': return PluginTriggerType.assetCreate; - case r'PersonRecognized': return PluginTriggerType.personRecognized; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [PluginTriggerTypeTypeTransformer] instance. - static PluginTriggerTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/purchase_response.dart b/mobile/openapi/lib/model/purchase_response.dart deleted file mode 100644 index e55c286629..0000000000 --- a/mobile/openapi/lib/model/purchase_response.dart +++ /dev/null @@ -1,109 +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 PurchaseResponse { - /// Returns a new [PurchaseResponse] instance. - PurchaseResponse({ - required this.hideBuyButtonUntil, - required this.showSupportBadge, - }); - - /// Date until which to hide buy button - String hideBuyButtonUntil; - - /// Whether to show support badge - bool showSupportBadge; - - @override - bool operator ==(Object other) => identical(this, other) || other is PurchaseResponse && - other.hideBuyButtonUntil == hideBuyButtonUntil && - other.showSupportBadge == showSupportBadge; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (hideBuyButtonUntil.hashCode) + - (showSupportBadge.hashCode); - - @override - String toString() => 'PurchaseResponse[hideBuyButtonUntil=$hideBuyButtonUntil, showSupportBadge=$showSupportBadge]'; - - Map toJson() { - final json = {}; - json[r'hideBuyButtonUntil'] = this.hideBuyButtonUntil; - json[r'showSupportBadge'] = this.showSupportBadge; - return json; - } - - /// Returns a new [PurchaseResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PurchaseResponse? fromJson(dynamic value) { - upgradeDto(value, "PurchaseResponse"); - if (value is Map) { - final json = value.cast(); - - return PurchaseResponse( - hideBuyButtonUntil: mapValueOfType(json, r'hideBuyButtonUntil')!, - showSupportBadge: mapValueOfType(json, r'showSupportBadge')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PurchaseResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PurchaseResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PurchaseResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PurchaseResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'hideBuyButtonUntil', - 'showSupportBadge', - }; -} - diff --git a/mobile/openapi/lib/model/purchase_update.dart b/mobile/openapi/lib/model/purchase_update.dart deleted file mode 100644 index 913faf9bc4..0000000000 --- a/mobile/openapi/lib/model/purchase_update.dart +++ /dev/null @@ -1,127 +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 PurchaseUpdate { - /// Returns a new [PurchaseUpdate] instance. - PurchaseUpdate({ - this.hideBuyButtonUntil, - this.showSupportBadge, - }); - - /// Date until which to hide buy button - /// - /// 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? hideBuyButtonUntil; - - /// Whether to show support badge - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? showSupportBadge; - - @override - bool operator ==(Object other) => identical(this, other) || other is PurchaseUpdate && - other.hideBuyButtonUntil == hideBuyButtonUntil && - other.showSupportBadge == showSupportBadge; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (hideBuyButtonUntil == null ? 0 : hideBuyButtonUntil!.hashCode) + - (showSupportBadge == null ? 0 : showSupportBadge!.hashCode); - - @override - String toString() => 'PurchaseUpdate[hideBuyButtonUntil=$hideBuyButtonUntil, showSupportBadge=$showSupportBadge]'; - - Map toJson() { - final json = {}; - if (this.hideBuyButtonUntil != null) { - json[r'hideBuyButtonUntil'] = this.hideBuyButtonUntil; - } else { - // json[r'hideBuyButtonUntil'] = null; - } - if (this.showSupportBadge != null) { - json[r'showSupportBadge'] = this.showSupportBadge; - } else { - // json[r'showSupportBadge'] = null; - } - return json; - } - - /// Returns a new [PurchaseUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PurchaseUpdate? fromJson(dynamic value) { - upgradeDto(value, "PurchaseUpdate"); - if (value is Map) { - final json = value.cast(); - - return PurchaseUpdate( - hideBuyButtonUntil: mapValueOfType(json, r'hideBuyButtonUntil'), - showSupportBadge: mapValueOfType(json, r'showSupportBadge'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = PurchaseUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = PurchaseUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PurchaseUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = PurchaseUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/queue_command.dart b/mobile/openapi/lib/model/queue_command.dart deleted file mode 100644 index 3cf689a02d..0000000000 --- a/mobile/openapi/lib/model/queue_command.dart +++ /dev/null @@ -1,94 +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; - -/// Queue command to execute -class QueueCommand { - /// Instantiate a new enum with the provided [value]. - const QueueCommand._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const start = QueueCommand._(r'start'); - static const pause = QueueCommand._(r'pause'); - static const resume = QueueCommand._(r'resume'); - static const empty = QueueCommand._(r'empty'); - static const clearFailed = QueueCommand._(r'clear-failed'); - - /// List of all possible values in this [enum][QueueCommand]. - static const values = [ - start, - pause, - resume, - empty, - clearFailed, - ]; - - static QueueCommand? fromJson(dynamic value) => QueueCommandTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueCommand.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [QueueCommand] to String, -/// and [decode] dynamic data back to [QueueCommand]. -class QueueCommandTypeTransformer { - factory QueueCommandTypeTransformer() => _instance ??= const QueueCommandTypeTransformer._(); - - const QueueCommandTypeTransformer._(); - - String encode(QueueCommand data) => data.value; - - /// Decodes a [dynamic value][data] to a QueueCommand. - /// - /// 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. - QueueCommand? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'start': return QueueCommand.start; - case r'pause': return QueueCommand.pause; - case r'resume': return QueueCommand.resume; - case r'empty': return QueueCommand.empty; - case r'clear-failed': return QueueCommand.clearFailed; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [QueueCommandTypeTransformer] instance. - static QueueCommandTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/queue_command_dto.dart b/mobile/openapi/lib/model/queue_command_dto.dart deleted file mode 100644 index 9e1eea15db..0000000000 --- a/mobile/openapi/lib/model/queue_command_dto.dart +++ /dev/null @@ -1,118 +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 QueueCommandDto { - /// Returns a new [QueueCommandDto] instance. - QueueCommandDto({ - required this.command, - this.force, - }); - - /// Queue command to execute - QueueCommand command; - - /// Force the command execution (if applicable) - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? force; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueCommandDto && - other.command == command && - other.force == force; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (command.hashCode) + - (force == null ? 0 : force!.hashCode); - - @override - String toString() => 'QueueCommandDto[command=$command, force=$force]'; - - Map toJson() { - final json = {}; - json[r'command'] = this.command; - if (this.force != null) { - json[r'force'] = this.force; - } else { - // json[r'force'] = null; - } - return json; - } - - /// Returns a new [QueueCommandDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueCommandDto? fromJson(dynamic value) { - upgradeDto(value, "QueueCommandDto"); - if (value is Map) { - final json = value.cast(); - - return QueueCommandDto( - command: QueueCommand.fromJson(json[r'command'])!, - force: mapValueOfType(json, r'force'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueCommandDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueCommandDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueCommandDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueCommandDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'command', - }; -} - diff --git a/mobile/openapi/lib/model/queue_delete_dto.dart b/mobile/openapi/lib/model/queue_delete_dto.dart deleted file mode 100644 index d319238f92..0000000000 --- a/mobile/openapi/lib/model/queue_delete_dto.dart +++ /dev/null @@ -1,109 +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 QueueDeleteDto { - /// Returns a new [QueueDeleteDto] instance. - QueueDeleteDto({ - this.failed, - }); - - /// If true, will also remove failed jobs from the queue. - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? failed; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueDeleteDto && - other.failed == failed; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (failed == null ? 0 : failed!.hashCode); - - @override - String toString() => 'QueueDeleteDto[failed=$failed]'; - - Map toJson() { - final json = {}; - if (this.failed != null) { - json[r'failed'] = this.failed; - } else { - // json[r'failed'] = null; - } - return json; - } - - /// Returns a new [QueueDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "QueueDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return QueueDeleteDto( - failed: mapValueOfType(json, r'failed'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/queue_job_response_dto.dart b/mobile/openapi/lib/model/queue_job_response_dto.dart deleted file mode 100644 index 2ce63784eb..0000000000 --- a/mobile/openapi/lib/model/queue_job_response_dto.dart +++ /dev/null @@ -1,136 +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 QueueJobResponseDto { - /// Returns a new [QueueJobResponseDto] instance. - QueueJobResponseDto({ - required this.data, - this.id, - required this.name, - required this.timestamp, - }); - - /// Job data payload - Object data; - - /// Job ID - /// - /// 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? id; - - /// Job name - JobName name; - - /// Job creation timestamp - int timestamp; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueJobResponseDto && - other.data == data && - other.id == id && - other.name == name && - other.timestamp == timestamp; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (data.hashCode) + - (id == null ? 0 : id!.hashCode) + - (name.hashCode) + - (timestamp.hashCode); - - @override - String toString() => 'QueueJobResponseDto[data=$data, id=$id, name=$name, timestamp=$timestamp]'; - - Map toJson() { - final json = {}; - json[r'data'] = this.data; - if (this.id != null) { - json[r'id'] = this.id; - } else { - // json[r'id'] = null; - } - json[r'name'] = this.name; - json[r'timestamp'] = this.timestamp; - return json; - } - - /// Returns a new [QueueJobResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueJobResponseDto? fromJson(dynamic value) { - upgradeDto(value, "QueueJobResponseDto"); - if (value is Map) { - final json = value.cast(); - - return QueueJobResponseDto( - data: mapValueOfType(json, r'data')!, - id: mapValueOfType(json, r'id'), - name: JobName.fromJson(json[r'name'])!, - timestamp: mapValueOfType(json, r'timestamp')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueJobResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueJobResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueJobResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueJobResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'data', - 'name', - 'timestamp', - }; -} - diff --git a/mobile/openapi/lib/model/queue_job_status.dart b/mobile/openapi/lib/model/queue_job_status.dart deleted file mode 100644 index 03a1371cc5..0000000000 --- a/mobile/openapi/lib/model/queue_job_status.dart +++ /dev/null @@ -1,97 +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 QueueJobStatus { - /// Instantiate a new enum with the provided [value]. - const QueueJobStatus._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const active = QueueJobStatus._(r'active'); - static const failed = QueueJobStatus._(r'failed'); - static const completed = QueueJobStatus._(r'completed'); - static const delayed = QueueJobStatus._(r'delayed'); - static const waiting = QueueJobStatus._(r'waiting'); - static const paused = QueueJobStatus._(r'paused'); - - /// List of all possible values in this [enum][QueueJobStatus]. - static const values = [ - active, - failed, - completed, - delayed, - waiting, - paused, - ]; - - static QueueJobStatus? fromJson(dynamic value) => QueueJobStatusTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueJobStatus.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [QueueJobStatus] to String, -/// and [decode] dynamic data back to [QueueJobStatus]. -class QueueJobStatusTypeTransformer { - factory QueueJobStatusTypeTransformer() => _instance ??= const QueueJobStatusTypeTransformer._(); - - const QueueJobStatusTypeTransformer._(); - - String encode(QueueJobStatus data) => data.value; - - /// Decodes a [dynamic value][data] to a QueueJobStatus. - /// - /// 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. - QueueJobStatus? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'active': return QueueJobStatus.active; - case r'failed': return QueueJobStatus.failed; - case r'completed': return QueueJobStatus.completed; - case r'delayed': return QueueJobStatus.delayed; - case r'waiting': return QueueJobStatus.waiting; - case r'paused': return QueueJobStatus.paused; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [QueueJobStatusTypeTransformer] instance. - static QueueJobStatusTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/queue_name.dart b/mobile/openapi/lib/model/queue_name.dart deleted file mode 100644 index d94304d0d3..0000000000 --- a/mobile/openapi/lib/model/queue_name.dart +++ /dev/null @@ -1,133 +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 QueueName { - /// Instantiate a new enum with the provided [value]. - const QueueName._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const thumbnailGeneration = QueueName._(r'thumbnailGeneration'); - static const metadataExtraction = QueueName._(r'metadataExtraction'); - static const videoConversion = QueueName._(r'videoConversion'); - static const faceDetection = QueueName._(r'faceDetection'); - static const facialRecognition = QueueName._(r'facialRecognition'); - static const smartSearch = QueueName._(r'smartSearch'); - static const duplicateDetection = QueueName._(r'duplicateDetection'); - static const backgroundTask = QueueName._(r'backgroundTask'); - static const storageTemplateMigration = QueueName._(r'storageTemplateMigration'); - static const migration = QueueName._(r'migration'); - static const search = QueueName._(r'search'); - static const sidecar = QueueName._(r'sidecar'); - static const library_ = QueueName._(r'library'); - static const notifications = QueueName._(r'notifications'); - static const backupDatabase = QueueName._(r'backupDatabase'); - static const ocr = QueueName._(r'ocr'); - static const workflow = QueueName._(r'workflow'); - static const editor = QueueName._(r'editor'); - - /// List of all possible values in this [enum][QueueName]. - static const values = [ - thumbnailGeneration, - metadataExtraction, - videoConversion, - faceDetection, - facialRecognition, - smartSearch, - duplicateDetection, - backgroundTask, - storageTemplateMigration, - migration, - search, - sidecar, - library_, - notifications, - backupDatabase, - ocr, - workflow, - editor, - ]; - - static QueueName? fromJson(dynamic value) => QueueNameTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueName.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [QueueName] to String, -/// and [decode] dynamic data back to [QueueName]. -class QueueNameTypeTransformer { - factory QueueNameTypeTransformer() => _instance ??= const QueueNameTypeTransformer._(); - - const QueueNameTypeTransformer._(); - - String encode(QueueName data) => data.value; - - /// Decodes a [dynamic value][data] to a QueueName. - /// - /// 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. - QueueName? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'thumbnailGeneration': return QueueName.thumbnailGeneration; - case r'metadataExtraction': return QueueName.metadataExtraction; - case r'videoConversion': return QueueName.videoConversion; - case r'faceDetection': return QueueName.faceDetection; - case r'facialRecognition': return QueueName.facialRecognition; - case r'smartSearch': return QueueName.smartSearch; - case r'duplicateDetection': return QueueName.duplicateDetection; - case r'backgroundTask': return QueueName.backgroundTask; - case r'storageTemplateMigration': return QueueName.storageTemplateMigration; - case r'migration': return QueueName.migration; - case r'search': return QueueName.search; - case r'sidecar': return QueueName.sidecar; - case r'library': return QueueName.library_; - case r'notifications': return QueueName.notifications; - case r'backupDatabase': return QueueName.backupDatabase; - case r'ocr': return QueueName.ocr; - case r'workflow': return QueueName.workflow; - case r'editor': return QueueName.editor; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [QueueNameTypeTransformer] instance. - static QueueNameTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/queue_response_dto.dart b/mobile/openapi/lib/model/queue_response_dto.dart deleted file mode 100644 index ac9244514c..0000000000 --- a/mobile/openapi/lib/model/queue_response_dto.dart +++ /dev/null @@ -1,117 +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 QueueResponseDto { - /// Returns a new [QueueResponseDto] instance. - QueueResponseDto({ - required this.isPaused, - required this.name, - required this.statistics, - }); - - /// Whether the queue is paused - bool isPaused; - - /// Queue name - QueueName name; - - QueueStatisticsDto statistics; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueResponseDto && - other.isPaused == isPaused && - other.name == name && - other.statistics == statistics; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isPaused.hashCode) + - (name.hashCode) + - (statistics.hashCode); - - @override - String toString() => 'QueueResponseDto[isPaused=$isPaused, name=$name, statistics=$statistics]'; - - Map toJson() { - final json = {}; - json[r'isPaused'] = this.isPaused; - json[r'name'] = this.name; - json[r'statistics'] = this.statistics; - return json; - } - - /// Returns a new [QueueResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueResponseDto? fromJson(dynamic value) { - upgradeDto(value, "QueueResponseDto"); - if (value is Map) { - final json = value.cast(); - - return QueueResponseDto( - isPaused: mapValueOfType(json, r'isPaused')!, - name: QueueName.fromJson(json[r'name'])!, - statistics: QueueStatisticsDto.fromJson(json[r'statistics'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'isPaused', - 'name', - 'statistics', - }; -} - diff --git a/mobile/openapi/lib/model/queue_response_legacy_dto.dart b/mobile/openapi/lib/model/queue_response_legacy_dto.dart deleted file mode 100644 index 214b0b31f6..0000000000 --- a/mobile/openapi/lib/model/queue_response_legacy_dto.dart +++ /dev/null @@ -1,107 +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 QueueResponseLegacyDto { - /// Returns a new [QueueResponseLegacyDto] instance. - QueueResponseLegacyDto({ - required this.jobCounts, - required this.queueStatus, - }); - - QueueStatisticsDto jobCounts; - - QueueStatusLegacyDto queueStatus; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueResponseLegacyDto && - other.jobCounts == jobCounts && - other.queueStatus == queueStatus; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (jobCounts.hashCode) + - (queueStatus.hashCode); - - @override - String toString() => 'QueueResponseLegacyDto[jobCounts=$jobCounts, queueStatus=$queueStatus]'; - - Map toJson() { - final json = {}; - json[r'jobCounts'] = this.jobCounts; - json[r'queueStatus'] = this.queueStatus; - return json; - } - - /// Returns a new [QueueResponseLegacyDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueResponseLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueueResponseLegacyDto"); - if (value is Map) { - final json = value.cast(); - - return QueueResponseLegacyDto( - jobCounts: QueueStatisticsDto.fromJson(json[r'jobCounts'])!, - queueStatus: QueueStatusLegacyDto.fromJson(json[r'queueStatus'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueResponseLegacyDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueResponseLegacyDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueResponseLegacyDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueResponseLegacyDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'jobCounts', - 'queueStatus', - }; -} - diff --git a/mobile/openapi/lib/model/queue_statistics_dto.dart b/mobile/openapi/lib/model/queue_statistics_dto.dart deleted file mode 100644 index c9a37ee30a..0000000000 --- a/mobile/openapi/lib/model/queue_statistics_dto.dart +++ /dev/null @@ -1,145 +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 QueueStatisticsDto { - /// Returns a new [QueueStatisticsDto] instance. - QueueStatisticsDto({ - required this.active, - required this.completed, - required this.delayed, - required this.failed, - required this.paused, - required this.waiting, - }); - - /// Number of active jobs - int active; - - /// Number of completed jobs - int completed; - - /// Number of delayed jobs - int delayed; - - /// Number of failed jobs - int failed; - - /// Number of paused jobs - int paused; - - /// Number of waiting jobs - int waiting; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueStatisticsDto && - other.active == active && - other.completed == completed && - other.delayed == delayed && - other.failed == failed && - other.paused == paused && - other.waiting == waiting; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (active.hashCode) + - (completed.hashCode) + - (delayed.hashCode) + - (failed.hashCode) + - (paused.hashCode) + - (waiting.hashCode); - - @override - String toString() => 'QueueStatisticsDto[active=$active, completed=$completed, delayed=$delayed, failed=$failed, paused=$paused, waiting=$waiting]'; - - Map toJson() { - final json = {}; - json[r'active'] = this.active; - json[r'completed'] = this.completed; - json[r'delayed'] = this.delayed; - json[r'failed'] = this.failed; - json[r'paused'] = this.paused; - json[r'waiting'] = this.waiting; - return json; - } - - /// Returns a new [QueueStatisticsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueStatisticsDto? fromJson(dynamic value) { - upgradeDto(value, "QueueStatisticsDto"); - if (value is Map) { - final json = value.cast(); - - return QueueStatisticsDto( - active: mapValueOfType(json, r'active')!, - completed: mapValueOfType(json, r'completed')!, - delayed: mapValueOfType(json, r'delayed')!, - failed: mapValueOfType(json, r'failed')!, - paused: mapValueOfType(json, r'paused')!, - waiting: mapValueOfType(json, r'waiting')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueStatisticsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueStatisticsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueStatisticsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueStatisticsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'active', - 'completed', - 'delayed', - 'failed', - 'paused', - 'waiting', - }; -} - diff --git a/mobile/openapi/lib/model/queue_status_legacy_dto.dart b/mobile/openapi/lib/model/queue_status_legacy_dto.dart deleted file mode 100644 index de6ce63319..0000000000 --- a/mobile/openapi/lib/model/queue_status_legacy_dto.dart +++ /dev/null @@ -1,109 +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 QueueStatusLegacyDto { - /// Returns a new [QueueStatusLegacyDto] instance. - QueueStatusLegacyDto({ - required this.isActive, - required this.isPaused, - }); - - /// Whether the queue is currently active (has running jobs) - bool isActive; - - /// Whether the queue is paused - bool isPaused; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueStatusLegacyDto && - other.isActive == isActive && - other.isPaused == isPaused; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isActive.hashCode) + - (isPaused.hashCode); - - @override - String toString() => 'QueueStatusLegacyDto[isActive=$isActive, isPaused=$isPaused]'; - - Map toJson() { - final json = {}; - json[r'isActive'] = this.isActive; - json[r'isPaused'] = this.isPaused; - return json; - } - - /// Returns a new [QueueStatusLegacyDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueStatusLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueueStatusLegacyDto"); - if (value is Map) { - final json = value.cast(); - - return QueueStatusLegacyDto( - isActive: mapValueOfType(json, r'isActive')!, - isPaused: mapValueOfType(json, r'isPaused')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueStatusLegacyDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueStatusLegacyDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueStatusLegacyDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueStatusLegacyDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'isActive', - 'isPaused', - }; -} - diff --git a/mobile/openapi/lib/model/queue_update_dto.dart b/mobile/openapi/lib/model/queue_update_dto.dart deleted file mode 100644 index 28aafe95f7..0000000000 --- a/mobile/openapi/lib/model/queue_update_dto.dart +++ /dev/null @@ -1,109 +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 QueueUpdateDto { - /// Returns a new [QueueUpdateDto] instance. - QueueUpdateDto({ - this.isPaused, - }); - - /// Whether to pause the queue - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isPaused; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueueUpdateDto && - other.isPaused == isPaused; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isPaused == null ? 0 : isPaused!.hashCode); - - @override - String toString() => 'QueueUpdateDto[isPaused=$isPaused]'; - - Map toJson() { - final json = {}; - if (this.isPaused != null) { - json[r'isPaused'] = this.isPaused; - } else { - // json[r'isPaused'] = null; - } - return json; - } - - /// Returns a new [QueueUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueueUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "QueueUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return QueueUpdateDto( - isPaused: mapValueOfType(json, r'isPaused'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueueUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueueUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueueUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueueUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/queues_response_legacy_dto.dart b/mobile/openapi/lib/model/queues_response_legacy_dto.dart deleted file mode 100644 index c7bc23cb4d..0000000000 --- a/mobile/openapi/lib/model/queues_response_legacy_dto.dart +++ /dev/null @@ -1,235 +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 QueuesResponseLegacyDto { - /// Returns a new [QueuesResponseLegacyDto] instance. - QueuesResponseLegacyDto({ - required this.backgroundTask, - required this.backupDatabase, - required this.duplicateDetection, - required this.editor, - required this.faceDetection, - required this.facialRecognition, - required this.library_, - required this.metadataExtraction, - required this.migration, - required this.notifications, - required this.ocr, - required this.search, - required this.sidecar, - required this.smartSearch, - required this.storageTemplateMigration, - required this.thumbnailGeneration, - required this.videoConversion, - required this.workflow, - }); - - QueueResponseLegacyDto backgroundTask; - - QueueResponseLegacyDto backupDatabase; - - QueueResponseLegacyDto duplicateDetection; - - QueueResponseLegacyDto editor; - - QueueResponseLegacyDto faceDetection; - - QueueResponseLegacyDto facialRecognition; - - QueueResponseLegacyDto library_; - - QueueResponseLegacyDto metadataExtraction; - - QueueResponseLegacyDto migration; - - QueueResponseLegacyDto notifications; - - QueueResponseLegacyDto ocr; - - QueueResponseLegacyDto search; - - QueueResponseLegacyDto sidecar; - - QueueResponseLegacyDto smartSearch; - - QueueResponseLegacyDto storageTemplateMigration; - - QueueResponseLegacyDto thumbnailGeneration; - - QueueResponseLegacyDto videoConversion; - - QueueResponseLegacyDto workflow; - - @override - bool operator ==(Object other) => identical(this, other) || other is QueuesResponseLegacyDto && - other.backgroundTask == backgroundTask && - other.backupDatabase == backupDatabase && - other.duplicateDetection == duplicateDetection && - other.editor == editor && - other.faceDetection == faceDetection && - other.facialRecognition == facialRecognition && - other.library_ == library_ && - other.metadataExtraction == metadataExtraction && - other.migration == migration && - other.notifications == notifications && - other.ocr == ocr && - other.search == search && - other.sidecar == sidecar && - other.smartSearch == smartSearch && - other.storageTemplateMigration == storageTemplateMigration && - other.thumbnailGeneration == thumbnailGeneration && - other.videoConversion == videoConversion && - other.workflow == workflow; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (backgroundTask.hashCode) + - (backupDatabase.hashCode) + - (duplicateDetection.hashCode) + - (editor.hashCode) + - (faceDetection.hashCode) + - (facialRecognition.hashCode) + - (library_.hashCode) + - (metadataExtraction.hashCode) + - (migration.hashCode) + - (notifications.hashCode) + - (ocr.hashCode) + - (search.hashCode) + - (sidecar.hashCode) + - (smartSearch.hashCode) + - (storageTemplateMigration.hashCode) + - (thumbnailGeneration.hashCode) + - (videoConversion.hashCode) + - (workflow.hashCode); - - @override - String toString() => 'QueuesResponseLegacyDto[backgroundTask=$backgroundTask, backupDatabase=$backupDatabase, duplicateDetection=$duplicateDetection, editor=$editor, faceDetection=$faceDetection, facialRecognition=$facialRecognition, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, storageTemplateMigration=$storageTemplateMigration, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]'; - - Map toJson() { - final json = {}; - json[r'backgroundTask'] = this.backgroundTask; - json[r'backupDatabase'] = this.backupDatabase; - json[r'duplicateDetection'] = this.duplicateDetection; - json[r'editor'] = this.editor; - json[r'faceDetection'] = this.faceDetection; - json[r'facialRecognition'] = this.facialRecognition; - json[r'library'] = this.library_; - json[r'metadataExtraction'] = this.metadataExtraction; - json[r'migration'] = this.migration; - json[r'notifications'] = this.notifications; - json[r'ocr'] = this.ocr; - json[r'search'] = this.search; - json[r'sidecar'] = this.sidecar; - json[r'smartSearch'] = this.smartSearch; - json[r'storageTemplateMigration'] = this.storageTemplateMigration; - json[r'thumbnailGeneration'] = this.thumbnailGeneration; - json[r'videoConversion'] = this.videoConversion; - json[r'workflow'] = this.workflow; - return json; - } - - /// Returns a new [QueuesResponseLegacyDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QueuesResponseLegacyDto? fromJson(dynamic value) { - upgradeDto(value, "QueuesResponseLegacyDto"); - if (value is Map) { - final json = value.cast(); - - return QueuesResponseLegacyDto( - backgroundTask: QueueResponseLegacyDto.fromJson(json[r'backgroundTask'])!, - backupDatabase: QueueResponseLegacyDto.fromJson(json[r'backupDatabase'])!, - duplicateDetection: QueueResponseLegacyDto.fromJson(json[r'duplicateDetection'])!, - editor: QueueResponseLegacyDto.fromJson(json[r'editor'])!, - faceDetection: QueueResponseLegacyDto.fromJson(json[r'faceDetection'])!, - facialRecognition: QueueResponseLegacyDto.fromJson(json[r'facialRecognition'])!, - library_: QueueResponseLegacyDto.fromJson(json[r'library'])!, - metadataExtraction: QueueResponseLegacyDto.fromJson(json[r'metadataExtraction'])!, - migration: QueueResponseLegacyDto.fromJson(json[r'migration'])!, - notifications: QueueResponseLegacyDto.fromJson(json[r'notifications'])!, - ocr: QueueResponseLegacyDto.fromJson(json[r'ocr'])!, - search: QueueResponseLegacyDto.fromJson(json[r'search'])!, - sidecar: QueueResponseLegacyDto.fromJson(json[r'sidecar'])!, - smartSearch: QueueResponseLegacyDto.fromJson(json[r'smartSearch'])!, - storageTemplateMigration: QueueResponseLegacyDto.fromJson(json[r'storageTemplateMigration'])!, - thumbnailGeneration: QueueResponseLegacyDto.fromJson(json[r'thumbnailGeneration'])!, - videoConversion: QueueResponseLegacyDto.fromJson(json[r'videoConversion'])!, - workflow: QueueResponseLegacyDto.fromJson(json[r'workflow'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = QueuesResponseLegacyDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = QueuesResponseLegacyDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QueuesResponseLegacyDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = QueuesResponseLegacyDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'backgroundTask', - 'backupDatabase', - 'duplicateDetection', - 'editor', - 'faceDetection', - 'facialRecognition', - 'library', - 'metadataExtraction', - 'migration', - 'notifications', - 'ocr', - 'search', - 'sidecar', - 'smartSearch', - 'storageTemplateMigration', - 'thumbnailGeneration', - 'videoConversion', - 'workflow', - }; -} - diff --git a/mobile/openapi/lib/model/random_search_dto.dart b/mobile/openapi/lib/model/random_search_dto.dart deleted file mode 100644 index 7e0fb0c5c2..0000000000 --- a/mobile/openapi/lib/model/random_search_dto.dart +++ /dev/null @@ -1,635 +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 RandomSearchDto { - /// Returns a new [RandomSearchDto] instance. - RandomSearchDto({ - this.albumIds = const [], - this.city, - this.country, - this.createdAfter, - this.createdBefore, - this.deviceId, - this.isEncoded, - this.isFavorite, - this.isMotion, - this.isNotInAlbum, - this.isOffline, - this.lensModel, - this.libraryId, - this.make, - this.model, - this.ocr, - this.personIds = const [], - this.rating, - this.size, - this.state, - this.tagIds = const [], - this.takenAfter, - this.takenBefore, - this.trashedAfter, - this.trashedBefore, - this.type, - this.updatedAfter, - this.updatedBefore, - this.visibility, - this.withDeleted, - this.withExif, - this.withPeople, - this.withStacked, - }); - - /// Filter by album IDs - List albumIds; - - /// Filter by city name - String? city; - - /// Filter by country name - String? country; - - /// Filter by creation date (after) - /// - /// 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? createdAfter; - - /// Filter by creation date (before) - /// - /// 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? createdBefore; - - /// Device ID to filter by - /// - /// 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? deviceId; - - /// Filter by encoded status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isEncoded; - - /// Filter by favorite status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Filter by motion photo status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isMotion; - - /// Filter assets not in any album - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isNotInAlbum; - - /// Filter by offline status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isOffline; - - /// Filter by lens model - String? lensModel; - - /// Library ID to filter by - String? libraryId; - - /// Filter by camera make - /// - /// 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? make; - - /// Filter by camera model - String? model; - - /// Filter by OCR text content - /// - /// 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? ocr; - - /// Filter by person IDs - List personIds; - - /// Filter by rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Number of results to return - /// - /// Minimum value: 1 - /// Maximum value: 1000 - /// - /// 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. - /// - num? size; - - /// Filter by state/province name - String? state; - - /// Filter by tag IDs - List? tagIds; - - /// Filter by taken date (after) - /// - /// 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? takenAfter; - - /// Filter by taken date (before) - /// - /// 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? takenBefore; - - /// Filter by trash date (after) - /// - /// 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? trashedAfter; - - /// Filter by trash date (before) - /// - /// 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? trashedBefore; - - /// Asset type filter - /// - /// 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. - /// - AssetTypeEnum? type; - - /// Filter by update date (after) - /// - /// 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? updatedAfter; - - /// Filter by update date (before) - /// - /// 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? updatedBefore; - - /// Filter by visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - /// Include deleted assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withDeleted; - - /// Include EXIF data in response - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withExif; - - /// Include assets with people - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withPeople; - - /// Include stacked assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withStacked; - - @override - bool operator ==(Object other) => identical(this, other) || other is RandomSearchDto && - _deepEquality.equals(other.albumIds, albumIds) && - other.city == city && - other.country == country && - other.createdAfter == createdAfter && - other.createdBefore == createdBefore && - other.deviceId == deviceId && - other.isEncoded == isEncoded && - other.isFavorite == isFavorite && - other.isMotion == isMotion && - other.isNotInAlbum == isNotInAlbum && - other.isOffline == isOffline && - other.lensModel == lensModel && - other.libraryId == libraryId && - other.make == make && - other.model == model && - other.ocr == ocr && - _deepEquality.equals(other.personIds, personIds) && - other.rating == rating && - other.size == size && - other.state == state && - _deepEquality.equals(other.tagIds, tagIds) && - other.takenAfter == takenAfter && - other.takenBefore == takenBefore && - other.trashedAfter == trashedAfter && - other.trashedBefore == trashedBefore && - other.type == type && - other.updatedAfter == updatedAfter && - other.updatedBefore == updatedBefore && - other.visibility == visibility && - other.withDeleted == withDeleted && - other.withExif == withExif && - other.withPeople == withPeople && - other.withStacked == withStacked; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumIds.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (createdAfter == null ? 0 : createdAfter!.hashCode) + - (createdBefore == null ? 0 : createdBefore!.hashCode) + - (deviceId == null ? 0 : deviceId!.hashCode) + - (isEncoded == null ? 0 : isEncoded!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isMotion == null ? 0 : isMotion!.hashCode) + - (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + - (isOffline == null ? 0 : isOffline!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (ocr == null ? 0 : ocr!.hashCode) + - (personIds.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (tagIds == null ? 0 : tagIds!.hashCode) + - (takenAfter == null ? 0 : takenAfter!.hashCode) + - (takenBefore == null ? 0 : takenBefore!.hashCode) + - (trashedAfter == null ? 0 : trashedAfter!.hashCode) + - (trashedBefore == null ? 0 : trashedBefore!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (updatedAfter == null ? 0 : updatedAfter!.hashCode) + - (updatedBefore == null ? 0 : updatedBefore!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode) + - (withDeleted == null ? 0 : withDeleted!.hashCode) + - (withExif == null ? 0 : withExif!.hashCode) + - (withPeople == null ? 0 : withPeople!.hashCode) + - (withStacked == null ? 0 : withStacked!.hashCode); - - @override - String toString() => 'RandomSearchDto[albumIds=$albumIds, city=$city, country=$country, createdAfter=$createdAfter, createdBefore=$createdBefore, deviceId=$deviceId, isEncoded=$isEncoded, isFavorite=$isFavorite, isMotion=$isMotion, isNotInAlbum=$isNotInAlbum, isOffline=$isOffline, lensModel=$lensModel, libraryId=$libraryId, make=$make, model=$model, ocr=$ocr, personIds=$personIds, rating=$rating, size=$size, state=$state, tagIds=$tagIds, takenAfter=$takenAfter, takenBefore=$takenBefore, trashedAfter=$trashedAfter, trashedBefore=$trashedBefore, type=$type, updatedAfter=$updatedAfter, updatedBefore=$updatedBefore, visibility=$visibility, withDeleted=$withDeleted, withExif=$withExif, withPeople=$withPeople, withStacked=$withStacked]'; - - Map toJson() { - final json = {}; - json[r'albumIds'] = this.albumIds; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.createdAfter != null) { - json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); - } else { - // json[r'createdAfter'] = null; - } - if (this.createdBefore != null) { - json[r'createdBefore'] = this.createdBefore!.toUtc().toIso8601String(); - } else { - // json[r'createdBefore'] = null; - } - if (this.deviceId != null) { - json[r'deviceId'] = this.deviceId; - } else { - // json[r'deviceId'] = null; - } - if (this.isEncoded != null) { - json[r'isEncoded'] = this.isEncoded; - } else { - // json[r'isEncoded'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isMotion != null) { - json[r'isMotion'] = this.isMotion; - } else { - // json[r'isMotion'] = null; - } - if (this.isNotInAlbum != null) { - json[r'isNotInAlbum'] = this.isNotInAlbum; - } else { - // json[r'isNotInAlbum'] = null; - } - if (this.isOffline != null) { - json[r'isOffline'] = this.isOffline; - } else { - // json[r'isOffline'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.ocr != null) { - json[r'ocr'] = this.ocr; - } else { - // json[r'ocr'] = null; - } - json[r'personIds'] = this.personIds; - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.size != null) { - json[r'size'] = this.size; - } else { - // json[r'size'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.tagIds != null) { - json[r'tagIds'] = this.tagIds; - } else { - // json[r'tagIds'] = null; - } - if (this.takenAfter != null) { - json[r'takenAfter'] = this.takenAfter!.toUtc().toIso8601String(); - } else { - // json[r'takenAfter'] = null; - } - if (this.takenBefore != null) { - json[r'takenBefore'] = this.takenBefore!.toUtc().toIso8601String(); - } else { - // json[r'takenBefore'] = null; - } - if (this.trashedAfter != null) { - json[r'trashedAfter'] = this.trashedAfter!.toUtc().toIso8601String(); - } else { - // json[r'trashedAfter'] = null; - } - if (this.trashedBefore != null) { - json[r'trashedBefore'] = this.trashedBefore!.toUtc().toIso8601String(); - } else { - // json[r'trashedBefore'] = null; - } - if (this.type != null) { - json[r'type'] = this.type; - } else { - // json[r'type'] = null; - } - if (this.updatedAfter != null) { - json[r'updatedAfter'] = this.updatedAfter!.toUtc().toIso8601String(); - } else { - // json[r'updatedAfter'] = null; - } - if (this.updatedBefore != null) { - json[r'updatedBefore'] = this.updatedBefore!.toUtc().toIso8601String(); - } else { - // json[r'updatedBefore'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - if (this.withDeleted != null) { - json[r'withDeleted'] = this.withDeleted; - } else { - // json[r'withDeleted'] = null; - } - if (this.withExif != null) { - json[r'withExif'] = this.withExif; - } else { - // json[r'withExif'] = null; - } - if (this.withPeople != null) { - json[r'withPeople'] = this.withPeople; - } else { - // json[r'withPeople'] = null; - } - if (this.withStacked != null) { - json[r'withStacked'] = this.withStacked; - } else { - // json[r'withStacked'] = null; - } - return json; - } - - /// Returns a new [RandomSearchDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static RandomSearchDto? fromJson(dynamic value) { - upgradeDto(value, "RandomSearchDto"); - if (value is Map) { - final json = value.cast(); - - return RandomSearchDto( - albumIds: json[r'albumIds'] is Iterable - ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) - : const [], - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), - deviceId: mapValueOfType(json, r'deviceId'), - isEncoded: mapValueOfType(json, r'isEncoded'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isMotion: mapValueOfType(json, r'isMotion'), - isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), - isOffline: mapValueOfType(json, r'isOffline'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - ocr: mapValueOfType(json, r'ocr'), - personIds: json[r'personIds'] is Iterable - ? (json[r'personIds'] as Iterable).cast().toList(growable: false) - : const [], - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), - tagIds: json[r'tagIds'] is Iterable - ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) - : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), - type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), - visibility: AssetVisibility.fromJson(json[r'visibility']), - withDeleted: mapValueOfType(json, r'withDeleted'), - withExif: mapValueOfType(json, r'withExif'), - withPeople: mapValueOfType(json, r'withPeople'), - withStacked: mapValueOfType(json, r'withStacked'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = RandomSearchDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = RandomSearchDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of RandomSearchDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = RandomSearchDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/ratings_response.dart b/mobile/openapi/lib/model/ratings_response.dart deleted file mode 100644 index 4346fa5c58..0000000000 --- a/mobile/openapi/lib/model/ratings_response.dart +++ /dev/null @@ -1,100 +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 RatingsResponse { - /// Returns a new [RatingsResponse] instance. - RatingsResponse({ - this.enabled = false, - }); - - /// Whether ratings are enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is RatingsResponse && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode); - - @override - String toString() => 'RatingsResponse[enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [RatingsResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static RatingsResponse? fromJson(dynamic value) { - upgradeDto(value, "RatingsResponse"); - if (value is Map) { - final json = value.cast(); - - return RatingsResponse( - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = RatingsResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = RatingsResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of RatingsResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = RatingsResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/ratings_update.dart b/mobile/openapi/lib/model/ratings_update.dart deleted file mode 100644 index 8079172e21..0000000000 --- a/mobile/openapi/lib/model/ratings_update.dart +++ /dev/null @@ -1,109 +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 RatingsUpdate { - /// Returns a new [RatingsUpdate] instance. - RatingsUpdate({ - this.enabled, - }); - - /// Whether ratings are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is RatingsUpdate && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled == null ? 0 : enabled!.hashCode); - - @override - String toString() => 'RatingsUpdate[enabled=$enabled]'; - - Map toJson() { - final json = {}; - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - return json; - } - - /// Returns a new [RatingsUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static RatingsUpdate? fromJson(dynamic value) { - upgradeDto(value, "RatingsUpdate"); - if (value is Map) { - final json = value.cast(); - - return RatingsUpdate( - enabled: mapValueOfType(json, r'enabled'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = RatingsUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = RatingsUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of RatingsUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = RatingsUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/reaction_level.dart b/mobile/openapi/lib/model/reaction_level.dart deleted file mode 100644 index 29568b9d11..0000000000 --- a/mobile/openapi/lib/model/reaction_level.dart +++ /dev/null @@ -1,85 +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 ReactionLevel { - /// Instantiate a new enum with the provided [value]. - const ReactionLevel._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const album = ReactionLevel._(r'album'); - static const asset = ReactionLevel._(r'asset'); - - /// List of all possible values in this [enum][ReactionLevel]. - static const values = [ - album, - asset, - ]; - - static ReactionLevel? fromJson(dynamic value) => ReactionLevelTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ReactionLevel.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [ReactionLevel] to String, -/// and [decode] dynamic data back to [ReactionLevel]. -class ReactionLevelTypeTransformer { - factory ReactionLevelTypeTransformer() => _instance ??= const ReactionLevelTypeTransformer._(); - - const ReactionLevelTypeTransformer._(); - - String encode(ReactionLevel data) => data.value; - - /// Decodes a [dynamic value][data] to a ReactionLevel. - /// - /// 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. - ReactionLevel? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'album': return ReactionLevel.album; - case r'asset': return ReactionLevel.asset; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ReactionLevelTypeTransformer] instance. - static ReactionLevelTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/reaction_type.dart b/mobile/openapi/lib/model/reaction_type.dart deleted file mode 100644 index 4c788138fb..0000000000 --- a/mobile/openapi/lib/model/reaction_type.dart +++ /dev/null @@ -1,85 +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 ReactionType { - /// Instantiate a new enum with the provided [value]. - const ReactionType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const comment = ReactionType._(r'comment'); - static const like = ReactionType._(r'like'); - - /// List of all possible values in this [enum][ReactionType]. - static const values = [ - comment, - like, - ]; - - static ReactionType? fromJson(dynamic value) => ReactionTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ReactionType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [ReactionType] to String, -/// and [decode] dynamic data back to [ReactionType]. -class ReactionTypeTypeTransformer { - factory ReactionTypeTypeTransformer() => _instance ??= const ReactionTypeTypeTransformer._(); - - const ReactionTypeTypeTransformer._(); - - String encode(ReactionType data) => data.value; - - /// Decodes a [dynamic value][data] to a ReactionType. - /// - /// 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. - ReactionType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'comment': return ReactionType.comment; - case r'like': return ReactionType.like; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ReactionTypeTypeTransformer] instance. - static ReactionTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart b/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart deleted file mode 100644 index 6ad8c1a7b9..0000000000 --- a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart +++ /dev/null @@ -1,117 +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 ReverseGeocodingStateResponseDto { - /// Returns a new [ReverseGeocodingStateResponseDto] instance. - ReverseGeocodingStateResponseDto({ - required this.lastImportFileName, - required this.lastUpdate, - }); - - /// Last import file name - String? lastImportFileName; - - /// Last update timestamp - String? lastUpdate; - - @override - bool operator ==(Object other) => identical(this, other) || other is ReverseGeocodingStateResponseDto && - other.lastImportFileName == lastImportFileName && - other.lastUpdate == lastUpdate; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (lastImportFileName == null ? 0 : lastImportFileName!.hashCode) + - (lastUpdate == null ? 0 : lastUpdate!.hashCode); - - @override - String toString() => 'ReverseGeocodingStateResponseDto[lastImportFileName=$lastImportFileName, lastUpdate=$lastUpdate]'; - - Map toJson() { - final json = {}; - if (this.lastImportFileName != null) { - json[r'lastImportFileName'] = this.lastImportFileName; - } else { - // json[r'lastImportFileName'] = null; - } - if (this.lastUpdate != null) { - json[r'lastUpdate'] = this.lastUpdate; - } else { - // json[r'lastUpdate'] = null; - } - return json; - } - - /// Returns a new [ReverseGeocodingStateResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ReverseGeocodingStateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ReverseGeocodingStateResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ReverseGeocodingStateResponseDto( - lastImportFileName: mapValueOfType(json, r'lastImportFileName'), - lastUpdate: mapValueOfType(json, r'lastUpdate'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ReverseGeocodingStateResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ReverseGeocodingStateResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ReverseGeocodingStateResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ReverseGeocodingStateResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'lastImportFileName', - 'lastUpdate', - }; -} - diff --git a/mobile/openapi/lib/model/rotate_parameters.dart b/mobile/openapi/lib/model/rotate_parameters.dart deleted file mode 100644 index 33609e83e5..0000000000 --- a/mobile/openapi/lib/model/rotate_parameters.dart +++ /dev/null @@ -1,100 +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 RotateParameters { - /// Returns a new [RotateParameters] instance. - RotateParameters({ - required this.angle, - }); - - /// Rotation angle in degrees - num angle; - - @override - bool operator ==(Object other) => identical(this, other) || other is RotateParameters && - other.angle == angle; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (angle.hashCode); - - @override - String toString() => 'RotateParameters[angle=$angle]'; - - Map toJson() { - final json = {}; - json[r'angle'] = this.angle; - return json; - } - - /// Returns a new [RotateParameters] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static RotateParameters? fromJson(dynamic value) { - upgradeDto(value, "RotateParameters"); - if (value is Map) { - final json = value.cast(); - - return RotateParameters( - angle: num.parse('${json[r'angle']}'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = RotateParameters.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = RotateParameters.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of RotateParameters-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = RotateParameters.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'angle', - }; -} - diff --git a/mobile/openapi/lib/model/search_album_response_dto.dart b/mobile/openapi/lib/model/search_album_response_dto.dart deleted file mode 100644 index 8841251e4a..0000000000 --- a/mobile/openapi/lib/model/search_album_response_dto.dart +++ /dev/null @@ -1,125 +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 SearchAlbumResponseDto { - /// Returns a new [SearchAlbumResponseDto] instance. - SearchAlbumResponseDto({ - required this.count, - this.facets = const [], - this.items = const [], - required this.total, - }); - - /// Number of albums in this page - int count; - - List facets; - - List items; - - /// Total number of matching albums - int total; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchAlbumResponseDto && - other.count == count && - _deepEquality.equals(other.facets, facets) && - _deepEquality.equals(other.items, items) && - other.total == total; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode) + - (facets.hashCode) + - (items.hashCode) + - (total.hashCode); - - @override - String toString() => 'SearchAlbumResponseDto[count=$count, facets=$facets, items=$items, total=$total]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - json[r'facets'] = this.facets; - json[r'items'] = this.items; - json[r'total'] = this.total; - return json; - } - - /// Returns a new [SearchAlbumResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchAlbumResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchAlbumResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchAlbumResponseDto( - count: mapValueOfType(json, r'count')!, - facets: SearchFacetResponseDto.listFromJson(json[r'facets']), - items: AlbumResponseDto.listFromJson(json[r'items']), - total: mapValueOfType(json, r'total')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchAlbumResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchAlbumResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchAlbumResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchAlbumResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - 'facets', - 'items', - 'total', - }; -} - diff --git a/mobile/openapi/lib/model/search_asset_response_dto.dart b/mobile/openapi/lib/model/search_asset_response_dto.dart deleted file mode 100644 index acb81f28e2..0000000000 --- a/mobile/openapi/lib/model/search_asset_response_dto.dart +++ /dev/null @@ -1,138 +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 SearchAssetResponseDto { - /// Returns a new [SearchAssetResponseDto] instance. - SearchAssetResponseDto({ - required this.count, - this.facets = const [], - this.items = const [], - required this.nextPage, - required this.total, - }); - - /// Number of assets in this page - int count; - - List facets; - - List items; - - /// Next page token - String? nextPage; - - /// Total number of matching assets - int total; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchAssetResponseDto && - other.count == count && - _deepEquality.equals(other.facets, facets) && - _deepEquality.equals(other.items, items) && - other.nextPage == nextPage && - other.total == total; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode) + - (facets.hashCode) + - (items.hashCode) + - (nextPage == null ? 0 : nextPage!.hashCode) + - (total.hashCode); - - @override - String toString() => 'SearchAssetResponseDto[count=$count, facets=$facets, items=$items, nextPage=$nextPage, total=$total]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - json[r'facets'] = this.facets; - json[r'items'] = this.items; - if (this.nextPage != null) { - json[r'nextPage'] = this.nextPage; - } else { - // json[r'nextPage'] = null; - } - json[r'total'] = this.total; - return json; - } - - /// Returns a new [SearchAssetResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchAssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchAssetResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchAssetResponseDto( - count: mapValueOfType(json, r'count')!, - facets: SearchFacetResponseDto.listFromJson(json[r'facets']), - items: AssetResponseDto.listFromJson(json[r'items']), - nextPage: mapValueOfType(json, r'nextPage'), - total: mapValueOfType(json, r'total')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchAssetResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchAssetResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchAssetResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchAssetResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - 'facets', - 'items', - 'nextPage', - 'total', - }; -} - diff --git a/mobile/openapi/lib/model/search_explore_item.dart b/mobile/openapi/lib/model/search_explore_item.dart deleted file mode 100644 index 4089011879..0000000000 --- a/mobile/openapi/lib/model/search_explore_item.dart +++ /dev/null @@ -1,108 +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 SearchExploreItem { - /// Returns a new [SearchExploreItem] instance. - SearchExploreItem({ - required this.data, - required this.value, - }); - - AssetResponseDto data; - - /// Explore value - String value; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchExploreItem && - other.data == data && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (data.hashCode) + - (value.hashCode); - - @override - String toString() => 'SearchExploreItem[data=$data, value=$value]'; - - Map toJson() { - final json = {}; - json[r'data'] = this.data; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [SearchExploreItem] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchExploreItem? fromJson(dynamic value) { - upgradeDto(value, "SearchExploreItem"); - if (value is Map) { - final json = value.cast(); - - return SearchExploreItem( - data: AssetResponseDto.fromJson(json[r'data'])!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchExploreItem.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchExploreItem.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchExploreItem-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchExploreItem.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'data', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/search_explore_response_dto.dart b/mobile/openapi/lib/model/search_explore_response_dto.dart deleted file mode 100644 index 07ce26c9b8..0000000000 --- a/mobile/openapi/lib/model/search_explore_response_dto.dart +++ /dev/null @@ -1,108 +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 SearchExploreResponseDto { - /// Returns a new [SearchExploreResponseDto] instance. - SearchExploreResponseDto({ - required this.fieldName, - this.items = const [], - }); - - /// Explore field name - String fieldName; - - List items; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchExploreResponseDto && - other.fieldName == fieldName && - _deepEquality.equals(other.items, items); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (fieldName.hashCode) + - (items.hashCode); - - @override - String toString() => 'SearchExploreResponseDto[fieldName=$fieldName, items=$items]'; - - Map toJson() { - final json = {}; - json[r'fieldName'] = this.fieldName; - json[r'items'] = this.items; - return json; - } - - /// Returns a new [SearchExploreResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchExploreResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchExploreResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchExploreResponseDto( - fieldName: mapValueOfType(json, r'fieldName')!, - items: SearchExploreItem.listFromJson(json[r'items']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchExploreResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchExploreResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchExploreResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchExploreResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'fieldName', - 'items', - }; -} - diff --git a/mobile/openapi/lib/model/search_facet_count_response_dto.dart b/mobile/openapi/lib/model/search_facet_count_response_dto.dart deleted file mode 100644 index 8318fbfb3b..0000000000 --- a/mobile/openapi/lib/model/search_facet_count_response_dto.dart +++ /dev/null @@ -1,109 +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 SearchFacetCountResponseDto { - /// Returns a new [SearchFacetCountResponseDto] instance. - SearchFacetCountResponseDto({ - required this.count, - required this.value, - }); - - /// Number of assets with this facet value - int count; - - /// Facet value - String value; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchFacetCountResponseDto && - other.count == count && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode) + - (value.hashCode); - - @override - String toString() => 'SearchFacetCountResponseDto[count=$count, value=$value]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [SearchFacetCountResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchFacetCountResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchFacetCountResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchFacetCountResponseDto( - count: mapValueOfType(json, r'count')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchFacetCountResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchFacetCountResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchFacetCountResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchFacetCountResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/search_facet_response_dto.dart b/mobile/openapi/lib/model/search_facet_response_dto.dart deleted file mode 100644 index 43b5ac5c81..0000000000 --- a/mobile/openapi/lib/model/search_facet_response_dto.dart +++ /dev/null @@ -1,109 +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 SearchFacetResponseDto { - /// Returns a new [SearchFacetResponseDto] instance. - SearchFacetResponseDto({ - this.counts = const [], - required this.fieldName, - }); - - /// Facet counts - List counts; - - /// Facet field name - String fieldName; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchFacetResponseDto && - _deepEquality.equals(other.counts, counts) && - other.fieldName == fieldName; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (counts.hashCode) + - (fieldName.hashCode); - - @override - String toString() => 'SearchFacetResponseDto[counts=$counts, fieldName=$fieldName]'; - - Map toJson() { - final json = {}; - json[r'counts'] = this.counts; - json[r'fieldName'] = this.fieldName; - return json; - } - - /// Returns a new [SearchFacetResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchFacetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchFacetResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchFacetResponseDto( - counts: SearchFacetCountResponseDto.listFromJson(json[r'counts']), - fieldName: mapValueOfType(json, r'fieldName')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchFacetResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchFacetResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchFacetResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchFacetResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'counts', - 'fieldName', - }; -} - diff --git a/mobile/openapi/lib/model/search_response_dto.dart b/mobile/openapi/lib/model/search_response_dto.dart deleted file mode 100644 index ca742ae35c..0000000000 --- a/mobile/openapi/lib/model/search_response_dto.dart +++ /dev/null @@ -1,107 +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 SearchResponseDto { - /// Returns a new [SearchResponseDto] instance. - SearchResponseDto({ - required this.albums, - required this.assets, - }); - - SearchAlbumResponseDto albums; - - SearchAssetResponseDto assets; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchResponseDto && - other.albums == albums && - other.assets == assets; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albums.hashCode) + - (assets.hashCode); - - @override - String toString() => 'SearchResponseDto[albums=$albums, assets=$assets]'; - - Map toJson() { - final json = {}; - json[r'albums'] = this.albums; - json[r'assets'] = this.assets; - return json; - } - - /// Returns a new [SearchResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchResponseDto( - albums: SearchAlbumResponseDto.fromJson(json[r'albums'])!, - assets: SearchAssetResponseDto.fromJson(json[r'assets'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albums', - 'assets', - }; -} - diff --git a/mobile/openapi/lib/model/search_statistics_response_dto.dart b/mobile/openapi/lib/model/search_statistics_response_dto.dart deleted file mode 100644 index 5aebe4d6a9..0000000000 --- a/mobile/openapi/lib/model/search_statistics_response_dto.dart +++ /dev/null @@ -1,100 +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 SearchStatisticsResponseDto { - /// Returns a new [SearchStatisticsResponseDto] instance. - SearchStatisticsResponseDto({ - required this.total, - }); - - /// Total number of matching assets - int total; - - @override - bool operator ==(Object other) => identical(this, other) || other is SearchStatisticsResponseDto && - other.total == total; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (total.hashCode); - - @override - String toString() => 'SearchStatisticsResponseDto[total=$total]'; - - Map toJson() { - final json = {}; - json[r'total'] = this.total; - return json; - } - - /// Returns a new [SearchStatisticsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SearchStatisticsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SearchStatisticsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SearchStatisticsResponseDto( - total: mapValueOfType(json, r'total')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchStatisticsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SearchStatisticsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SearchStatisticsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SearchStatisticsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'total', - }; -} - diff --git a/mobile/openapi/lib/model/search_suggestion_type.dart b/mobile/openapi/lib/model/search_suggestion_type.dart deleted file mode 100644 index b18fe687c4..0000000000 --- a/mobile/openapi/lib/model/search_suggestion_type.dart +++ /dev/null @@ -1,97 +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 SearchSuggestionType { - /// Instantiate a new enum with the provided [value]. - const SearchSuggestionType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const country = SearchSuggestionType._(r'country'); - static const state = SearchSuggestionType._(r'state'); - static const city = SearchSuggestionType._(r'city'); - static const cameraMake = SearchSuggestionType._(r'camera-make'); - static const cameraModel = SearchSuggestionType._(r'camera-model'); - static const cameraLensModel = SearchSuggestionType._(r'camera-lens-model'); - - /// List of all possible values in this [enum][SearchSuggestionType]. - static const values = [ - country, - state, - city, - cameraMake, - cameraModel, - cameraLensModel, - ]; - - static SearchSuggestionType? fromJson(dynamic value) => SearchSuggestionTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SearchSuggestionType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SearchSuggestionType] to String, -/// and [decode] dynamic data back to [SearchSuggestionType]. -class SearchSuggestionTypeTypeTransformer { - factory SearchSuggestionTypeTypeTransformer() => _instance ??= const SearchSuggestionTypeTypeTransformer._(); - - const SearchSuggestionTypeTypeTransformer._(); - - String encode(SearchSuggestionType data) => data.value; - - /// Decodes a [dynamic value][data] to a SearchSuggestionType. - /// - /// 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. - SearchSuggestionType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'country': return SearchSuggestionType.country; - case r'state': return SearchSuggestionType.state; - case r'city': return SearchSuggestionType.city; - case r'camera-make': return SearchSuggestionType.cameraMake; - case r'camera-model': return SearchSuggestionType.cameraModel; - case r'camera-lens-model': return SearchSuggestionType.cameraLensModel; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SearchSuggestionTypeTypeTransformer] instance. - static SearchSuggestionTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/server_about_response_dto.dart b/mobile/openapi/lib/model/server_about_response_dto.dart index 1ae53763fe..7e412b1ef0 100644 --- a/mobile/openapi/lib/model/server_about_response_dto.dart +++ b/mobile/openapi/lib/model/server_about_response_dto.dart @@ -13,112 +13,23 @@ part of openapi.api; class ServerAboutResponseDto { /// Returns a new [ServerAboutResponseDto] instance. ServerAboutResponseDto({ - this.build, - this.buildImage, - this.buildImageUrl, - this.buildUrl, - this.exiftool, - this.ffmpeg, - this.imagemagick, - this.libvips, - required this.licensed, - this.nodejs, - this.repository, - this.repositoryUrl, - this.sourceCommit, - this.sourceRef, - this.sourceUrl, - this.thirdPartyBugFeatureUrl, - this.thirdPartyDocumentationUrl, - this.thirdPartySourceUrl, - this.thirdPartySupportUrl, required this.version, required this.versionUrl, + this.repository, + this.repositoryUrl, + this.sourceRef, + this.sourceCommit, + this.sourceUrl, + this.build, + this.buildUrl, + this.nodejs, }); - /// Build identifier - /// - /// 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? build; + /// Server version + String version; - /// Build image name - /// - /// 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? buildImage; - - /// Build image URL - /// - /// 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? buildImageUrl; - - /// Build URL - /// - /// 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? buildUrl; - - /// ExifTool version - /// - /// 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? exiftool; - - /// FFmpeg version - /// - /// 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? ffmpeg; - - /// ImageMagick version - /// - /// 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? imagemagick; - - /// libvips version - /// - /// 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? libvips; - - /// Whether the server is licensed - bool licensed; - - /// Node.js version - /// - /// 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? nodejs; + /// URL to version information + String versionUrl; /// Repository name /// @@ -138,15 +49,6 @@ class ServerAboutResponseDto { /// String? repositoryUrl; - /// Source commit hash - /// - /// 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? sourceCommit; - /// Source reference (branch/tag) /// /// Please note: This property should have been non-nullable! Since the specification file @@ -156,6 +58,15 @@ class ServerAboutResponseDto { /// String? sourceRef; + /// Source commit hash + /// + /// 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? sourceCommit; + /// Source URL /// /// Please note: This property should have been non-nullable! Since the specification file @@ -165,148 +76,67 @@ class ServerAboutResponseDto { /// String? sourceUrl; - /// Third-party bug/feature URL + /// Build identifier /// /// 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? thirdPartyBugFeatureUrl; + String? build; - /// Third-party documentation URL + /// Build URL /// /// 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? thirdPartyDocumentationUrl; + String? buildUrl; - /// Third-party source URL + /// Node.js version /// /// 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? thirdPartySourceUrl; - - /// Third-party support URL - /// - /// 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? thirdPartySupportUrl; - - /// Server version - String version; - - /// URL to version information - String versionUrl; + String? nodejs; @override bool operator ==(Object other) => identical(this, other) || other is ServerAboutResponseDto && - other.build == build && - other.buildImage == buildImage && - other.buildImageUrl == buildImageUrl && - other.buildUrl == buildUrl && - other.exiftool == exiftool && - other.ffmpeg == ffmpeg && - other.imagemagick == imagemagick && - other.libvips == libvips && - other.licensed == licensed && - other.nodejs == nodejs && + other.version == version && + other.versionUrl == versionUrl && other.repository == repository && other.repositoryUrl == repositoryUrl && - other.sourceCommit == sourceCommit && other.sourceRef == sourceRef && + other.sourceCommit == sourceCommit && other.sourceUrl == sourceUrl && - other.thirdPartyBugFeatureUrl == thirdPartyBugFeatureUrl && - other.thirdPartyDocumentationUrl == thirdPartyDocumentationUrl && - other.thirdPartySourceUrl == thirdPartySourceUrl && - other.thirdPartySupportUrl == thirdPartySupportUrl && - other.version == version && - other.versionUrl == versionUrl; + other.build == build && + other.buildUrl == buildUrl && + other.nodejs == nodejs; @override int get hashCode => // ignore: unnecessary_parenthesis - (build == null ? 0 : build!.hashCode) + - (buildImage == null ? 0 : buildImage!.hashCode) + - (buildImageUrl == null ? 0 : buildImageUrl!.hashCode) + - (buildUrl == null ? 0 : buildUrl!.hashCode) + - (exiftool == null ? 0 : exiftool!.hashCode) + - (ffmpeg == null ? 0 : ffmpeg!.hashCode) + - (imagemagick == null ? 0 : imagemagick!.hashCode) + - (libvips == null ? 0 : libvips!.hashCode) + - (licensed.hashCode) + - (nodejs == null ? 0 : nodejs!.hashCode) + + (version.hashCode) + + (versionUrl.hashCode) + (repository == null ? 0 : repository!.hashCode) + (repositoryUrl == null ? 0 : repositoryUrl!.hashCode) + - (sourceCommit == null ? 0 : sourceCommit!.hashCode) + (sourceRef == null ? 0 : sourceRef!.hashCode) + + (sourceCommit == null ? 0 : sourceCommit!.hashCode) + (sourceUrl == null ? 0 : sourceUrl!.hashCode) + - (thirdPartyBugFeatureUrl == null ? 0 : thirdPartyBugFeatureUrl!.hashCode) + - (thirdPartyDocumentationUrl == null ? 0 : thirdPartyDocumentationUrl!.hashCode) + - (thirdPartySourceUrl == null ? 0 : thirdPartySourceUrl!.hashCode) + - (thirdPartySupportUrl == null ? 0 : thirdPartySupportUrl!.hashCode) + - (version.hashCode) + - (versionUrl.hashCode); + (build == null ? 0 : build!.hashCode) + + (buildUrl == null ? 0 : buildUrl!.hashCode) + + (nodejs == null ? 0 : nodejs!.hashCode); @override - String toString() => 'ServerAboutResponseDto[build=$build, buildImage=$buildImage, buildImageUrl=$buildImageUrl, buildUrl=$buildUrl, exiftool=$exiftool, ffmpeg=$ffmpeg, imagemagick=$imagemagick, libvips=$libvips, licensed=$licensed, nodejs=$nodejs, repository=$repository, repositoryUrl=$repositoryUrl, sourceCommit=$sourceCommit, sourceRef=$sourceRef, sourceUrl=$sourceUrl, thirdPartyBugFeatureUrl=$thirdPartyBugFeatureUrl, thirdPartyDocumentationUrl=$thirdPartyDocumentationUrl, thirdPartySourceUrl=$thirdPartySourceUrl, thirdPartySupportUrl=$thirdPartySupportUrl, version=$version, versionUrl=$versionUrl]'; + String toString() => 'ServerAboutResponseDto[version=$version, versionUrl=$versionUrl, repository=$repository, repositoryUrl=$repositoryUrl, sourceRef=$sourceRef, sourceCommit=$sourceCommit, sourceUrl=$sourceUrl, build=$build, buildUrl=$buildUrl, nodejs=$nodejs]'; Map toJson() { final json = {}; - if (this.build != null) { - json[r'build'] = this.build; - } else { - // json[r'build'] = null; - } - if (this.buildImage != null) { - json[r'buildImage'] = this.buildImage; - } else { - // json[r'buildImage'] = null; - } - if (this.buildImageUrl != null) { - json[r'buildImageUrl'] = this.buildImageUrl; - } else { - // json[r'buildImageUrl'] = null; - } - if (this.buildUrl != null) { - json[r'buildUrl'] = this.buildUrl; - } else { - // json[r'buildUrl'] = null; - } - if (this.exiftool != null) { - json[r'exiftool'] = this.exiftool; - } else { - // json[r'exiftool'] = null; - } - if (this.ffmpeg != null) { - json[r'ffmpeg'] = this.ffmpeg; - } else { - // json[r'ffmpeg'] = null; - } - if (this.imagemagick != null) { - json[r'imagemagick'] = this.imagemagick; - } else { - // json[r'imagemagick'] = null; - } - if (this.libvips != null) { - json[r'libvips'] = this.libvips; - } else { - // json[r'libvips'] = null; - } - json[r'licensed'] = this.licensed; - if (this.nodejs != null) { - json[r'nodejs'] = this.nodejs; - } else { - // json[r'nodejs'] = null; - } + json[r'version'] = this.version; + json[r'versionUrl'] = this.versionUrl; if (this.repository != null) { json[r'repository'] = this.repository; } else { @@ -317,43 +147,36 @@ class ServerAboutResponseDto { } else { // json[r'repositoryUrl'] = null; } - if (this.sourceCommit != null) { - json[r'sourceCommit'] = this.sourceCommit; - } else { - // json[r'sourceCommit'] = null; - } if (this.sourceRef != null) { json[r'sourceRef'] = this.sourceRef; } else { // json[r'sourceRef'] = null; } + if (this.sourceCommit != null) { + json[r'sourceCommit'] = this.sourceCommit; + } else { + // json[r'sourceCommit'] = null; + } if (this.sourceUrl != null) { json[r'sourceUrl'] = this.sourceUrl; } else { // json[r'sourceUrl'] = null; } - if (this.thirdPartyBugFeatureUrl != null) { - json[r'thirdPartyBugFeatureUrl'] = this.thirdPartyBugFeatureUrl; + if (this.build != null) { + json[r'build'] = this.build; } else { - // json[r'thirdPartyBugFeatureUrl'] = null; + // json[r'build'] = null; } - if (this.thirdPartyDocumentationUrl != null) { - json[r'thirdPartyDocumentationUrl'] = this.thirdPartyDocumentationUrl; + if (this.buildUrl != null) { + json[r'buildUrl'] = this.buildUrl; } else { - // json[r'thirdPartyDocumentationUrl'] = null; + // json[r'buildUrl'] = null; } - if (this.thirdPartySourceUrl != null) { - json[r'thirdPartySourceUrl'] = this.thirdPartySourceUrl; + if (this.nodejs != null) { + json[r'nodejs'] = this.nodejs; } else { - // json[r'thirdPartySourceUrl'] = null; + // json[r'nodejs'] = null; } - if (this.thirdPartySupportUrl != null) { - json[r'thirdPartySupportUrl'] = this.thirdPartySupportUrl; - } else { - // json[r'thirdPartySupportUrl'] = null; - } - json[r'version'] = this.version; - json[r'versionUrl'] = this.versionUrl; return json; } @@ -366,27 +189,16 @@ class ServerAboutResponseDto { final json = value.cast(); return ServerAboutResponseDto( - build: mapValueOfType(json, r'build'), - buildImage: mapValueOfType(json, r'buildImage'), - buildImageUrl: mapValueOfType(json, r'buildImageUrl'), - buildUrl: mapValueOfType(json, r'buildUrl'), - exiftool: mapValueOfType(json, r'exiftool'), - ffmpeg: mapValueOfType(json, r'ffmpeg'), - imagemagick: mapValueOfType(json, r'imagemagick'), - libvips: mapValueOfType(json, r'libvips'), - licensed: mapValueOfType(json, r'licensed')!, - nodejs: mapValueOfType(json, r'nodejs'), - repository: mapValueOfType(json, r'repository'), - repositoryUrl: mapValueOfType(json, r'repositoryUrl'), - sourceCommit: mapValueOfType(json, r'sourceCommit'), - sourceRef: mapValueOfType(json, r'sourceRef'), - sourceUrl: mapValueOfType(json, r'sourceUrl'), - thirdPartyBugFeatureUrl: mapValueOfType(json, r'thirdPartyBugFeatureUrl'), - thirdPartyDocumentationUrl: mapValueOfType(json, r'thirdPartyDocumentationUrl'), - thirdPartySourceUrl: mapValueOfType(json, r'thirdPartySourceUrl'), - thirdPartySupportUrl: mapValueOfType(json, r'thirdPartySupportUrl'), version: mapValueOfType(json, r'version')!, versionUrl: mapValueOfType(json, r'versionUrl')!, + repository: mapValueOfType(json, r'repository'), + repositoryUrl: mapValueOfType(json, r'repositoryUrl'), + sourceRef: mapValueOfType(json, r'sourceRef'), + sourceCommit: mapValueOfType(json, r'sourceCommit'), + sourceUrl: mapValueOfType(json, r'sourceUrl'), + build: mapValueOfType(json, r'build'), + buildUrl: mapValueOfType(json, r'buildUrl'), + nodejs: mapValueOfType(json, r'nodejs'), ); } return null; @@ -434,7 +246,6 @@ class ServerAboutResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'licensed', 'version', 'versionUrl', }; diff --git a/mobile/openapi/lib/model/server_apk_links_dto.dart b/mobile/openapi/lib/model/server_apk_links_dto.dart deleted file mode 100644 index 2227018468..0000000000 --- a/mobile/openapi/lib/model/server_apk_links_dto.dart +++ /dev/null @@ -1,127 +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 ServerApkLinksDto { - /// Returns a new [ServerApkLinksDto] instance. - ServerApkLinksDto({ - required this.arm64v8a, - required this.armeabiv7a, - required this.universal, - required this.x8664, - }); - - /// APK download link for ARM64 v8a architecture - String arm64v8a; - - /// APK download link for ARM EABI v7a architecture - String armeabiv7a; - - /// APK download link for universal architecture - String universal; - - /// APK download link for x86_64 architecture - String x8664; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerApkLinksDto && - other.arm64v8a == arm64v8a && - other.armeabiv7a == armeabiv7a && - other.universal == universal && - other.x8664 == x8664; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (arm64v8a.hashCode) + - (armeabiv7a.hashCode) + - (universal.hashCode) + - (x8664.hashCode); - - @override - String toString() => 'ServerApkLinksDto[arm64v8a=$arm64v8a, armeabiv7a=$armeabiv7a, universal=$universal, x8664=$x8664]'; - - Map toJson() { - final json = {}; - json[r'arm64v8a'] = this.arm64v8a; - json[r'armeabiv7a'] = this.armeabiv7a; - json[r'universal'] = this.universal; - json[r'x86_64'] = this.x8664; - return json; - } - - /// Returns a new [ServerApkLinksDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerApkLinksDto? fromJson(dynamic value) { - upgradeDto(value, "ServerApkLinksDto"); - if (value is Map) { - final json = value.cast(); - - return ServerApkLinksDto( - arm64v8a: mapValueOfType(json, r'arm64v8a')!, - armeabiv7a: mapValueOfType(json, r'armeabiv7a')!, - universal: mapValueOfType(json, r'universal')!, - x8664: mapValueOfType(json, r'x86_64')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerApkLinksDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerApkLinksDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerApkLinksDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerApkLinksDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'arm64v8a', - 'armeabiv7a', - 'universal', - 'x86_64', - }; -} - diff --git a/mobile/openapi/lib/model/server_config_dto.dart b/mobile/openapi/lib/model/server_config_dto.dart index fec096d51a..b412ae2513 100644 --- a/mobile/openapi/lib/model/server_config_dto.dart +++ b/mobile/openapi/lib/model/server_config_dto.dart @@ -13,97 +13,41 @@ part of openapi.api; class ServerConfigDto { /// Returns a new [ServerConfigDto] instance. ServerConfigDto({ - required this.externalDomain, - required this.isInitialized, - required this.isOnboarded, required this.loginPageMessage, - required this.maintenanceMode, - required this.mapDarkStyleUrl, - required this.mapLightStyleUrl, - required this.oauthButtonText, - required this.publicUsers, - required this.trashDays, required this.userDeleteDelay, + required this.isInitialized, }); - /// External domain URL - String externalDomain; - - /// Whether the server has been initialized - bool isInitialized; - - /// Whether the admin has completed onboarding - bool isOnboarded; - /// Login page message String loginPageMessage; - /// Whether maintenance mode is active - bool maintenanceMode; - - /// Map dark style URL - String mapDarkStyleUrl; - - /// Map light style URL - String mapLightStyleUrl; - - /// OAuth button text - String oauthButtonText; - - /// Whether public user registration is enabled - bool publicUsers; - - /// Number of days before trashed assets are permanently deleted - int trashDays; - /// Delay in days before deleted users are permanently removed int userDeleteDelay; + /// Whether the server has been initialized + bool isInitialized; + @override bool operator ==(Object other) => identical(this, other) || other is ServerConfigDto && - other.externalDomain == externalDomain && - other.isInitialized == isInitialized && - other.isOnboarded == isOnboarded && other.loginPageMessage == loginPageMessage && - other.maintenanceMode == maintenanceMode && - other.mapDarkStyleUrl == mapDarkStyleUrl && - other.mapLightStyleUrl == mapLightStyleUrl && - other.oauthButtonText == oauthButtonText && - other.publicUsers == publicUsers && - other.trashDays == trashDays && - other.userDeleteDelay == userDeleteDelay; + other.userDeleteDelay == userDeleteDelay && + other.isInitialized == isInitialized; @override int get hashCode => // ignore: unnecessary_parenthesis - (externalDomain.hashCode) + - (isInitialized.hashCode) + - (isOnboarded.hashCode) + (loginPageMessage.hashCode) + - (maintenanceMode.hashCode) + - (mapDarkStyleUrl.hashCode) + - (mapLightStyleUrl.hashCode) + - (oauthButtonText.hashCode) + - (publicUsers.hashCode) + - (trashDays.hashCode) + - (userDeleteDelay.hashCode); + (userDeleteDelay.hashCode) + + (isInitialized.hashCode); @override - String toString() => 'ServerConfigDto[externalDomain=$externalDomain, isInitialized=$isInitialized, isOnboarded=$isOnboarded, loginPageMessage=$loginPageMessage, maintenanceMode=$maintenanceMode, mapDarkStyleUrl=$mapDarkStyleUrl, mapLightStyleUrl=$mapLightStyleUrl, oauthButtonText=$oauthButtonText, publicUsers=$publicUsers, trashDays=$trashDays, userDeleteDelay=$userDeleteDelay]'; + String toString() => 'ServerConfigDto[loginPageMessage=$loginPageMessage, userDeleteDelay=$userDeleteDelay, isInitialized=$isInitialized]'; Map toJson() { final json = {}; - json[r'externalDomain'] = this.externalDomain; - json[r'isInitialized'] = this.isInitialized; - json[r'isOnboarded'] = this.isOnboarded; json[r'loginPageMessage'] = this.loginPageMessage; - json[r'maintenanceMode'] = this.maintenanceMode; - json[r'mapDarkStyleUrl'] = this.mapDarkStyleUrl; - json[r'mapLightStyleUrl'] = this.mapLightStyleUrl; - json[r'oauthButtonText'] = this.oauthButtonText; - json[r'publicUsers'] = this.publicUsers; - json[r'trashDays'] = this.trashDays; json[r'userDeleteDelay'] = this.userDeleteDelay; + json[r'isInitialized'] = this.isInitialized; return json; } @@ -116,17 +60,9 @@ class ServerConfigDto { final json = value.cast(); return ServerConfigDto( - externalDomain: mapValueOfType(json, r'externalDomain')!, - isInitialized: mapValueOfType(json, r'isInitialized')!, - isOnboarded: mapValueOfType(json, r'isOnboarded')!, loginPageMessage: mapValueOfType(json, r'loginPageMessage')!, - maintenanceMode: mapValueOfType(json, r'maintenanceMode')!, - mapDarkStyleUrl: mapValueOfType(json, r'mapDarkStyleUrl')!, - mapLightStyleUrl: mapValueOfType(json, r'mapLightStyleUrl')!, - oauthButtonText: mapValueOfType(json, r'oauthButtonText')!, - publicUsers: mapValueOfType(json, r'publicUsers')!, - trashDays: mapValueOfType(json, r'trashDays')!, userDeleteDelay: mapValueOfType(json, r'userDeleteDelay')!, + isInitialized: mapValueOfType(json, r'isInitialized')!, ); } return null; @@ -174,17 +110,9 @@ class ServerConfigDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'externalDomain', - 'isInitialized', - 'isOnboarded', 'loginPageMessage', - 'maintenanceMode', - 'mapDarkStyleUrl', - 'mapLightStyleUrl', - 'oauthButtonText', - 'publicUsers', - 'trashDays', 'userDeleteDelay', + 'isInitialized', }; } diff --git a/mobile/openapi/lib/model/server_features_dto.dart b/mobile/openapi/lib/model/server_features_dto.dart index 79494b74eb..83d4f49a7f 100644 --- a/mobile/openapi/lib/model/server_features_dto.dart +++ b/mobile/openapi/lib/model/server_features_dto.dart @@ -13,125 +13,27 @@ part of openapi.api; class ServerFeaturesDto { /// Returns a new [ServerFeaturesDto] instance. ServerFeaturesDto({ - required this.configFile, - required this.duplicateDetection, - required this.email, - required this.facialRecognition, - required this.importFaces, - required this.map, - required this.oauth, - required this.oauthAutoLaunch, - required this.ocr, required this.passwordLogin, - required this.reverseGeocoding, - required this.search, - required this.sidecar, - required this.smartSearch, - required this.trash, }); - /// Whether config file is available - bool configFile; - - /// Whether duplicate detection is enabled - bool duplicateDetection; - - /// Whether email notifications are enabled - bool email; - - /// Whether facial recognition is enabled - bool facialRecognition; - - /// Whether face import is enabled - bool importFaces; - - /// Whether map feature is enabled - bool map; - - /// Whether OAuth is enabled - bool oauth; - - /// Whether OAuth auto-launch is enabled - bool oauthAutoLaunch; - - /// Whether OCR is enabled - bool ocr; - /// Whether password login is enabled bool passwordLogin; - /// Whether reverse geocoding is enabled - bool reverseGeocoding; - - /// Whether search is enabled - bool search; - - /// Whether sidecar files are supported - bool sidecar; - - /// Whether smart search is enabled - bool smartSearch; - - /// Whether trash feature is enabled - bool trash; - @override bool operator ==(Object other) => identical(this, other) || other is ServerFeaturesDto && - other.configFile == configFile && - other.duplicateDetection == duplicateDetection && - other.email == email && - other.facialRecognition == facialRecognition && - other.importFaces == importFaces && - other.map == map && - other.oauth == oauth && - other.oauthAutoLaunch == oauthAutoLaunch && - other.ocr == ocr && - other.passwordLogin == passwordLogin && - other.reverseGeocoding == reverseGeocoding && - other.search == search && - other.sidecar == sidecar && - other.smartSearch == smartSearch && - other.trash == trash; + other.passwordLogin == passwordLogin; @override int get hashCode => // ignore: unnecessary_parenthesis - (configFile.hashCode) + - (duplicateDetection.hashCode) + - (email.hashCode) + - (facialRecognition.hashCode) + - (importFaces.hashCode) + - (map.hashCode) + - (oauth.hashCode) + - (oauthAutoLaunch.hashCode) + - (ocr.hashCode) + - (passwordLogin.hashCode) + - (reverseGeocoding.hashCode) + - (search.hashCode) + - (sidecar.hashCode) + - (smartSearch.hashCode) + - (trash.hashCode); + (passwordLogin.hashCode); @override - String toString() => 'ServerFeaturesDto[configFile=$configFile, duplicateDetection=$duplicateDetection, email=$email, facialRecognition=$facialRecognition, importFaces=$importFaces, map=$map, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, ocr=$ocr, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, trash=$trash]'; + String toString() => 'ServerFeaturesDto[passwordLogin=$passwordLogin]'; Map toJson() { final json = {}; - json[r'configFile'] = this.configFile; - json[r'duplicateDetection'] = this.duplicateDetection; - json[r'email'] = this.email; - json[r'facialRecognition'] = this.facialRecognition; - json[r'importFaces'] = this.importFaces; - json[r'map'] = this.map; - json[r'oauth'] = this.oauth; - json[r'oauthAutoLaunch'] = this.oauthAutoLaunch; - json[r'ocr'] = this.ocr; json[r'passwordLogin'] = this.passwordLogin; - json[r'reverseGeocoding'] = this.reverseGeocoding; - json[r'search'] = this.search; - json[r'sidecar'] = this.sidecar; - json[r'smartSearch'] = this.smartSearch; - json[r'trash'] = this.trash; return json; } @@ -144,21 +46,7 @@ class ServerFeaturesDto { final json = value.cast(); return ServerFeaturesDto( - configFile: mapValueOfType(json, r'configFile')!, - duplicateDetection: mapValueOfType(json, r'duplicateDetection')!, - email: mapValueOfType(json, r'email')!, - facialRecognition: mapValueOfType(json, r'facialRecognition')!, - importFaces: mapValueOfType(json, r'importFaces')!, - map: mapValueOfType(json, r'map')!, - oauth: mapValueOfType(json, r'oauth')!, - oauthAutoLaunch: mapValueOfType(json, r'oauthAutoLaunch')!, - ocr: mapValueOfType(json, r'ocr')!, passwordLogin: mapValueOfType(json, r'passwordLogin')!, - reverseGeocoding: mapValueOfType(json, r'reverseGeocoding')!, - search: mapValueOfType(json, r'search')!, - sidecar: mapValueOfType(json, r'sidecar')!, - smartSearch: mapValueOfType(json, r'smartSearch')!, - trash: mapValueOfType(json, r'trash')!, ); } return null; @@ -206,21 +94,7 @@ class ServerFeaturesDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'configFile', - 'duplicateDetection', - 'email', - 'facialRecognition', - 'importFaces', - 'map', - 'oauth', - 'oauthAutoLaunch', - 'ocr', 'passwordLogin', - 'reverseGeocoding', - 'search', - 'sidecar', - 'smartSearch', - 'trash', }; } diff --git a/mobile/openapi/lib/model/server_media_types_response_dto.dart b/mobile/openapi/lib/model/server_media_types_response_dto.dart deleted file mode 100644 index 6a2aaeb9e1..0000000000 --- a/mobile/openapi/lib/model/server_media_types_response_dto.dart +++ /dev/null @@ -1,124 +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 ServerMediaTypesResponseDto { - /// Returns a new [ServerMediaTypesResponseDto] instance. - ServerMediaTypesResponseDto({ - this.image = const [], - this.sidecar = const [], - this.video = const [], - }); - - /// Supported image MIME types - List image; - - /// Supported sidecar MIME types - List sidecar; - - /// Supported video MIME types - List video; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerMediaTypesResponseDto && - _deepEquality.equals(other.image, image) && - _deepEquality.equals(other.sidecar, sidecar) && - _deepEquality.equals(other.video, video); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (image.hashCode) + - (sidecar.hashCode) + - (video.hashCode); - - @override - String toString() => 'ServerMediaTypesResponseDto[image=$image, sidecar=$sidecar, video=$video]'; - - Map toJson() { - final json = {}; - json[r'image'] = this.image; - json[r'sidecar'] = this.sidecar; - json[r'video'] = this.video; - return json; - } - - /// Returns a new [ServerMediaTypesResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerMediaTypesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerMediaTypesResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ServerMediaTypesResponseDto( - image: json[r'image'] is Iterable - ? (json[r'image'] as Iterable).cast().toList(growable: false) - : const [], - sidecar: json[r'sidecar'] is Iterable - ? (json[r'sidecar'] as Iterable).cast().toList(growable: false) - : const [], - video: json[r'video'] is Iterable - ? (json[r'video'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerMediaTypesResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerMediaTypesResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerMediaTypesResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerMediaTypesResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'image', - 'sidecar', - 'video', - }; -} - diff --git a/mobile/openapi/lib/model/server_stats_response_dto.dart b/mobile/openapi/lib/model/server_stats_response_dto.dart deleted file mode 100644 index ef2fa458e2..0000000000 --- a/mobile/openapi/lib/model/server_stats_response_dto.dart +++ /dev/null @@ -1,144 +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 ServerStatsResponseDto { - /// Returns a new [ServerStatsResponseDto] instance. - ServerStatsResponseDto({ - this.photos = 0, - this.usage = 0, - this.usageByUser = const [], - this.usagePhotos = 0, - this.usageVideos = 0, - this.videos = 0, - }); - - /// Total number of photos - int photos; - - /// Total storage usage in bytes - int usage; - - List usageByUser; - - /// Storage usage for photos in bytes - int usagePhotos; - - /// Storage usage for videos in bytes - int usageVideos; - - /// Total number of videos - int videos; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerStatsResponseDto && - other.photos == photos && - other.usage == usage && - _deepEquality.equals(other.usageByUser, usageByUser) && - other.usagePhotos == usagePhotos && - other.usageVideos == usageVideos && - other.videos == videos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (photos.hashCode) + - (usage.hashCode) + - (usageByUser.hashCode) + - (usagePhotos.hashCode) + - (usageVideos.hashCode) + - (videos.hashCode); - - @override - String toString() => 'ServerStatsResponseDto[photos=$photos, usage=$usage, usageByUser=$usageByUser, usagePhotos=$usagePhotos, usageVideos=$usageVideos, videos=$videos]'; - - Map toJson() { - final json = {}; - json[r'photos'] = this.photos; - json[r'usage'] = this.usage; - json[r'usageByUser'] = this.usageByUser; - json[r'usagePhotos'] = this.usagePhotos; - json[r'usageVideos'] = this.usageVideos; - json[r'videos'] = this.videos; - return json; - } - - /// Returns a new [ServerStatsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerStatsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerStatsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ServerStatsResponseDto( - photos: mapValueOfType(json, r'photos')!, - usage: mapValueOfType(json, r'usage')!, - usageByUser: UsageByUserDto.listFromJson(json[r'usageByUser']), - usagePhotos: mapValueOfType(json, r'usagePhotos')!, - usageVideos: mapValueOfType(json, r'usageVideos')!, - videos: mapValueOfType(json, r'videos')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerStatsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerStatsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerStatsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerStatsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'photos', - 'usage', - 'usageByUser', - 'usagePhotos', - 'usageVideos', - 'videos', - }; -} - diff --git a/mobile/openapi/lib/model/server_storage_response_dto.dart b/mobile/openapi/lib/model/server_storage_response_dto.dart deleted file mode 100644 index 476b048b4d..0000000000 --- a/mobile/openapi/lib/model/server_storage_response_dto.dart +++ /dev/null @@ -1,154 +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 ServerStorageResponseDto { - /// Returns a new [ServerStorageResponseDto] instance. - ServerStorageResponseDto({ - required this.diskAvailable, - required this.diskAvailableRaw, - required this.diskSize, - required this.diskSizeRaw, - required this.diskUsagePercentage, - required this.diskUse, - required this.diskUseRaw, - }); - - /// Available disk space (human-readable format) - String diskAvailable; - - /// Available disk space in bytes - int diskAvailableRaw; - - /// Total disk size (human-readable format) - String diskSize; - - /// Total disk size in bytes - int diskSizeRaw; - - /// Disk usage percentage (0-100) - double diskUsagePercentage; - - /// Used disk space (human-readable format) - String diskUse; - - /// Used disk space in bytes - int diskUseRaw; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerStorageResponseDto && - other.diskAvailable == diskAvailable && - other.diskAvailableRaw == diskAvailableRaw && - other.diskSize == diskSize && - other.diskSizeRaw == diskSizeRaw && - other.diskUsagePercentage == diskUsagePercentage && - other.diskUse == diskUse && - other.diskUseRaw == diskUseRaw; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (diskAvailable.hashCode) + - (diskAvailableRaw.hashCode) + - (diskSize.hashCode) + - (diskSizeRaw.hashCode) + - (diskUsagePercentage.hashCode) + - (diskUse.hashCode) + - (diskUseRaw.hashCode); - - @override - String toString() => 'ServerStorageResponseDto[diskAvailable=$diskAvailable, diskAvailableRaw=$diskAvailableRaw, diskSize=$diskSize, diskSizeRaw=$diskSizeRaw, diskUsagePercentage=$diskUsagePercentage, diskUse=$diskUse, diskUseRaw=$diskUseRaw]'; - - Map toJson() { - final json = {}; - json[r'diskAvailable'] = this.diskAvailable; - json[r'diskAvailableRaw'] = this.diskAvailableRaw; - json[r'diskSize'] = this.diskSize; - json[r'diskSizeRaw'] = this.diskSizeRaw; - json[r'diskUsagePercentage'] = this.diskUsagePercentage; - json[r'diskUse'] = this.diskUse; - json[r'diskUseRaw'] = this.diskUseRaw; - return json; - } - - /// Returns a new [ServerStorageResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerStorageResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerStorageResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ServerStorageResponseDto( - diskAvailable: mapValueOfType(json, r'diskAvailable')!, - diskAvailableRaw: mapValueOfType(json, r'diskAvailableRaw')!, - diskSize: mapValueOfType(json, r'diskSize')!, - diskSizeRaw: mapValueOfType(json, r'diskSizeRaw')!, - diskUsagePercentage: (mapValueOfType(json, r'diskUsagePercentage')!).toDouble(), - diskUse: mapValueOfType(json, r'diskUse')!, - diskUseRaw: mapValueOfType(json, r'diskUseRaw')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerStorageResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerStorageResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerStorageResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerStorageResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'diskAvailable', - 'diskAvailableRaw', - 'diskSize', - 'diskSizeRaw', - 'diskUsagePercentage', - 'diskUse', - 'diskUseRaw', - }; -} - diff --git a/mobile/openapi/lib/model/server_theme_dto.dart b/mobile/openapi/lib/model/server_theme_dto.dart deleted file mode 100644 index 957cf84d55..0000000000 --- a/mobile/openapi/lib/model/server_theme_dto.dart +++ /dev/null @@ -1,100 +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 ServerThemeDto { - /// Returns a new [ServerThemeDto] instance. - ServerThemeDto({ - required this.customCss, - }); - - /// Custom CSS for theming - String customCss; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerThemeDto && - other.customCss == customCss; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (customCss.hashCode); - - @override - String toString() => 'ServerThemeDto[customCss=$customCss]'; - - Map toJson() { - final json = {}; - json[r'customCss'] = this.customCss; - return json; - } - - /// Returns a new [ServerThemeDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerThemeDto? fromJson(dynamic value) { - upgradeDto(value, "ServerThemeDto"); - if (value is Map) { - final json = value.cast(); - - return ServerThemeDto( - customCss: mapValueOfType(json, r'customCss')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerThemeDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerThemeDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerThemeDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerThemeDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'customCss', - }; -} - diff --git a/mobile/openapi/lib/model/server_version_history_response_dto.dart b/mobile/openapi/lib/model/server_version_history_response_dto.dart deleted file mode 100644 index c3b7049016..0000000000 --- a/mobile/openapi/lib/model/server_version_history_response_dto.dart +++ /dev/null @@ -1,118 +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 ServerVersionHistoryResponseDto { - /// Returns a new [ServerVersionHistoryResponseDto] instance. - ServerVersionHistoryResponseDto({ - required this.createdAt, - required this.id, - required this.version, - }); - - /// When this version was first seen - DateTime createdAt; - - /// Version history entry ID - String id; - - /// Version string - String version; - - @override - bool operator ==(Object other) => identical(this, other) || other is ServerVersionHistoryResponseDto && - other.createdAt == createdAt && - other.id == id && - other.version == version; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (createdAt.hashCode) + - (id.hashCode) + - (version.hashCode); - - @override - String toString() => 'ServerVersionHistoryResponseDto[createdAt=$createdAt, id=$id, version=$version]'; - - Map toJson() { - final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'id'] = this.id; - json[r'version'] = this.version; - return json; - } - - /// Returns a new [ServerVersionHistoryResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ServerVersionHistoryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ServerVersionHistoryResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ServerVersionHistoryResponseDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, - id: mapValueOfType(json, r'id')!, - version: mapValueOfType(json, r'version')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ServerVersionHistoryResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ServerVersionHistoryResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ServerVersionHistoryResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ServerVersionHistoryResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'id', - 'version', - }; -} - diff --git a/mobile/openapi/lib/model/session_create_dto.dart b/mobile/openapi/lib/model/session_create_dto.dart index 3874bc3303..542814c686 100644 --- a/mobile/openapi/lib/model/session_create_dto.dart +++ b/mobile/openapi/lib/model/session_create_dto.dart @@ -13,29 +13,11 @@ part of openapi.api; class SessionCreateDto { /// Returns a new [SessionCreateDto] instance. SessionCreateDto({ - this.deviceOS, - this.deviceType, this.duration, + this.deviceType, + this.deviceOS, }); - /// Device OS - /// - /// 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? deviceOS; - - /// Device type - /// - /// 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? deviceType; - /// Session duration in seconds /// /// Minimum value: 1 @@ -47,38 +29,56 @@ class SessionCreateDto { /// num? duration; + /// Device type + /// + /// 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? deviceType; + + /// Device OS + /// + /// 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? deviceOS; + @override bool operator ==(Object other) => identical(this, other) || other is SessionCreateDto && - other.deviceOS == deviceOS && + other.duration == duration && other.deviceType == deviceType && - other.duration == duration; + other.deviceOS == deviceOS; @override int get hashCode => // ignore: unnecessary_parenthesis - (deviceOS == null ? 0 : deviceOS!.hashCode) + + (duration == null ? 0 : duration!.hashCode) + (deviceType == null ? 0 : deviceType!.hashCode) + - (duration == null ? 0 : duration!.hashCode); + (deviceOS == null ? 0 : deviceOS!.hashCode); @override - String toString() => 'SessionCreateDto[deviceOS=$deviceOS, deviceType=$deviceType, duration=$duration]'; + String toString() => 'SessionCreateDto[duration=$duration, deviceType=$deviceType, deviceOS=$deviceOS]'; Map toJson() { final json = {}; - if (this.deviceOS != null) { - json[r'deviceOS'] = this.deviceOS; + if (this.duration != null) { + json[r'duration'] = this.duration; } else { - // json[r'deviceOS'] = null; + // json[r'duration'] = null; } if (this.deviceType != null) { json[r'deviceType'] = this.deviceType; } else { // json[r'deviceType'] = null; } - if (this.duration != null) { - json[r'duration'] = this.duration; + if (this.deviceOS != null) { + json[r'deviceOS'] = this.deviceOS; } else { - // json[r'duration'] = null; + // json[r'deviceOS'] = null; } return json; } @@ -92,9 +92,9 @@ class SessionCreateDto { final json = value.cast(); return SessionCreateDto( - deviceOS: mapValueOfType(json, r'deviceOS'), - deviceType: mapValueOfType(json, r'deviceType'), duration: num.parse('${json[r'duration']}'), + deviceType: mapValueOfType(json, r'deviceType'), + deviceOS: mapValueOfType(json, r'deviceOS'), ); } return null; diff --git a/mobile/openapi/lib/model/session_create_response_dto.dart b/mobile/openapi/lib/model/session_create_response_dto.dart index f35232b0e8..6c1e21275b 100644 --- a/mobile/openapi/lib/model/session_create_response_dto.dart +++ b/mobile/openapi/lib/model/session_create_response_dto.dart @@ -13,32 +13,26 @@ part of openapi.api; class SessionCreateResponseDto { /// Returns a new [SessionCreateResponseDto] instance. SessionCreateResponseDto({ - required this.appVersion, - required this.createdAt, - required this.current, - required this.deviceOS, - required this.deviceType, - this.expiresAt, required this.id, + required this.createdAt, + required this.updatedAt, + this.expiresAt, + required this.current, + required this.deviceType, + required this.deviceOS, + required this.appVersion, required this.isPendingSyncReset, required this.token, - required this.updatedAt, }); - /// App version - String? appVersion; + /// Session ID + String id; /// Creation date String createdAt; - /// Is current session - bool current; - - /// Device OS - String deviceOS; - - /// Device type - String deviceType; + /// Last update date + String updatedAt; /// Expiration date /// @@ -49,8 +43,17 @@ class SessionCreateResponseDto { /// String? expiresAt; - /// Session ID - String id; + /// Is current session + bool current; + + /// Device type + String deviceType; + + /// Device OS + String deviceOS; + + /// App version + String? appVersion; /// Is pending sync reset bool isPendingSyncReset; @@ -58,59 +61,56 @@ class SessionCreateResponseDto { /// Session token String token; - /// Last update date - String updatedAt; - @override bool operator ==(Object other) => identical(this, other) || other is SessionCreateResponseDto && - other.appVersion == appVersion && - other.createdAt == createdAt && - other.current == current && - other.deviceOS == deviceOS && - other.deviceType == deviceType && - other.expiresAt == expiresAt && other.id == id && + other.createdAt == createdAt && + other.updatedAt == updatedAt && + other.expiresAt == expiresAt && + other.current == current && + other.deviceType == deviceType && + other.deviceOS == deviceOS && + other.appVersion == appVersion && other.isPendingSyncReset == isPendingSyncReset && - other.token == token && - other.updatedAt == updatedAt; + other.token == token; @override int get hashCode => // ignore: unnecessary_parenthesis - (appVersion == null ? 0 : appVersion!.hashCode) + - (createdAt.hashCode) + - (current.hashCode) + - (deviceOS.hashCode) + - (deviceType.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + (id.hashCode) + + (createdAt.hashCode) + + (updatedAt.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + + (current.hashCode) + + (deviceType.hashCode) + + (deviceOS.hashCode) + + (appVersion == null ? 0 : appVersion!.hashCode) + (isPendingSyncReset.hashCode) + - (token.hashCode) + - (updatedAt.hashCode); + (token.hashCode); @override - String toString() => 'SessionCreateResponseDto[appVersion=$appVersion, createdAt=$createdAt, current=$current, deviceOS=$deviceOS, deviceType=$deviceType, expiresAt=$expiresAt, id=$id, isPendingSyncReset=$isPendingSyncReset, token=$token, updatedAt=$updatedAt]'; + String toString() => 'SessionCreateResponseDto[id=$id, createdAt=$createdAt, updatedAt=$updatedAt, expiresAt=$expiresAt, current=$current, deviceType=$deviceType, deviceOS=$deviceOS, appVersion=$appVersion, isPendingSyncReset=$isPendingSyncReset, token=$token]'; Map toJson() { final json = {}; - if (this.appVersion != null) { - json[r'appVersion'] = this.appVersion; - } else { - // json[r'appVersion'] = null; - } + json[r'id'] = this.id; json[r'createdAt'] = this.createdAt; - json[r'current'] = this.current; - json[r'deviceOS'] = this.deviceOS; - json[r'deviceType'] = this.deviceType; + json[r'updatedAt'] = this.updatedAt; if (this.expiresAt != null) { json[r'expiresAt'] = this.expiresAt; } else { // json[r'expiresAt'] = null; } - json[r'id'] = this.id; + json[r'current'] = this.current; + json[r'deviceType'] = this.deviceType; + json[r'deviceOS'] = this.deviceOS; + if (this.appVersion != null) { + json[r'appVersion'] = this.appVersion; + } else { + // json[r'appVersion'] = null; + } json[r'isPendingSyncReset'] = this.isPendingSyncReset; json[r'token'] = this.token; - json[r'updatedAt'] = this.updatedAt; return json; } @@ -123,16 +123,16 @@ class SessionCreateResponseDto { final json = value.cast(); return SessionCreateResponseDto( - appVersion: mapValueOfType(json, r'appVersion'), - createdAt: mapValueOfType(json, r'createdAt')!, - current: mapValueOfType(json, r'current')!, - deviceOS: mapValueOfType(json, r'deviceOS')!, - deviceType: mapValueOfType(json, r'deviceType')!, - expiresAt: mapValueOfType(json, r'expiresAt'), id: mapValueOfType(json, r'id')!, + createdAt: mapValueOfType(json, r'createdAt')!, + updatedAt: mapValueOfType(json, r'updatedAt')!, + expiresAt: mapValueOfType(json, r'expiresAt'), + current: mapValueOfType(json, r'current')!, + deviceType: mapValueOfType(json, r'deviceType')!, + deviceOS: mapValueOfType(json, r'deviceOS')!, + appVersion: mapValueOfType(json, r'appVersion'), isPendingSyncReset: mapValueOfType(json, r'isPendingSyncReset')!, token: mapValueOfType(json, r'token')!, - updatedAt: mapValueOfType(json, r'updatedAt')!, ); } return null; @@ -180,15 +180,15 @@ class SessionCreateResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'appVersion', - 'createdAt', - 'current', - 'deviceOS', - 'deviceType', 'id', + 'createdAt', + 'updatedAt', + 'current', + 'deviceType', + 'deviceOS', + 'appVersion', 'isPendingSyncReset', 'token', - 'updatedAt', }; } diff --git a/mobile/openapi/lib/model/session_response_dto.dart b/mobile/openapi/lib/model/session_response_dto.dart index ed84160827..7a706be2d0 100644 --- a/mobile/openapi/lib/model/session_response_dto.dart +++ b/mobile/openapi/lib/model/session_response_dto.dart @@ -13,31 +13,25 @@ part of openapi.api; class SessionResponseDto { /// Returns a new [SessionResponseDto] instance. SessionResponseDto({ - required this.appVersion, - required this.createdAt, - required this.current, - required this.deviceOS, - required this.deviceType, - this.expiresAt, required this.id, - required this.isPendingSyncReset, + required this.createdAt, required this.updatedAt, + this.expiresAt, + required this.current, + required this.deviceType, + required this.deviceOS, + required this.appVersion, + required this.isPendingSyncReset, }); - /// App version - String? appVersion; + /// Session ID + String id; /// Creation date String createdAt; - /// Is current session - bool current; - - /// Device OS - String deviceOS; - - /// Device type - String deviceType; + /// Last update date + String updatedAt; /// Expiration date /// @@ -48,62 +42,68 @@ class SessionResponseDto { /// String? expiresAt; - /// Session ID - String id; + /// Is current session + bool current; + + /// Device type + String deviceType; + + /// Device OS + String deviceOS; + + /// App version + String? appVersion; /// Is pending sync reset bool isPendingSyncReset; - /// Last update date - String updatedAt; - @override bool operator ==(Object other) => identical(this, other) || other is SessionResponseDto && - other.appVersion == appVersion && - other.createdAt == createdAt && - other.current == current && - other.deviceOS == deviceOS && - other.deviceType == deviceType && - other.expiresAt == expiresAt && other.id == id && - other.isPendingSyncReset == isPendingSyncReset && - other.updatedAt == updatedAt; + other.createdAt == createdAt && + other.updatedAt == updatedAt && + other.expiresAt == expiresAt && + other.current == current && + other.deviceType == deviceType && + other.deviceOS == deviceOS && + other.appVersion == appVersion && + other.isPendingSyncReset == isPendingSyncReset; @override int get hashCode => // ignore: unnecessary_parenthesis - (appVersion == null ? 0 : appVersion!.hashCode) + - (createdAt.hashCode) + - (current.hashCode) + - (deviceOS.hashCode) + - (deviceType.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + (id.hashCode) + - (isPendingSyncReset.hashCode) + - (updatedAt.hashCode); + (createdAt.hashCode) + + (updatedAt.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + + (current.hashCode) + + (deviceType.hashCode) + + (deviceOS.hashCode) + + (appVersion == null ? 0 : appVersion!.hashCode) + + (isPendingSyncReset.hashCode); @override - String toString() => 'SessionResponseDto[appVersion=$appVersion, createdAt=$createdAt, current=$current, deviceOS=$deviceOS, deviceType=$deviceType, expiresAt=$expiresAt, id=$id, isPendingSyncReset=$isPendingSyncReset, updatedAt=$updatedAt]'; + String toString() => 'SessionResponseDto[id=$id, createdAt=$createdAt, updatedAt=$updatedAt, expiresAt=$expiresAt, current=$current, deviceType=$deviceType, deviceOS=$deviceOS, appVersion=$appVersion, isPendingSyncReset=$isPendingSyncReset]'; Map toJson() { final json = {}; - if (this.appVersion != null) { - json[r'appVersion'] = this.appVersion; - } else { - // json[r'appVersion'] = null; - } + json[r'id'] = this.id; json[r'createdAt'] = this.createdAt; - json[r'current'] = this.current; - json[r'deviceOS'] = this.deviceOS; - json[r'deviceType'] = this.deviceType; + json[r'updatedAt'] = this.updatedAt; if (this.expiresAt != null) { json[r'expiresAt'] = this.expiresAt; } else { // json[r'expiresAt'] = null; } - json[r'id'] = this.id; + json[r'current'] = this.current; + json[r'deviceType'] = this.deviceType; + json[r'deviceOS'] = this.deviceOS; + if (this.appVersion != null) { + json[r'appVersion'] = this.appVersion; + } else { + // json[r'appVersion'] = null; + } json[r'isPendingSyncReset'] = this.isPendingSyncReset; - json[r'updatedAt'] = this.updatedAt; return json; } @@ -116,15 +116,15 @@ class SessionResponseDto { final json = value.cast(); return SessionResponseDto( - appVersion: mapValueOfType(json, r'appVersion'), - createdAt: mapValueOfType(json, r'createdAt')!, - current: mapValueOfType(json, r'current')!, - deviceOS: mapValueOfType(json, r'deviceOS')!, - deviceType: mapValueOfType(json, r'deviceType')!, - expiresAt: mapValueOfType(json, r'expiresAt'), id: mapValueOfType(json, r'id')!, - isPendingSyncReset: mapValueOfType(json, r'isPendingSyncReset')!, + createdAt: mapValueOfType(json, r'createdAt')!, updatedAt: mapValueOfType(json, r'updatedAt')!, + expiresAt: mapValueOfType(json, r'expiresAt'), + current: mapValueOfType(json, r'current')!, + deviceType: mapValueOfType(json, r'deviceType')!, + deviceOS: mapValueOfType(json, r'deviceOS')!, + appVersion: mapValueOfType(json, r'appVersion'), + isPendingSyncReset: mapValueOfType(json, r'isPendingSyncReset')!, ); } return null; @@ -172,14 +172,14 @@ class SessionResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'appVersion', - 'createdAt', - 'current', - 'deviceOS', - 'deviceType', 'id', - 'isPendingSyncReset', + 'createdAt', 'updatedAt', + 'current', + 'deviceType', + 'deviceOS', + 'appVersion', + 'isPendingSyncReset', }; } diff --git a/mobile/openapi/lib/model/session_unlock_dto.dart b/mobile/openapi/lib/model/session_unlock_dto.dart deleted file mode 100644 index 48ee75fb05..0000000000 --- a/mobile/openapi/lib/model/session_unlock_dto.dart +++ /dev/null @@ -1,127 +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 SessionUnlockDto { - /// Returns a new [SessionUnlockDto] instance. - SessionUnlockDto({ - this.password, - this.pinCode, - }); - - /// User password (required if PIN code is not provided) - /// - /// 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? password; - - /// New PIN code (4-6 digits) - /// - /// 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? pinCode; - - @override - bool operator ==(Object other) => identical(this, other) || other is SessionUnlockDto && - other.password == password && - other.pinCode == pinCode; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (password == null ? 0 : password!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode); - - @override - String toString() => 'SessionUnlockDto[password=$password, pinCode=$pinCode]'; - - Map toJson() { - final json = {}; - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - return json; - } - - /// Returns a new [SessionUnlockDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SessionUnlockDto? fromJson(dynamic value) { - upgradeDto(value, "SessionUnlockDto"); - if (value is Map) { - final json = value.cast(); - - return SessionUnlockDto( - password: mapValueOfType(json, r'password'), - pinCode: mapValueOfType(json, r'pinCode'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SessionUnlockDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SessionUnlockDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SessionUnlockDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SessionUnlockDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/session_update_dto.dart b/mobile/openapi/lib/model/session_update_dto.dart deleted file mode 100644 index 3ab430deaa..0000000000 --- a/mobile/openapi/lib/model/session_update_dto.dart +++ /dev/null @@ -1,109 +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 SessionUpdateDto { - /// Returns a new [SessionUpdateDto] instance. - SessionUpdateDto({ - this.isPendingSyncReset, - }); - - /// Reset pending sync state - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isPendingSyncReset; - - @override - bool operator ==(Object other) => identical(this, other) || other is SessionUpdateDto && - other.isPendingSyncReset == isPendingSyncReset; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (isPendingSyncReset == null ? 0 : isPendingSyncReset!.hashCode); - - @override - String toString() => 'SessionUpdateDto[isPendingSyncReset=$isPendingSyncReset]'; - - Map toJson() { - final json = {}; - if (this.isPendingSyncReset != null) { - json[r'isPendingSyncReset'] = this.isPendingSyncReset; - } else { - // json[r'isPendingSyncReset'] = null; - } - return json; - } - - /// Returns a new [SessionUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SessionUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "SessionUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return SessionUpdateDto( - isPendingSyncReset: mapValueOfType(json, r'isPendingSyncReset'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SessionUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SessionUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SessionUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SessionUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/set_maintenance_mode_dto.dart b/mobile/openapi/lib/model/set_maintenance_mode_dto.dart deleted file mode 100644 index 14bf584bb9..0000000000 --- a/mobile/openapi/lib/model/set_maintenance_mode_dto.dart +++ /dev/null @@ -1,118 +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 SetMaintenanceModeDto { - /// Returns a new [SetMaintenanceModeDto] instance. - SetMaintenanceModeDto({ - required this.action, - this.restoreBackupFilename, - }); - - /// Maintenance action - MaintenanceAction action; - - /// Restore backup filename - /// - /// 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? restoreBackupFilename; - - @override - bool operator ==(Object other) => identical(this, other) || other is SetMaintenanceModeDto && - other.action == action && - other.restoreBackupFilename == restoreBackupFilename; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (action.hashCode) + - (restoreBackupFilename == null ? 0 : restoreBackupFilename!.hashCode); - - @override - String toString() => 'SetMaintenanceModeDto[action=$action, restoreBackupFilename=$restoreBackupFilename]'; - - Map toJson() { - final json = {}; - json[r'action'] = this.action; - if (this.restoreBackupFilename != null) { - json[r'restoreBackupFilename'] = this.restoreBackupFilename; - } else { - // json[r'restoreBackupFilename'] = null; - } - return json; - } - - /// Returns a new [SetMaintenanceModeDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SetMaintenanceModeDto? fromJson(dynamic value) { - upgradeDto(value, "SetMaintenanceModeDto"); - if (value is Map) { - final json = value.cast(); - - return SetMaintenanceModeDto( - action: MaintenanceAction.fromJson(json[r'action'])!, - restoreBackupFilename: mapValueOfType(json, r'restoreBackupFilename'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SetMaintenanceModeDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SetMaintenanceModeDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SetMaintenanceModeDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SetMaintenanceModeDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'action', - }; -} - diff --git a/mobile/openapi/lib/model/shared_link_create_dto.dart b/mobile/openapi/lib/model/shared_link_create_dto.dart deleted file mode 100644 index 2675ad4beb..0000000000 --- a/mobile/openapi/lib/model/shared_link_create_dto.dart +++ /dev/null @@ -1,210 +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 SharedLinkCreateDto { - /// Returns a new [SharedLinkCreateDto] instance. - SharedLinkCreateDto({ - this.albumId, - this.allowDownload = true, - this.allowUpload, - this.assetIds = const [], - this.description, - this.expiresAt, - this.password, - this.showMetadata = true, - this.slug, - required this.type, - }); - - /// Album ID (for album sharing) - /// - /// 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? albumId; - - /// Allow downloads - bool allowDownload; - - /// Allow uploads - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? allowUpload; - - /// Asset IDs (for individual assets) - List assetIds; - - /// Link description - String? description; - - /// Expiration date - DateTime? expiresAt; - - /// Link password - String? password; - - /// Show metadata - bool showMetadata; - - /// Custom URL slug - String? slug; - - /// Shared link type - SharedLinkType type; - - @override - bool operator ==(Object other) => identical(this, other) || other is SharedLinkCreateDto && - other.albumId == albumId && - other.allowDownload == allowDownload && - other.allowUpload == allowUpload && - _deepEquality.equals(other.assetIds, assetIds) && - other.description == description && - other.expiresAt == expiresAt && - other.password == password && - other.showMetadata == showMetadata && - other.slug == slug && - other.type == type; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId == null ? 0 : albumId!.hashCode) + - (allowDownload.hashCode) + - (allowUpload == null ? 0 : allowUpload!.hashCode) + - (assetIds.hashCode) + - (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + - (password == null ? 0 : password!.hashCode) + - (showMetadata.hashCode) + - (slug == null ? 0 : slug!.hashCode) + - (type.hashCode); - - @override - String toString() => 'SharedLinkCreateDto[albumId=$albumId, allowDownload=$allowDownload, allowUpload=$allowUpload, assetIds=$assetIds, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug, type=$type]'; - - Map toJson() { - final json = {}; - if (this.albumId != null) { - json[r'albumId'] = this.albumId; - } else { - // json[r'albumId'] = null; - } - json[r'allowDownload'] = this.allowDownload; - if (this.allowUpload != null) { - json[r'allowUpload'] = this.allowUpload; - } else { - // json[r'allowUpload'] = null; - } - json[r'assetIds'] = this.assetIds; - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); - } else { - // json[r'expiresAt'] = null; - } - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - json[r'showMetadata'] = this.showMetadata; - if (this.slug != null) { - json[r'slug'] = this.slug; - } else { - // json[r'slug'] = null; - } - json[r'type'] = this.type; - return json; - } - - /// Returns a new [SharedLinkCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SharedLinkCreateDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkCreateDto"); - if (value is Map) { - final json = value.cast(); - - return SharedLinkCreateDto( - albumId: mapValueOfType(json, r'albumId'), - allowDownload: mapValueOfType(json, r'allowDownload') ?? true, - allowUpload: mapValueOfType(json, r'allowUpload'), - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), - password: mapValueOfType(json, r'password'), - showMetadata: mapValueOfType(json, r'showMetadata') ?? true, - slug: mapValueOfType(json, r'slug'), - type: SharedLinkType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinkCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SharedLinkCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SharedLinkCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SharedLinkCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart deleted file mode 100644 index b22232add6..0000000000 --- a/mobile/openapi/lib/model/shared_link_edit_dto.dart +++ /dev/null @@ -1,211 +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 SharedLinkEditDto { - /// Returns a new [SharedLinkEditDto] instance. - SharedLinkEditDto({ - this.allowDownload, - this.allowUpload, - this.changeExpiryTime, - this.description, - this.expiresAt, - this.password, - this.showMetadata, - this.slug, - }); - - /// Allow downloads - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? allowDownload; - - /// Allow uploads - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? allowUpload; - - /// Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this. - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? changeExpiryTime; - - /// Link description - String? description; - - /// Expiration date - DateTime? expiresAt; - - /// Link password - String? password; - - /// Show metadata - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? showMetadata; - - /// Custom URL slug - String? slug; - - @override - bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto && - other.allowDownload == allowDownload && - other.allowUpload == allowUpload && - other.changeExpiryTime == changeExpiryTime && - other.description == description && - other.expiresAt == expiresAt && - other.password == password && - other.showMetadata == showMetadata && - other.slug == slug; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (allowDownload == null ? 0 : allowDownload!.hashCode) + - (allowUpload == null ? 0 : allowUpload!.hashCode) + - (changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + - (password == null ? 0 : password!.hashCode) + - (showMetadata == null ? 0 : showMetadata!.hashCode) + - (slug == null ? 0 : slug!.hashCode); - - @override - String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, changeExpiryTime=$changeExpiryTime, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug]'; - - Map toJson() { - final json = {}; - if (this.allowDownload != null) { - json[r'allowDownload'] = this.allowDownload; - } else { - // json[r'allowDownload'] = null; - } - if (this.allowUpload != null) { - json[r'allowUpload'] = this.allowUpload; - } else { - // json[r'allowUpload'] = null; - } - if (this.changeExpiryTime != null) { - json[r'changeExpiryTime'] = this.changeExpiryTime; - } else { - // json[r'changeExpiryTime'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); - } else { - // json[r'expiresAt'] = null; - } - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - if (this.showMetadata != null) { - json[r'showMetadata'] = this.showMetadata; - } else { - // json[r'showMetadata'] = null; - } - if (this.slug != null) { - json[r'slug'] = this.slug; - } else { - // json[r'slug'] = null; - } - return json; - } - - /// Returns a new [SharedLinkEditDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SharedLinkEditDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkEditDto"); - if (value is Map) { - final json = value.cast(); - - return SharedLinkEditDto( - allowDownload: mapValueOfType(json, r'allowDownload'), - allowUpload: mapValueOfType(json, r'allowUpload'), - changeExpiryTime: mapValueOfType(json, r'changeExpiryTime'), - description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), - password: mapValueOfType(json, r'password'), - showMetadata: mapValueOfType(json, r'showMetadata'), - slug: mapValueOfType(json, r'slug'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinkEditDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SharedLinkEditDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SharedLinkEditDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SharedLinkEditDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/shared_link_response_dto.dart b/mobile/openapi/lib/model/shared_link_response_dto.dart deleted file mode 100644 index d9aec48c39..0000000000 --- a/mobile/openapi/lib/model/shared_link_response_dto.dart +++ /dev/null @@ -1,252 +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 SharedLinkResponseDto { - /// Returns a new [SharedLinkResponseDto] instance. - SharedLinkResponseDto({ - this.album, - required this.allowDownload, - required this.allowUpload, - this.assets = const [], - required this.createdAt, - required this.description, - required this.expiresAt, - required this.id, - required this.key, - required this.password, - required this.showMetadata, - required this.slug, - this.token, - required this.type, - 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. - /// - AlbumResponseDto? album; - - /// Allow downloads - bool allowDownload; - - /// Allow uploads - bool allowUpload; - - List assets; - - /// Creation date - DateTime createdAt; - - /// Link description - String? description; - - /// Expiration date - DateTime? expiresAt; - - /// Shared link ID - String id; - - /// Encryption key (base64url) - String key; - - /// Has password - String? password; - - /// Show metadata - bool showMetadata; - - /// Custom URL slug - String? slug; - - /// Access token - String? token; - - /// Shared link type - SharedLinkType type; - - /// Owner user ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SharedLinkResponseDto && - other.album == album && - other.allowDownload == allowDownload && - other.allowUpload == allowUpload && - _deepEquality.equals(other.assets, assets) && - other.createdAt == createdAt && - other.description == description && - other.expiresAt == expiresAt && - other.id == id && - other.key == key && - other.password == password && - other.showMetadata == showMetadata && - other.slug == slug && - other.token == token && - other.type == type && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (album == null ? 0 : album!.hashCode) + - (allowDownload.hashCode) + - (allowUpload.hashCode) + - (assets.hashCode) + - (createdAt.hashCode) + - (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + - (id.hashCode) + - (key.hashCode) + - (password == null ? 0 : password!.hashCode) + - (showMetadata.hashCode) + - (slug == null ? 0 : slug!.hashCode) + - (token == null ? 0 : token!.hashCode) + - (type.hashCode) + - (userId.hashCode); - - @override - String toString() => 'SharedLinkResponseDto[album=$album, allowDownload=$allowDownload, allowUpload=$allowUpload, assets=$assets, createdAt=$createdAt, description=$description, expiresAt=$expiresAt, id=$id, key=$key, password=$password, showMetadata=$showMetadata, slug=$slug, token=$token, type=$type, userId=$userId]'; - - Map toJson() { - final json = {}; - if (this.album != null) { - json[r'album'] = this.album; - } else { - // json[r'album'] = null; - } - json[r'allowDownload'] = this.allowDownload; - json[r'allowUpload'] = this.allowUpload; - json[r'assets'] = this.assets; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); - } else { - // json[r'expiresAt'] = null; - } - json[r'id'] = this.id; - json[r'key'] = this.key; - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - json[r'showMetadata'] = this.showMetadata; - if (this.slug != null) { - json[r'slug'] = this.slug; - } else { - // json[r'slug'] = null; - } - if (this.token != null) { - json[r'token'] = this.token; - } else { - // json[r'token'] = null; - } - json[r'type'] = this.type; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [SharedLinkResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SharedLinkResponseDto? fromJson(dynamic value) { - upgradeDto(value, "SharedLinkResponseDto"); - if (value is Map) { - final json = value.cast(); - - return SharedLinkResponseDto( - album: AlbumResponseDto.fromJson(json[r'album']), - allowDownload: mapValueOfType(json, r'allowDownload')!, - allowUpload: mapValueOfType(json, r'allowUpload')!, - assets: AssetResponseDto.listFromJson(json[r'assets']), - createdAt: mapDateTime(json, r'createdAt', r'')!, - description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), - id: mapValueOfType(json, r'id')!, - key: mapValueOfType(json, r'key')!, - password: mapValueOfType(json, r'password'), - showMetadata: mapValueOfType(json, r'showMetadata')!, - slug: mapValueOfType(json, r'slug'), - token: mapValueOfType(json, r'token'), - type: SharedLinkType.fromJson(json[r'type'])!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinkResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SharedLinkResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SharedLinkResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SharedLinkResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'allowDownload', - 'allowUpload', - 'assets', - 'createdAt', - 'description', - 'expiresAt', - 'id', - 'key', - 'password', - 'showMetadata', - 'slug', - 'type', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/shared_link_type.dart b/mobile/openapi/lib/model/shared_link_type.dart deleted file mode 100644 index 6a17a9c763..0000000000 --- a/mobile/openapi/lib/model/shared_link_type.dart +++ /dev/null @@ -1,85 +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; - -/// Shared link type -class SharedLinkType { - /// Instantiate a new enum with the provided [value]. - const SharedLinkType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const ALBUM = SharedLinkType._(r'ALBUM'); - static const INDIVIDUAL = SharedLinkType._(r'INDIVIDUAL'); - - /// List of all possible values in this [enum][SharedLinkType]. - static const values = [ - ALBUM, - INDIVIDUAL, - ]; - - static SharedLinkType? fromJson(dynamic value) => SharedLinkTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinkType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SharedLinkType] to String, -/// and [decode] dynamic data back to [SharedLinkType]. -class SharedLinkTypeTypeTransformer { - factory SharedLinkTypeTypeTransformer() => _instance ??= const SharedLinkTypeTypeTransformer._(); - - const SharedLinkTypeTypeTransformer._(); - - String encode(SharedLinkType data) => data.value; - - /// Decodes a [dynamic value][data] to a SharedLinkType. - /// - /// 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. - SharedLinkType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'ALBUM': return SharedLinkType.ALBUM; - case r'INDIVIDUAL': return SharedLinkType.INDIVIDUAL; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SharedLinkTypeTypeTransformer] instance. - static SharedLinkTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/shared_links_response.dart b/mobile/openapi/lib/model/shared_links_response.dart deleted file mode 100644 index 510e94e43f..0000000000 --- a/mobile/openapi/lib/model/shared_links_response.dart +++ /dev/null @@ -1,109 +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 SharedLinksResponse { - /// Returns a new [SharedLinksResponse] instance. - SharedLinksResponse({ - this.enabled = true, - this.sidebarWeb = false, - }); - - /// Whether shared links are enabled - bool enabled; - - /// Whether shared links appear in web sidebar - bool sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is SharedLinksResponse && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (sidebarWeb.hashCode); - - @override - String toString() => 'SharedLinksResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'sidebarWeb'] = this.sidebarWeb; - return json; - } - - /// Returns a new [SharedLinksResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SharedLinksResponse? fromJson(dynamic value) { - upgradeDto(value, "SharedLinksResponse"); - if (value is Map) { - final json = value.cast(); - - return SharedLinksResponse( - enabled: mapValueOfType(json, r'enabled')!, - sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinksResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SharedLinksResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SharedLinksResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SharedLinksResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'sidebarWeb', - }; -} - diff --git a/mobile/openapi/lib/model/shared_links_update.dart b/mobile/openapi/lib/model/shared_links_update.dart deleted file mode 100644 index 8e792b4f49..0000000000 --- a/mobile/openapi/lib/model/shared_links_update.dart +++ /dev/null @@ -1,127 +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 SharedLinksUpdate { - /// Returns a new [SharedLinksUpdate] instance. - SharedLinksUpdate({ - this.enabled, - this.sidebarWeb, - }); - - /// Whether shared links are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Whether shared links appear in web sidebar - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is SharedLinksUpdate && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled == null ? 0 : enabled!.hashCode) + - (sidebarWeb == null ? 0 : sidebarWeb!.hashCode); - - @override - String toString() => 'SharedLinksUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - if (this.sidebarWeb != null) { - json[r'sidebarWeb'] = this.sidebarWeb; - } else { - // json[r'sidebarWeb'] = null; - } - return json; - } - - /// Returns a new [SharedLinksUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SharedLinksUpdate? fromJson(dynamic value) { - upgradeDto(value, "SharedLinksUpdate"); - if (value is Map) { - final json = value.cast(); - - return SharedLinksUpdate( - enabled: mapValueOfType(json, r'enabled'), - sidebarWeb: mapValueOfType(json, r'sidebarWeb'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SharedLinksUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SharedLinksUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SharedLinksUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SharedLinksUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/sign_up_dto.dart b/mobile/openapi/lib/model/sign_up_dto.dart index 54c8fa07d2..cda4c0fb35 100644 --- a/mobile/openapi/lib/model/sign_up_dto.dart +++ b/mobile/openapi/lib/model/sign_up_dto.dart @@ -14,40 +14,40 @@ class SignUpDto { /// Returns a new [SignUpDto] instance. SignUpDto({ required this.email, - required this.name, required this.password, + required this.name, }); /// User email String email; - /// User name - String name; - /// User password String password; + /// User name + String name; + @override bool operator ==(Object other) => identical(this, other) || other is SignUpDto && other.email == email && - other.name == name && - other.password == password; + other.password == password && + other.name == name; @override int get hashCode => // ignore: unnecessary_parenthesis (email.hashCode) + - (name.hashCode) + - (password.hashCode); + (password.hashCode) + + (name.hashCode); @override - String toString() => 'SignUpDto[email=$email, name=$name, password=$password]'; + String toString() => 'SignUpDto[email=$email, password=$password, name=$name]'; Map toJson() { final json = {}; json[r'email'] = this.email; - json[r'name'] = this.name; json[r'password'] = this.password; + json[r'name'] = this.name; return json; } @@ -61,8 +61,8 @@ class SignUpDto { return SignUpDto( email: mapValueOfType(json, r'email')!, - name: mapValueOfType(json, r'name')!, password: mapValueOfType(json, r'password')!, + name: mapValueOfType(json, r'name')!, ); } return null; @@ -111,8 +111,8 @@ class SignUpDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { 'email', - 'name', 'password', + 'name', }; } diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart deleted file mode 100644 index 7d43cea872..0000000000 --- a/mobile/openapi/lib/model/smart_search_dto.dart +++ /dev/null @@ -1,673 +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 SmartSearchDto { - /// Returns a new [SmartSearchDto] instance. - SmartSearchDto({ - this.albumIds = const [], - this.city, - this.country, - this.createdAfter, - this.createdBefore, - this.deviceId, - this.isEncoded, - this.isFavorite, - this.isMotion, - this.isNotInAlbum, - this.isOffline, - this.language, - this.lensModel, - this.libraryId, - this.make, - this.model, - this.ocr, - this.page, - this.personIds = const [], - this.query, - this.queryAssetId, - this.rating, - this.size, - this.state, - this.tagIds = const [], - this.takenAfter, - this.takenBefore, - this.trashedAfter, - this.trashedBefore, - this.type, - this.updatedAfter, - this.updatedBefore, - this.visibility, - this.withDeleted, - this.withExif, - }); - - /// Filter by album IDs - List albumIds; - - /// Filter by city name - String? city; - - /// Filter by country name - String? country; - - /// Filter by creation date (after) - /// - /// 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? createdAfter; - - /// Filter by creation date (before) - /// - /// 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? createdBefore; - - /// Device ID to filter by - /// - /// 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? deviceId; - - /// Filter by encoded status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isEncoded; - - /// Filter by favorite status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Filter by motion photo status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isMotion; - - /// Filter assets not in any album - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isNotInAlbum; - - /// Filter by offline status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isOffline; - - /// Search language code - /// - /// 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? language; - - /// Filter by lens model - String? lensModel; - - /// Library ID to filter by - String? libraryId; - - /// Filter by camera make - /// - /// 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? make; - - /// Filter by camera model - String? model; - - /// Filter by OCR text content - /// - /// 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? ocr; - - /// Page number - /// - /// Minimum value: 1 - /// - /// 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. - /// - num? page; - - /// Filter by person IDs - List personIds; - - /// Natural language search query - /// - /// 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? query; - - /// Asset ID to use as search reference - /// - /// 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? queryAssetId; - - /// Filter by rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Number of results to return - /// - /// Minimum value: 1 - /// Maximum value: 1000 - /// - /// 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. - /// - num? size; - - /// Filter by state/province name - String? state; - - /// Filter by tag IDs - List? tagIds; - - /// Filter by taken date (after) - /// - /// 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? takenAfter; - - /// Filter by taken date (before) - /// - /// 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? takenBefore; - - /// Filter by trash date (after) - /// - /// 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? trashedAfter; - - /// Filter by trash date (before) - /// - /// 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? trashedBefore; - - /// Asset type filter - /// - /// 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. - /// - AssetTypeEnum? type; - - /// Filter by update date (after) - /// - /// 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? updatedAfter; - - /// Filter by update date (before) - /// - /// 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? updatedBefore; - - /// Filter by visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - /// Include deleted assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withDeleted; - - /// Include EXIF data in response - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? withExif; - - @override - bool operator ==(Object other) => identical(this, other) || other is SmartSearchDto && - _deepEquality.equals(other.albumIds, albumIds) && - other.city == city && - other.country == country && - other.createdAfter == createdAfter && - other.createdBefore == createdBefore && - other.deviceId == deviceId && - other.isEncoded == isEncoded && - other.isFavorite == isFavorite && - other.isMotion == isMotion && - other.isNotInAlbum == isNotInAlbum && - other.isOffline == isOffline && - other.language == language && - other.lensModel == lensModel && - other.libraryId == libraryId && - other.make == make && - other.model == model && - other.ocr == ocr && - other.page == page && - _deepEquality.equals(other.personIds, personIds) && - other.query == query && - other.queryAssetId == queryAssetId && - other.rating == rating && - other.size == size && - other.state == state && - _deepEquality.equals(other.tagIds, tagIds) && - other.takenAfter == takenAfter && - other.takenBefore == takenBefore && - other.trashedAfter == trashedAfter && - other.trashedBefore == trashedBefore && - other.type == type && - other.updatedAfter == updatedAfter && - other.updatedBefore == updatedBefore && - other.visibility == visibility && - other.withDeleted == withDeleted && - other.withExif == withExif; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumIds.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (createdAfter == null ? 0 : createdAfter!.hashCode) + - (createdBefore == null ? 0 : createdBefore!.hashCode) + - (deviceId == null ? 0 : deviceId!.hashCode) + - (isEncoded == null ? 0 : isEncoded!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isMotion == null ? 0 : isMotion!.hashCode) + - (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + - (isOffline == null ? 0 : isOffline!.hashCode) + - (language == null ? 0 : language!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (ocr == null ? 0 : ocr!.hashCode) + - (page == null ? 0 : page!.hashCode) + - (personIds.hashCode) + - (query == null ? 0 : query!.hashCode) + - (queryAssetId == null ? 0 : queryAssetId!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (tagIds == null ? 0 : tagIds!.hashCode) + - (takenAfter == null ? 0 : takenAfter!.hashCode) + - (takenBefore == null ? 0 : takenBefore!.hashCode) + - (trashedAfter == null ? 0 : trashedAfter!.hashCode) + - (trashedBefore == null ? 0 : trashedBefore!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (updatedAfter == null ? 0 : updatedAfter!.hashCode) + - (updatedBefore == null ? 0 : updatedBefore!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode) + - (withDeleted == null ? 0 : withDeleted!.hashCode) + - (withExif == null ? 0 : withExif!.hashCode); - - @override - String toString() => 'SmartSearchDto[albumIds=$albumIds, city=$city, country=$country, createdAfter=$createdAfter, createdBefore=$createdBefore, deviceId=$deviceId, isEncoded=$isEncoded, isFavorite=$isFavorite, isMotion=$isMotion, isNotInAlbum=$isNotInAlbum, isOffline=$isOffline, language=$language, lensModel=$lensModel, libraryId=$libraryId, make=$make, model=$model, ocr=$ocr, page=$page, personIds=$personIds, query=$query, queryAssetId=$queryAssetId, rating=$rating, size=$size, state=$state, tagIds=$tagIds, takenAfter=$takenAfter, takenBefore=$takenBefore, trashedAfter=$trashedAfter, trashedBefore=$trashedBefore, type=$type, updatedAfter=$updatedAfter, updatedBefore=$updatedBefore, visibility=$visibility, withDeleted=$withDeleted, withExif=$withExif]'; - - Map toJson() { - final json = {}; - json[r'albumIds'] = this.albumIds; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.createdAfter != null) { - json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); - } else { - // json[r'createdAfter'] = null; - } - if (this.createdBefore != null) { - json[r'createdBefore'] = this.createdBefore!.toUtc().toIso8601String(); - } else { - // json[r'createdBefore'] = null; - } - if (this.deviceId != null) { - json[r'deviceId'] = this.deviceId; - } else { - // json[r'deviceId'] = null; - } - if (this.isEncoded != null) { - json[r'isEncoded'] = this.isEncoded; - } else { - // json[r'isEncoded'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isMotion != null) { - json[r'isMotion'] = this.isMotion; - } else { - // json[r'isMotion'] = null; - } - if (this.isNotInAlbum != null) { - json[r'isNotInAlbum'] = this.isNotInAlbum; - } else { - // json[r'isNotInAlbum'] = null; - } - if (this.isOffline != null) { - json[r'isOffline'] = this.isOffline; - } else { - // json[r'isOffline'] = null; - } - if (this.language != null) { - json[r'language'] = this.language; - } else { - // json[r'language'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.ocr != null) { - json[r'ocr'] = this.ocr; - } else { - // json[r'ocr'] = null; - } - if (this.page != null) { - json[r'page'] = this.page; - } else { - // json[r'page'] = null; - } - json[r'personIds'] = this.personIds; - if (this.query != null) { - json[r'query'] = this.query; - } else { - // json[r'query'] = null; - } - if (this.queryAssetId != null) { - json[r'queryAssetId'] = this.queryAssetId; - } else { - // json[r'queryAssetId'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.size != null) { - json[r'size'] = this.size; - } else { - // json[r'size'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.tagIds != null) { - json[r'tagIds'] = this.tagIds; - } else { - // json[r'tagIds'] = null; - } - if (this.takenAfter != null) { - json[r'takenAfter'] = this.takenAfter!.toUtc().toIso8601String(); - } else { - // json[r'takenAfter'] = null; - } - if (this.takenBefore != null) { - json[r'takenBefore'] = this.takenBefore!.toUtc().toIso8601String(); - } else { - // json[r'takenBefore'] = null; - } - if (this.trashedAfter != null) { - json[r'trashedAfter'] = this.trashedAfter!.toUtc().toIso8601String(); - } else { - // json[r'trashedAfter'] = null; - } - if (this.trashedBefore != null) { - json[r'trashedBefore'] = this.trashedBefore!.toUtc().toIso8601String(); - } else { - // json[r'trashedBefore'] = null; - } - if (this.type != null) { - json[r'type'] = this.type; - } else { - // json[r'type'] = null; - } - if (this.updatedAfter != null) { - json[r'updatedAfter'] = this.updatedAfter!.toUtc().toIso8601String(); - } else { - // json[r'updatedAfter'] = null; - } - if (this.updatedBefore != null) { - json[r'updatedBefore'] = this.updatedBefore!.toUtc().toIso8601String(); - } else { - // json[r'updatedBefore'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - if (this.withDeleted != null) { - json[r'withDeleted'] = this.withDeleted; - } else { - // json[r'withDeleted'] = null; - } - if (this.withExif != null) { - json[r'withExif'] = this.withExif; - } else { - // json[r'withExif'] = null; - } - return json; - } - - /// Returns a new [SmartSearchDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SmartSearchDto? fromJson(dynamic value) { - upgradeDto(value, "SmartSearchDto"); - if (value is Map) { - final json = value.cast(); - - return SmartSearchDto( - albumIds: json[r'albumIds'] is Iterable - ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) - : const [], - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), - deviceId: mapValueOfType(json, r'deviceId'), - isEncoded: mapValueOfType(json, r'isEncoded'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isMotion: mapValueOfType(json, r'isMotion'), - isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), - isOffline: mapValueOfType(json, r'isOffline'), - language: mapValueOfType(json, r'language'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - ocr: mapValueOfType(json, r'ocr'), - page: num.parse('${json[r'page']}'), - personIds: json[r'personIds'] is Iterable - ? (json[r'personIds'] as Iterable).cast().toList(growable: false) - : const [], - query: mapValueOfType(json, r'query'), - queryAssetId: mapValueOfType(json, r'queryAssetId'), - rating: num.parse('${json[r'rating']}'), - size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), - tagIds: json[r'tagIds'] is Iterable - ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) - : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), - type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), - visibility: AssetVisibility.fromJson(json[r'visibility']), - withDeleted: mapValueOfType(json, r'withDeleted'), - withExif: mapValueOfType(json, r'withExif'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SmartSearchDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SmartSearchDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SmartSearchDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SmartSearchDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/source_type.dart b/mobile/openapi/lib/model/source_type.dart deleted file mode 100644 index ed164172a3..0000000000 --- a/mobile/openapi/lib/model/source_type.dart +++ /dev/null @@ -1,88 +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; - -/// Face detection source type -class SourceType { - /// Instantiate a new enum with the provided [value]. - const SourceType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const machineLearning = SourceType._(r'machine-learning'); - static const exif = SourceType._(r'exif'); - static const manual = SourceType._(r'manual'); - - /// List of all possible values in this [enum][SourceType]. - static const values = [ - machineLearning, - exif, - manual, - ]; - - static SourceType? fromJson(dynamic value) => SourceTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SourceType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SourceType] to String, -/// and [decode] dynamic data back to [SourceType]. -class SourceTypeTypeTransformer { - factory SourceTypeTypeTransformer() => _instance ??= const SourceTypeTypeTransformer._(); - - const SourceTypeTypeTransformer._(); - - String encode(SourceType data) => data.value; - - /// Decodes a [dynamic value][data] to a SourceType. - /// - /// 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. - SourceType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'machine-learning': return SourceType.machineLearning; - case r'exif': return SourceType.exif; - case r'manual': return SourceType.manual; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SourceTypeTypeTransformer] instance. - static SourceTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/stack_create_dto.dart b/mobile/openapi/lib/model/stack_create_dto.dart deleted file mode 100644 index 6b08c83401..0000000000 --- a/mobile/openapi/lib/model/stack_create_dto.dart +++ /dev/null @@ -1,102 +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 StackCreateDto { - /// Returns a new [StackCreateDto] instance. - StackCreateDto({ - this.assetIds = const [], - }); - - /// Asset IDs (first becomes primary, min 2) - List assetIds; - - @override - bool operator ==(Object other) => identical(this, other) || other is StackCreateDto && - _deepEquality.equals(other.assetIds, assetIds); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode); - - @override - String toString() => 'StackCreateDto[assetIds=$assetIds]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - return json; - } - - /// Returns a new [StackCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static StackCreateDto? fromJson(dynamic value) { - upgradeDto(value, "StackCreateDto"); - if (value is Map) { - final json = value.cast(); - - return StackCreateDto( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = StackCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = StackCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of StackCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = StackCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetIds', - }; -} - diff --git a/mobile/openapi/lib/model/stack_response_dto.dart b/mobile/openapi/lib/model/stack_response_dto.dart deleted file mode 100644 index 638dfb5255..0000000000 --- a/mobile/openapi/lib/model/stack_response_dto.dart +++ /dev/null @@ -1,118 +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 StackResponseDto { - /// Returns a new [StackResponseDto] instance. - StackResponseDto({ - this.assets = const [], - required this.id, - required this.primaryAssetId, - }); - - /// Stack assets - List assets; - - /// Stack ID - String id; - - /// Primary asset ID - String primaryAssetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is StackResponseDto && - _deepEquality.equals(other.assets, assets) && - other.id == id && - other.primaryAssetId == primaryAssetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assets.hashCode) + - (id.hashCode) + - (primaryAssetId.hashCode); - - @override - String toString() => 'StackResponseDto[assets=$assets, id=$id, primaryAssetId=$primaryAssetId]'; - - Map toJson() { - final json = {}; - json[r'assets'] = this.assets; - json[r'id'] = this.id; - json[r'primaryAssetId'] = this.primaryAssetId; - return json; - } - - /// Returns a new [StackResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static StackResponseDto? fromJson(dynamic value) { - upgradeDto(value, "StackResponseDto"); - if (value is Map) { - final json = value.cast(); - - return StackResponseDto( - assets: AssetResponseDto.listFromJson(json[r'assets']), - id: mapValueOfType(json, r'id')!, - primaryAssetId: mapValueOfType(json, r'primaryAssetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = StackResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = StackResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of StackResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = StackResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assets', - 'id', - 'primaryAssetId', - }; -} - diff --git a/mobile/openapi/lib/model/stack_update_dto.dart b/mobile/openapi/lib/model/stack_update_dto.dart deleted file mode 100644 index e81c204f97..0000000000 --- a/mobile/openapi/lib/model/stack_update_dto.dart +++ /dev/null @@ -1,109 +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 StackUpdateDto { - /// Returns a new [StackUpdateDto] instance. - StackUpdateDto({ - this.primaryAssetId, - }); - - /// Primary asset ID - /// - /// 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? primaryAssetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is StackUpdateDto && - other.primaryAssetId == primaryAssetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (primaryAssetId == null ? 0 : primaryAssetId!.hashCode); - - @override - String toString() => 'StackUpdateDto[primaryAssetId=$primaryAssetId]'; - - Map toJson() { - final json = {}; - if (this.primaryAssetId != null) { - json[r'primaryAssetId'] = this.primaryAssetId; - } else { - // json[r'primaryAssetId'] = null; - } - return json; - } - - /// Returns a new [StackUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static StackUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "StackUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return StackUpdateDto( - primaryAssetId: mapValueOfType(json, r'primaryAssetId'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = StackUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = StackUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of StackUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = StackUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/statistics_search_dto.dart b/mobile/openapi/lib/model/statistics_search_dto.dart deleted file mode 100644 index fce2feb421..0000000000 --- a/mobile/openapi/lib/model/statistics_search_dto.dart +++ /dev/null @@ -1,560 +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 StatisticsSearchDto { - /// Returns a new [StatisticsSearchDto] instance. - StatisticsSearchDto({ - this.albumIds = const [], - this.city, - this.country, - this.createdAfter, - this.createdBefore, - this.description, - this.deviceId, - this.isEncoded, - this.isFavorite, - this.isMotion, - this.isNotInAlbum, - this.isOffline, - this.lensModel, - this.libraryId, - this.make, - this.model, - this.ocr, - this.personIds = const [], - this.rating, - this.state, - this.tagIds = const [], - this.takenAfter, - this.takenBefore, - this.trashedAfter, - this.trashedBefore, - this.type, - this.updatedAfter, - this.updatedBefore, - this.visibility, - }); - - /// Filter by album IDs - List albumIds; - - /// Filter by city name - String? city; - - /// Filter by country name - String? country; - - /// Filter by creation date (after) - /// - /// 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? createdAfter; - - /// Filter by creation date (before) - /// - /// 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? createdBefore; - - /// Filter by description text - /// - /// 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? description; - - /// Device ID to filter by - /// - /// 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? deviceId; - - /// Filter by encoded status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isEncoded; - - /// Filter by favorite status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Filter by motion photo status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isMotion; - - /// Filter assets not in any album - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isNotInAlbum; - - /// Filter by offline status - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isOffline; - - /// Filter by lens model - String? lensModel; - - /// Library ID to filter by - String? libraryId; - - /// Filter by camera make - /// - /// 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? make; - - /// Filter by camera model - String? model; - - /// Filter by OCR text content - /// - /// 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? ocr; - - /// Filter by person IDs - List personIds; - - /// Filter by rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Filter by state/province name - String? state; - - /// Filter by tag IDs - List? tagIds; - - /// Filter by taken date (after) - /// - /// 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? takenAfter; - - /// Filter by taken date (before) - /// - /// 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? takenBefore; - - /// Filter by trash date (after) - /// - /// 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? trashedAfter; - - /// Filter by trash date (before) - /// - /// 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? trashedBefore; - - /// Asset type filter - /// - /// 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. - /// - AssetTypeEnum? type; - - /// Filter by update date (after) - /// - /// 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? updatedAfter; - - /// Filter by update date (before) - /// - /// 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? updatedBefore; - - /// Filter by visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - @override - bool operator ==(Object other) => identical(this, other) || other is StatisticsSearchDto && - _deepEquality.equals(other.albumIds, albumIds) && - other.city == city && - other.country == country && - other.createdAfter == createdAfter && - other.createdBefore == createdBefore && - other.description == description && - other.deviceId == deviceId && - other.isEncoded == isEncoded && - other.isFavorite == isFavorite && - other.isMotion == isMotion && - other.isNotInAlbum == isNotInAlbum && - other.isOffline == isOffline && - other.lensModel == lensModel && - other.libraryId == libraryId && - other.make == make && - other.model == model && - other.ocr == ocr && - _deepEquality.equals(other.personIds, personIds) && - other.rating == rating && - other.state == state && - _deepEquality.equals(other.tagIds, tagIds) && - other.takenAfter == takenAfter && - other.takenBefore == takenBefore && - other.trashedAfter == trashedAfter && - other.trashedBefore == trashedBefore && - other.type == type && - other.updatedAfter == updatedAfter && - other.updatedBefore == updatedBefore && - other.visibility == visibility; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumIds.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (createdAfter == null ? 0 : createdAfter!.hashCode) + - (createdBefore == null ? 0 : createdBefore!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (deviceId == null ? 0 : deviceId!.hashCode) + - (isEncoded == null ? 0 : isEncoded!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (isMotion == null ? 0 : isMotion!.hashCode) + - (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + - (isOffline == null ? 0 : isOffline!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (ocr == null ? 0 : ocr!.hashCode) + - (personIds.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (tagIds == null ? 0 : tagIds!.hashCode) + - (takenAfter == null ? 0 : takenAfter!.hashCode) + - (takenBefore == null ? 0 : takenBefore!.hashCode) + - (trashedAfter == null ? 0 : trashedAfter!.hashCode) + - (trashedBefore == null ? 0 : trashedBefore!.hashCode) + - (type == null ? 0 : type!.hashCode) + - (updatedAfter == null ? 0 : updatedAfter!.hashCode) + - (updatedBefore == null ? 0 : updatedBefore!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode); - - @override - String toString() => 'StatisticsSearchDto[albumIds=$albumIds, city=$city, country=$country, createdAfter=$createdAfter, createdBefore=$createdBefore, description=$description, deviceId=$deviceId, isEncoded=$isEncoded, isFavorite=$isFavorite, isMotion=$isMotion, isNotInAlbum=$isNotInAlbum, isOffline=$isOffline, lensModel=$lensModel, libraryId=$libraryId, make=$make, model=$model, ocr=$ocr, personIds=$personIds, rating=$rating, state=$state, tagIds=$tagIds, takenAfter=$takenAfter, takenBefore=$takenBefore, trashedAfter=$trashedAfter, trashedBefore=$trashedBefore, type=$type, updatedAfter=$updatedAfter, updatedBefore=$updatedBefore, visibility=$visibility]'; - - Map toJson() { - final json = {}; - json[r'albumIds'] = this.albumIds; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.createdAfter != null) { - json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); - } else { - // json[r'createdAfter'] = null; - } - if (this.createdBefore != null) { - json[r'createdBefore'] = this.createdBefore!.toUtc().toIso8601String(); - } else { - // json[r'createdBefore'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.deviceId != null) { - json[r'deviceId'] = this.deviceId; - } else { - // json[r'deviceId'] = null; - } - if (this.isEncoded != null) { - json[r'isEncoded'] = this.isEncoded; - } else { - // json[r'isEncoded'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.isMotion != null) { - json[r'isMotion'] = this.isMotion; - } else { - // json[r'isMotion'] = null; - } - if (this.isNotInAlbum != null) { - json[r'isNotInAlbum'] = this.isNotInAlbum; - } else { - // json[r'isNotInAlbum'] = null; - } - if (this.isOffline != null) { - json[r'isOffline'] = this.isOffline; - } else { - // json[r'isOffline'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.ocr != null) { - json[r'ocr'] = this.ocr; - } else { - // json[r'ocr'] = null; - } - json[r'personIds'] = this.personIds; - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.tagIds != null) { - json[r'tagIds'] = this.tagIds; - } else { - // json[r'tagIds'] = null; - } - if (this.takenAfter != null) { - json[r'takenAfter'] = this.takenAfter!.toUtc().toIso8601String(); - } else { - // json[r'takenAfter'] = null; - } - if (this.takenBefore != null) { - json[r'takenBefore'] = this.takenBefore!.toUtc().toIso8601String(); - } else { - // json[r'takenBefore'] = null; - } - if (this.trashedAfter != null) { - json[r'trashedAfter'] = this.trashedAfter!.toUtc().toIso8601String(); - } else { - // json[r'trashedAfter'] = null; - } - if (this.trashedBefore != null) { - json[r'trashedBefore'] = this.trashedBefore!.toUtc().toIso8601String(); - } else { - // json[r'trashedBefore'] = null; - } - if (this.type != null) { - json[r'type'] = this.type; - } else { - // json[r'type'] = null; - } - if (this.updatedAfter != null) { - json[r'updatedAfter'] = this.updatedAfter!.toUtc().toIso8601String(); - } else { - // json[r'updatedAfter'] = null; - } - if (this.updatedBefore != null) { - json[r'updatedBefore'] = this.updatedBefore!.toUtc().toIso8601String(); - } else { - // json[r'updatedBefore'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - return json; - } - - /// Returns a new [StatisticsSearchDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static StatisticsSearchDto? fromJson(dynamic value) { - upgradeDto(value, "StatisticsSearchDto"); - if (value is Map) { - final json = value.cast(); - - return StatisticsSearchDto( - albumIds: json[r'albumIds'] is Iterable - ? (json[r'albumIds'] as Iterable).cast().toList(growable: false) - : const [], - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), - description: mapValueOfType(json, r'description'), - deviceId: mapValueOfType(json, r'deviceId'), - isEncoded: mapValueOfType(json, r'isEncoded'), - isFavorite: mapValueOfType(json, r'isFavorite'), - isMotion: mapValueOfType(json, r'isMotion'), - isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), - isOffline: mapValueOfType(json, r'isOffline'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - ocr: mapValueOfType(json, r'ocr'), - personIds: json[r'personIds'] is Iterable - ? (json[r'personIds'] as Iterable).cast().toList(growable: false) - : const [], - rating: num.parse('${json[r'rating']}'), - state: mapValueOfType(json, r'state'), - tagIds: json[r'tagIds'] is Iterable - ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) - : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), - type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), - visibility: AssetVisibility.fromJson(json[r'visibility']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = StatisticsSearchDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = StatisticsSearchDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of StatisticsSearchDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = StatisticsSearchDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/storage_folder.dart b/mobile/openapi/lib/model/storage_folder.dart deleted file mode 100644 index 8579d48f28..0000000000 --- a/mobile/openapi/lib/model/storage_folder.dart +++ /dev/null @@ -1,97 +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; - -/// Storage folder -class StorageFolder { - /// Instantiate a new enum with the provided [value]. - const StorageFolder._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const encodedVideo = StorageFolder._(r'encoded-video'); - static const library_ = StorageFolder._(r'library'); - static const upload = StorageFolder._(r'upload'); - static const profile = StorageFolder._(r'profile'); - static const thumbs = StorageFolder._(r'thumbs'); - static const backups = StorageFolder._(r'backups'); - - /// List of all possible values in this [enum][StorageFolder]. - static const values = [ - encodedVideo, - library_, - upload, - profile, - thumbs, - backups, - ]; - - static StorageFolder? fromJson(dynamic value) => StorageFolderTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = StorageFolder.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [StorageFolder] to String, -/// and [decode] dynamic data back to [StorageFolder]. -class StorageFolderTypeTransformer { - factory StorageFolderTypeTransformer() => _instance ??= const StorageFolderTypeTransformer._(); - - const StorageFolderTypeTransformer._(); - - String encode(StorageFolder data) => data.value; - - /// Decodes a [dynamic value][data] to a StorageFolder. - /// - /// 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. - StorageFolder? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'encoded-video': return StorageFolder.encodedVideo; - case r'library': return StorageFolder.library_; - case r'upload': return StorageFolder.upload; - case r'profile': return StorageFolder.profile; - case r'thumbs': return StorageFolder.thumbs; - case r'backups': return StorageFolder.backups; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [StorageFolderTypeTransformer] instance. - static StorageFolderTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/sync_ack_delete_dto.dart b/mobile/openapi/lib/model/sync_ack_delete_dto.dart deleted file mode 100644 index b72ae8c5a6..0000000000 --- a/mobile/openapi/lib/model/sync_ack_delete_dto.dart +++ /dev/null @@ -1,99 +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 SyncAckDeleteDto { - /// Returns a new [SyncAckDeleteDto] instance. - SyncAckDeleteDto({ - this.types = const [], - }); - - /// Sync entity types to delete acks for - List types; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAckDeleteDto && - _deepEquality.equals(other.types, types); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (types.hashCode); - - @override - String toString() => 'SyncAckDeleteDto[types=$types]'; - - Map toJson() { - final json = {}; - json[r'types'] = this.types; - return json; - } - - /// Returns a new [SyncAckDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAckDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return SyncAckDeleteDto( - types: SyncEntityType.listFromJson(json[r'types']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAckDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAckDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAckDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAckDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/sync_ack_dto.dart b/mobile/openapi/lib/model/sync_ack_dto.dart deleted file mode 100644 index 747f671557..0000000000 --- a/mobile/openapi/lib/model/sync_ack_dto.dart +++ /dev/null @@ -1,109 +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 SyncAckDto { - /// Returns a new [SyncAckDto] instance. - SyncAckDto({ - required this.ack, - required this.type, - }); - - /// Acknowledgment ID - String ack; - - /// Sync entity type - SyncEntityType type; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAckDto && - other.ack == ack && - other.type == type; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (ack.hashCode) + - (type.hashCode); - - @override - String toString() => 'SyncAckDto[ack=$ack, type=$type]'; - - Map toJson() { - final json = {}; - json[r'ack'] = this.ack; - json[r'type'] = this.type; - return json; - } - - /// Returns a new [SyncAckDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAckDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckDto"); - if (value is Map) { - final json = value.cast(); - - return SyncAckDto( - ack: mapValueOfType(json, r'ack')!, - type: SyncEntityType.fromJson(json[r'type'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAckDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAckDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAckDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAckDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'ack', - 'type', - }; -} - diff --git a/mobile/openapi/lib/model/sync_ack_set_dto.dart b/mobile/openapi/lib/model/sync_ack_set_dto.dart deleted file mode 100644 index 531a9dc763..0000000000 --- a/mobile/openapi/lib/model/sync_ack_set_dto.dart +++ /dev/null @@ -1,102 +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 SyncAckSetDto { - /// Returns a new [SyncAckSetDto] instance. - SyncAckSetDto({ - this.acks = const [], - }); - - /// Acknowledgment IDs (max 1000) - List acks; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAckSetDto && - _deepEquality.equals(other.acks, acks); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (acks.hashCode); - - @override - String toString() => 'SyncAckSetDto[acks=$acks]'; - - Map toJson() { - final json = {}; - json[r'acks'] = this.acks; - return json; - } - - /// Returns a new [SyncAckSetDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAckSetDto? fromJson(dynamic value) { - upgradeDto(value, "SyncAckSetDto"); - if (value is Map) { - final json = value.cast(); - - return SyncAckSetDto( - acks: json[r'acks'] is Iterable - ? (json[r'acks'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAckSetDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAckSetDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAckSetDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAckSetDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'acks', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_delete_v1.dart b/mobile/openapi/lib/model/sync_album_delete_v1.dart deleted file mode 100644 index a6fdf5c68c..0000000000 --- a/mobile/openapi/lib/model/sync_album_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncAlbumDeleteV1 { - /// Returns a new [SyncAlbumDeleteV1] instance. - SyncAlbumDeleteV1({ - required this.albumId, - }); - - /// Album ID - String albumId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumDeleteV1 && - other.albumId == albumId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId.hashCode); - - @override - String toString() => 'SyncAlbumDeleteV1[albumId=$albumId]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - return json; - } - - /// Returns a new [SyncAlbumDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumDeleteV1( - albumId: mapValueOfType(json, r'albumId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart deleted file mode 100644 index 08952b90ed..0000000000 --- a/mobile/openapi/lib/model/sync_album_to_asset_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncAlbumToAssetDeleteV1 { - /// Returns a new [SyncAlbumToAssetDeleteV1] instance. - SyncAlbumToAssetDeleteV1({ - required this.albumId, - required this.assetId, - }); - - /// Album ID - String albumId; - - /// Asset ID - String assetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumToAssetDeleteV1 && - other.albumId == albumId && - other.assetId == assetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId.hashCode) + - (assetId.hashCode); - - @override - String toString() => 'SyncAlbumToAssetDeleteV1[albumId=$albumId, assetId=$assetId]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - json[r'assetId'] = this.assetId; - return json; - } - - /// Returns a new [SyncAlbumToAssetDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumToAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumToAssetDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumToAssetDeleteV1( - albumId: mapValueOfType(json, r'albumId')!, - assetId: mapValueOfType(json, r'assetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumToAssetDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumToAssetDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumToAssetDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumToAssetDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumId', - 'assetId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_to_asset_v1.dart b/mobile/openapi/lib/model/sync_album_to_asset_v1.dart deleted file mode 100644 index 5f38b35088..0000000000 --- a/mobile/openapi/lib/model/sync_album_to_asset_v1.dart +++ /dev/null @@ -1,109 +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 SyncAlbumToAssetV1 { - /// Returns a new [SyncAlbumToAssetV1] instance. - SyncAlbumToAssetV1({ - required this.albumId, - required this.assetId, - }); - - /// Album ID - String albumId; - - /// Asset ID - String assetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumToAssetV1 && - other.albumId == albumId && - other.assetId == assetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId.hashCode) + - (assetId.hashCode); - - @override - String toString() => 'SyncAlbumToAssetV1[albumId=$albumId, assetId=$assetId]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - json[r'assetId'] = this.assetId; - return json; - } - - /// Returns a new [SyncAlbumToAssetV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumToAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumToAssetV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumToAssetV1( - albumId: mapValueOfType(json, r'albumId')!, - assetId: mapValueOfType(json, r'assetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumToAssetV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumToAssetV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumToAssetV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumToAssetV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumId', - 'assetId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_user_delete_v1.dart b/mobile/openapi/lib/model/sync_album_user_delete_v1.dart deleted file mode 100644 index 526bcc6b6e..0000000000 --- a/mobile/openapi/lib/model/sync_album_user_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncAlbumUserDeleteV1 { - /// Returns a new [SyncAlbumUserDeleteV1] instance. - SyncAlbumUserDeleteV1({ - required this.albumId, - required this.userId, - }); - - /// Album ID - String albumId; - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumUserDeleteV1 && - other.albumId == albumId && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId.hashCode) + - (userId.hashCode); - - @override - String toString() => 'SyncAlbumUserDeleteV1[albumId=$albumId, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [SyncAlbumUserDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumUserDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumUserDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumUserDeleteV1( - albumId: mapValueOfType(json, r'albumId')!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumUserDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumUserDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumUserDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumUserDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumId', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_user_v1.dart b/mobile/openapi/lib/model/sync_album_user_v1.dart deleted file mode 100644 index 3fc8972069..0000000000 --- a/mobile/openapi/lib/model/sync_album_user_v1.dart +++ /dev/null @@ -1,118 +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 SyncAlbumUserV1 { - /// Returns a new [SyncAlbumUserV1] instance. - SyncAlbumUserV1({ - required this.albumId, - required this.role, - required this.userId, - }); - - /// Album ID - String albumId; - - /// Album user role - AlbumUserRole role; - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumUserV1 && - other.albumId == albumId && - other.role == role && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumId.hashCode) + - (role.hashCode) + - (userId.hashCode); - - @override - String toString() => 'SyncAlbumUserV1[albumId=$albumId, role=$role, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'albumId'] = this.albumId; - json[r'role'] = this.role; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [SyncAlbumUserV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumUserV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumUserV1( - albumId: mapValueOfType(json, r'albumId')!, - role: AlbumUserRole.fromJson(json[r'role'])!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumUserV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumUserV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumUserV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumUserV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumId', - 'role', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_album_v1.dart b/mobile/openapi/lib/model/sync_album_v1.dart deleted file mode 100644 index 6c89d93724..0000000000 --- a/mobile/openapi/lib/model/sync_album_v1.dart +++ /dev/null @@ -1,175 +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 SyncAlbumV1 { - /// Returns a new [SyncAlbumV1] instance. - SyncAlbumV1({ - required this.createdAt, - required this.description, - required this.id, - required this.isActivityEnabled, - required this.name, - required this.order, - required this.ownerId, - required this.thumbnailAssetId, - required this.updatedAt, - }); - - /// Created at - DateTime createdAt; - - /// Album description - String description; - - /// Album ID - String id; - - /// Is activity enabled - bool isActivityEnabled; - - /// Album name - String name; - - AssetOrder order; - - /// Owner ID - String ownerId; - - /// Thumbnail asset ID - String? thumbnailAssetId; - - /// Updated at - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAlbumV1 && - other.createdAt == createdAt && - other.description == description && - other.id == id && - other.isActivityEnabled == isActivityEnabled && - other.name == name && - other.order == order && - other.ownerId == ownerId && - other.thumbnailAssetId == thumbnailAssetId && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (createdAt.hashCode) + - (description.hashCode) + - (id.hashCode) + - (isActivityEnabled.hashCode) + - (name.hashCode) + - (order.hashCode) + - (ownerId.hashCode) + - (thumbnailAssetId == null ? 0 : thumbnailAssetId!.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'SyncAlbumV1[createdAt=$createdAt, description=$description, id=$id, isActivityEnabled=$isActivityEnabled, name=$name, order=$order, ownerId=$ownerId, thumbnailAssetId=$thumbnailAssetId, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'description'] = this.description; - json[r'id'] = this.id; - json[r'isActivityEnabled'] = this.isActivityEnabled; - json[r'name'] = this.name; - json[r'order'] = this.order; - json[r'ownerId'] = this.ownerId; - if (this.thumbnailAssetId != null) { - json[r'thumbnailAssetId'] = this.thumbnailAssetId; - } else { - // json[r'thumbnailAssetId'] = null; - } - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [SyncAlbumV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAlbumV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAlbumV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAlbumV1( - createdAt: mapDateTime(json, r'createdAt', r'')!, - description: mapValueOfType(json, r'description')!, - id: mapValueOfType(json, r'id')!, - isActivityEnabled: mapValueOfType(json, r'isActivityEnabled')!, - name: mapValueOfType(json, r'name')!, - order: AssetOrder.fromJson(json[r'order'])!, - ownerId: mapValueOfType(json, r'ownerId')!, - thumbnailAssetId: mapValueOfType(json, r'thumbnailAssetId'), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAlbumV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAlbumV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAlbumV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAlbumV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'description', - 'id', - 'isActivityEnabled', - 'name', - 'order', - 'ownerId', - 'thumbnailAssetId', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_delete_v1.dart deleted file mode 100644 index 1d5a947774..0000000000 --- a/mobile/openapi/lib/model/sync_asset_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncAssetDeleteV1 { - /// Returns a new [SyncAssetDeleteV1] instance. - SyncAssetDeleteV1({ - required this.assetId, - }); - - /// Asset ID - String assetId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetDeleteV1 && - other.assetId == assetId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode); - - @override - String toString() => 'SyncAssetDeleteV1[assetId=$assetId]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - return json; - } - - /// Returns a new [SyncAssetDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetDeleteV1( - assetId: mapValueOfType(json, r'assetId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_exif_v1.dart b/mobile/openapi/lib/model/sync_asset_exif_v1.dart deleted file mode 100644 index ff9efdfea3..0000000000 --- a/mobile/openapi/lib/model/sync_asset_exif_v1.dart +++ /dev/null @@ -1,412 +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 SyncAssetExifV1 { - /// Returns a new [SyncAssetExifV1] instance. - SyncAssetExifV1({ - required this.assetId, - required this.city, - required this.country, - required this.dateTimeOriginal, - required this.description, - required this.exifImageHeight, - required this.exifImageWidth, - required this.exposureTime, - required this.fNumber, - required this.fileSizeInByte, - required this.focalLength, - required this.fps, - required this.iso, - required this.latitude, - required this.lensModel, - required this.longitude, - required this.make, - required this.model, - required this.modifyDate, - required this.orientation, - required this.profileDescription, - required this.projectionType, - required this.rating, - required this.state, - required this.timeZone, - }); - - /// Asset ID - String assetId; - - /// City - String? city; - - /// Country - String? country; - - /// Date time original - DateTime? dateTimeOriginal; - - /// Description - String? description; - - /// Exif image height - int? exifImageHeight; - - /// Exif image width - int? exifImageWidth; - - /// Exposure time - String? exposureTime; - - /// F number - double? fNumber; - - /// File size in byte - int? fileSizeInByte; - - /// Focal length - double? focalLength; - - /// FPS - double? fps; - - /// ISO - int? iso; - - /// Latitude - double? latitude; - - /// Lens model - String? lensModel; - - /// Longitude - double? longitude; - - /// Make - String? make; - - /// Model - String? model; - - /// Modify date - DateTime? modifyDate; - - /// Orientation - String? orientation; - - /// Profile description - String? profileDescription; - - /// Projection type - String? projectionType; - - /// Rating - int? rating; - - /// State - String? state; - - /// Time zone - String? timeZone; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetExifV1 && - other.assetId == assetId && - other.city == city && - other.country == country && - other.dateTimeOriginal == dateTimeOriginal && - other.description == description && - other.exifImageHeight == exifImageHeight && - other.exifImageWidth == exifImageWidth && - other.exposureTime == exposureTime && - other.fNumber == fNumber && - other.fileSizeInByte == fileSizeInByte && - other.focalLength == focalLength && - other.fps == fps && - other.iso == iso && - other.latitude == latitude && - other.lensModel == lensModel && - other.longitude == longitude && - other.make == make && - other.model == model && - other.modifyDate == modifyDate && - other.orientation == orientation && - other.profileDescription == profileDescription && - other.projectionType == projectionType && - other.rating == rating && - other.state == state && - other.timeZone == timeZone; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (exifImageHeight == null ? 0 : exifImageHeight!.hashCode) + - (exifImageWidth == null ? 0 : exifImageWidth!.hashCode) + - (exposureTime == null ? 0 : exposureTime!.hashCode) + - (fNumber == null ? 0 : fNumber!.hashCode) + - (fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) + - (focalLength == null ? 0 : focalLength!.hashCode) + - (fps == null ? 0 : fps!.hashCode) + - (iso == null ? 0 : iso!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (modifyDate == null ? 0 : modifyDate!.hashCode) + - (orientation == null ? 0 : orientation!.hashCode) + - (profileDescription == null ? 0 : profileDescription!.hashCode) + - (projectionType == null ? 0 : projectionType!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (timeZone == null ? 0 : timeZone!.hashCode); - - @override - String toString() => 'SyncAssetExifV1[assetId=$assetId, city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, fps=$fps, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, profileDescription=$profileDescription, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - if (this.city != null) { - json[r'city'] = this.city; - } else { - // json[r'city'] = null; - } - if (this.country != null) { - json[r'country'] = this.country; - } else { - // json[r'country'] = null; - } - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); - } else { - // json[r'dateTimeOriginal'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.exifImageHeight != null) { - json[r'exifImageHeight'] = this.exifImageHeight; - } else { - // json[r'exifImageHeight'] = null; - } - if (this.exifImageWidth != null) { - json[r'exifImageWidth'] = this.exifImageWidth; - } else { - // json[r'exifImageWidth'] = null; - } - if (this.exposureTime != null) { - json[r'exposureTime'] = this.exposureTime; - } else { - // json[r'exposureTime'] = null; - } - if (this.fNumber != null) { - json[r'fNumber'] = this.fNumber; - } else { - // json[r'fNumber'] = null; - } - if (this.fileSizeInByte != null) { - json[r'fileSizeInByte'] = this.fileSizeInByte; - } else { - // json[r'fileSizeInByte'] = null; - } - if (this.focalLength != null) { - json[r'focalLength'] = this.focalLength; - } else { - // json[r'focalLength'] = null; - } - if (this.fps != null) { - json[r'fps'] = this.fps; - } else { - // json[r'fps'] = null; - } - if (this.iso != null) { - json[r'iso'] = this.iso; - } else { - // json[r'iso'] = null; - } - if (this.latitude != null) { - json[r'latitude'] = this.latitude; - } else { - // json[r'latitude'] = null; - } - if (this.lensModel != null) { - json[r'lensModel'] = this.lensModel; - } else { - // json[r'lensModel'] = null; - } - if (this.longitude != null) { - json[r'longitude'] = this.longitude; - } else { - // json[r'longitude'] = null; - } - if (this.make != null) { - json[r'make'] = this.make; - } else { - // json[r'make'] = null; - } - if (this.model != null) { - json[r'model'] = this.model; - } else { - // json[r'model'] = null; - } - if (this.modifyDate != null) { - json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); - } else { - // json[r'modifyDate'] = null; - } - if (this.orientation != null) { - json[r'orientation'] = this.orientation; - } else { - // json[r'orientation'] = null; - } - if (this.profileDescription != null) { - json[r'profileDescription'] = this.profileDescription; - } else { - // json[r'profileDescription'] = null; - } - if (this.projectionType != null) { - json[r'projectionType'] = this.projectionType; - } else { - // json[r'projectionType'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.state != null) { - json[r'state'] = this.state; - } else { - // json[r'state'] = null; - } - if (this.timeZone != null) { - json[r'timeZone'] = this.timeZone; - } else { - // json[r'timeZone'] = null; - } - return json; - } - - /// Returns a new [SyncAssetExifV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetExifV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetExifV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetExifV1( - assetId: mapValueOfType(json, r'assetId')!, - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), - description: mapValueOfType(json, r'description'), - exifImageHeight: mapValueOfType(json, r'exifImageHeight'), - exifImageWidth: mapValueOfType(json, r'exifImageWidth'), - exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: (mapValueOfType(json, r'fNumber'))?.toDouble(), - fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: (mapValueOfType(json, r'focalLength'))?.toDouble(), - fps: (mapValueOfType(json, r'fps'))?.toDouble(), - iso: mapValueOfType(json, r'iso'), - latitude: (mapValueOfType(json, r'latitude'))?.toDouble(), - lensModel: mapValueOfType(json, r'lensModel'), - longitude: (mapValueOfType(json, r'longitude'))?.toDouble(), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - modifyDate: mapDateTime(json, r'modifyDate', r''), - orientation: mapValueOfType(json, r'orientation'), - profileDescription: mapValueOfType(json, r'profileDescription'), - projectionType: mapValueOfType(json, r'projectionType'), - rating: mapValueOfType(json, r'rating'), - state: mapValueOfType(json, r'state'), - timeZone: mapValueOfType(json, r'timeZone'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetExifV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetExifV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetExifV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetExifV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'city', - 'country', - 'dateTimeOriginal', - 'description', - 'exifImageHeight', - 'exifImageWidth', - 'exposureTime', - 'fNumber', - 'fileSizeInByte', - 'focalLength', - 'fps', - 'iso', - 'latitude', - 'lensModel', - 'longitude', - 'make', - 'model', - 'modifyDate', - 'orientation', - 'profileDescription', - 'projectionType', - 'rating', - 'state', - 'timeZone', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart deleted file mode 100644 index 9cfb8814a7..0000000000 --- a/mobile/openapi/lib/model/sync_asset_face_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncAssetFaceDeleteV1 { - /// Returns a new [SyncAssetFaceDeleteV1] instance. - SyncAssetFaceDeleteV1({ - required this.assetFaceId, - }); - - /// Asset face ID - String assetFaceId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetFaceDeleteV1 && - other.assetFaceId == assetFaceId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetFaceId.hashCode); - - @override - String toString() => 'SyncAssetFaceDeleteV1[assetFaceId=$assetFaceId]'; - - Map toJson() { - final json = {}; - json[r'assetFaceId'] = this.assetFaceId; - return json; - } - - /// Returns a new [SyncAssetFaceDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetFaceDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetFaceDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetFaceDeleteV1( - assetFaceId: mapValueOfType(json, r'assetFaceId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetFaceDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetFaceDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetFaceDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetFaceDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetFaceId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_face_v1.dart b/mobile/openapi/lib/model/sync_asset_face_v1.dart deleted file mode 100644 index 647a07d5eb..0000000000 --- a/mobile/openapi/lib/model/sync_asset_face_v1.dart +++ /dev/null @@ -1,179 +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 SyncAssetFaceV1 { - /// Returns a new [SyncAssetFaceV1] instance. - SyncAssetFaceV1({ - required this.assetId, - required this.boundingBoxX1, - required this.boundingBoxX2, - required this.boundingBoxY1, - required this.boundingBoxY2, - required this.id, - required this.imageHeight, - required this.imageWidth, - required this.personId, - required this.sourceType, - }); - - /// Asset ID - String assetId; - - int boundingBoxX1; - - int boundingBoxX2; - - int boundingBoxY1; - - int boundingBoxY2; - - /// Asset face ID - String id; - - int imageHeight; - - int imageWidth; - - /// Person ID - String? personId; - - /// Source type - String sourceType; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetFaceV1 && - other.assetId == assetId && - other.boundingBoxX1 == boundingBoxX1 && - other.boundingBoxX2 == boundingBoxX2 && - other.boundingBoxY1 == boundingBoxY1 && - other.boundingBoxY2 == boundingBoxY2 && - other.id == id && - other.imageHeight == imageHeight && - other.imageWidth == imageWidth && - other.personId == personId && - other.sourceType == sourceType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (boundingBoxX1.hashCode) + - (boundingBoxX2.hashCode) + - (boundingBoxY1.hashCode) + - (boundingBoxY2.hashCode) + - (id.hashCode) + - (imageHeight.hashCode) + - (imageWidth.hashCode) + - (personId == null ? 0 : personId!.hashCode) + - (sourceType.hashCode); - - @override - String toString() => 'SyncAssetFaceV1[assetId=$assetId, boundingBoxX1=$boundingBoxX1, boundingBoxX2=$boundingBoxX2, boundingBoxY1=$boundingBoxY1, boundingBoxY2=$boundingBoxY2, id=$id, imageHeight=$imageHeight, imageWidth=$imageWidth, personId=$personId, sourceType=$sourceType]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'boundingBoxX1'] = this.boundingBoxX1; - json[r'boundingBoxX2'] = this.boundingBoxX2; - json[r'boundingBoxY1'] = this.boundingBoxY1; - json[r'boundingBoxY2'] = this.boundingBoxY2; - json[r'id'] = this.id; - json[r'imageHeight'] = this.imageHeight; - json[r'imageWidth'] = this.imageWidth; - if (this.personId != null) { - json[r'personId'] = this.personId; - } else { - // json[r'personId'] = null; - } - json[r'sourceType'] = this.sourceType; - return json; - } - - /// Returns a new [SyncAssetFaceV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetFaceV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetFaceV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetFaceV1( - assetId: mapValueOfType(json, r'assetId')!, - boundingBoxX1: mapValueOfType(json, r'boundingBoxX1')!, - boundingBoxX2: mapValueOfType(json, r'boundingBoxX2')!, - boundingBoxY1: mapValueOfType(json, r'boundingBoxY1')!, - boundingBoxY2: mapValueOfType(json, r'boundingBoxY2')!, - id: mapValueOfType(json, r'id')!, - imageHeight: mapValueOfType(json, r'imageHeight')!, - imageWidth: mapValueOfType(json, r'imageWidth')!, - personId: mapValueOfType(json, r'personId'), - sourceType: mapValueOfType(json, r'sourceType')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetFaceV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetFaceV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetFaceV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetFaceV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'boundingBoxX1', - 'boundingBoxX2', - 'boundingBoxY1', - 'boundingBoxY2', - 'id', - 'imageHeight', - 'imageWidth', - 'personId', - 'sourceType', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart b/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart deleted file mode 100644 index 326555ef13..0000000000 --- a/mobile/openapi/lib/model/sync_asset_metadata_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncAssetMetadataDeleteV1 { - /// Returns a new [SyncAssetMetadataDeleteV1] instance. - SyncAssetMetadataDeleteV1({ - required this.assetId, - required this.key, - }); - - /// Asset ID - String assetId; - - /// Key - String key; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetMetadataDeleteV1 && - other.assetId == assetId && - other.key == key; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (key.hashCode); - - @override - String toString() => 'SyncAssetMetadataDeleteV1[assetId=$assetId, key=$key]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'key'] = this.key; - return json; - } - - /// Returns a new [SyncAssetMetadataDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetMetadataDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetMetadataDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetMetadataDeleteV1( - assetId: mapValueOfType(json, r'assetId')!, - key: mapValueOfType(json, r'key')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetMetadataDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetMetadataDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetMetadataDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetMetadataDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'key', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_metadata_v1.dart b/mobile/openapi/lib/model/sync_asset_metadata_v1.dart deleted file mode 100644 index 4a66623939..0000000000 --- a/mobile/openapi/lib/model/sync_asset_metadata_v1.dart +++ /dev/null @@ -1,118 +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 SyncAssetMetadataV1 { - /// Returns a new [SyncAssetMetadataV1] instance. - SyncAssetMetadataV1({ - required this.assetId, - required this.key, - required this.value, - }); - - /// Asset ID - String assetId; - - /// Key - String key; - - /// Value - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetMetadataV1 && - other.assetId == assetId && - other.key == key && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (key.hashCode) + - (value.hashCode); - - @override - String toString() => 'SyncAssetMetadataV1[assetId=$assetId, key=$key, value=$value]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'key'] = this.key; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [SyncAssetMetadataV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetMetadataV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetMetadataV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetMetadataV1( - assetId: mapValueOfType(json, r'assetId')!, - key: mapValueOfType(json, r'key')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetMetadataV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetMetadataV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetMetadataV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetMetadataV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'key', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart deleted file mode 100644 index debde4488e..0000000000 --- a/mobile/openapi/lib/model/sync_asset_v1.dart +++ /dev/null @@ -1,306 +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 SyncAssetV1 { - /// Returns a new [SyncAssetV1] instance. - SyncAssetV1({ - required this.checksum, - required this.deletedAt, - required this.duration, - required this.fileCreatedAt, - required this.fileModifiedAt, - required this.height, - required this.id, - required this.isEdited, - required this.isFavorite, - required this.libraryId, - required this.livePhotoVideoId, - required this.localDateTime, - required this.originalFileName, - required this.ownerId, - required this.stackId, - required this.thumbhash, - required this.type, - required this.visibility, - required this.width, - }); - - /// Checksum - String checksum; - - /// Deleted at - DateTime? deletedAt; - - /// Duration - String? duration; - - /// File created at - DateTime? fileCreatedAt; - - /// File modified at - DateTime? fileModifiedAt; - - /// Asset height - int? height; - - /// Asset ID - String id; - - /// Is edited - bool isEdited; - - /// Is favorite - bool isFavorite; - - /// Library ID - String? libraryId; - - /// Live photo video ID - String? livePhotoVideoId; - - /// Local date time - DateTime? localDateTime; - - /// Original file name - String originalFileName; - - /// Owner ID - String ownerId; - - /// Stack ID - String? stackId; - - /// Thumbhash - String? thumbhash; - - /// Asset type - AssetTypeEnum type; - - /// Asset visibility - AssetVisibility visibility; - - /// Asset width - int? width; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAssetV1 && - other.checksum == checksum && - other.deletedAt == deletedAt && - other.duration == duration && - other.fileCreatedAt == fileCreatedAt && - other.fileModifiedAt == fileModifiedAt && - other.height == height && - other.id == id && - other.isEdited == isEdited && - other.isFavorite == isFavorite && - other.libraryId == libraryId && - other.livePhotoVideoId == livePhotoVideoId && - other.localDateTime == localDateTime && - other.originalFileName == originalFileName && - other.ownerId == ownerId && - other.stackId == stackId && - other.thumbhash == thumbhash && - other.type == type && - other.visibility == visibility && - other.width == width; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (checksum.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (duration == null ? 0 : duration!.hashCode) + - (fileCreatedAt == null ? 0 : fileCreatedAt!.hashCode) + - (fileModifiedAt == null ? 0 : fileModifiedAt!.hashCode) + - (height == null ? 0 : height!.hashCode) + - (id.hashCode) + - (isEdited.hashCode) + - (isFavorite.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + - (localDateTime == null ? 0 : localDateTime!.hashCode) + - (originalFileName.hashCode) + - (ownerId.hashCode) + - (stackId == null ? 0 : stackId!.hashCode) + - (thumbhash == null ? 0 : thumbhash!.hashCode) + - (type.hashCode) + - (visibility.hashCode) + - (width == null ? 0 : width!.hashCode); - - @override - String toString() => 'SyncAssetV1[checksum=$checksum, deletedAt=$deletedAt, duration=$duration, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, height=$height, id=$id, isEdited=$isEdited, isFavorite=$isFavorite, libraryId=$libraryId, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, originalFileName=$originalFileName, ownerId=$ownerId, stackId=$stackId, thumbhash=$thumbhash, type=$type, visibility=$visibility, width=$width]'; - - Map toJson() { - final json = {}; - json[r'checksum'] = this.checksum; - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); - } else { - // json[r'deletedAt'] = null; - } - if (this.duration != null) { - json[r'duration'] = this.duration; - } else { - // json[r'duration'] = null; - } - if (this.fileCreatedAt != null) { - json[r'fileCreatedAt'] = this.fileCreatedAt!.toUtc().toIso8601String(); - } else { - // json[r'fileCreatedAt'] = null; - } - if (this.fileModifiedAt != null) { - json[r'fileModifiedAt'] = this.fileModifiedAt!.toUtc().toIso8601String(); - } else { - // json[r'fileModifiedAt'] = null; - } - if (this.height != null) { - json[r'height'] = this.height; - } else { - // json[r'height'] = null; - } - json[r'id'] = this.id; - json[r'isEdited'] = this.isEdited; - json[r'isFavorite'] = this.isFavorite; - if (this.libraryId != null) { - json[r'libraryId'] = this.libraryId; - } else { - // json[r'libraryId'] = null; - } - if (this.livePhotoVideoId != null) { - json[r'livePhotoVideoId'] = this.livePhotoVideoId; - } else { - // json[r'livePhotoVideoId'] = null; - } - if (this.localDateTime != null) { - json[r'localDateTime'] = this.localDateTime!.toUtc().toIso8601String(); - } else { - // json[r'localDateTime'] = null; - } - json[r'originalFileName'] = this.originalFileName; - json[r'ownerId'] = this.ownerId; - if (this.stackId != null) { - json[r'stackId'] = this.stackId; - } else { - // json[r'stackId'] = null; - } - if (this.thumbhash != null) { - json[r'thumbhash'] = this.thumbhash; - } else { - // json[r'thumbhash'] = null; - } - json[r'type'] = this.type; - json[r'visibility'] = this.visibility; - if (this.width != null) { - json[r'width'] = this.width; - } else { - // json[r'width'] = null; - } - return json; - } - - /// Returns a new [SyncAssetV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAssetV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAssetV1( - checksum: mapValueOfType(json, r'checksum')!, - deletedAt: mapDateTime(json, r'deletedAt', r''), - duration: mapValueOfType(json, r'duration'), - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r''), - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r''), - height: mapValueOfType(json, r'height'), - id: mapValueOfType(json, r'id')!, - isEdited: mapValueOfType(json, r'isEdited')!, - isFavorite: mapValueOfType(json, r'isFavorite')!, - libraryId: mapValueOfType(json, r'libraryId'), - livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), - localDateTime: mapDateTime(json, r'localDateTime', r''), - originalFileName: mapValueOfType(json, r'originalFileName')!, - ownerId: mapValueOfType(json, r'ownerId')!, - stackId: mapValueOfType(json, r'stackId'), - thumbhash: mapValueOfType(json, r'thumbhash'), - type: AssetTypeEnum.fromJson(json[r'type'])!, - visibility: AssetVisibility.fromJson(json[r'visibility'])!, - width: mapValueOfType(json, r'width'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAssetV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAssetV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAssetV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAssetV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'checksum', - 'deletedAt', - 'duration', - 'fileCreatedAt', - 'fileModifiedAt', - 'height', - 'id', - 'isEdited', - 'isFavorite', - 'libraryId', - 'livePhotoVideoId', - 'localDateTime', - 'originalFileName', - 'ownerId', - 'stackId', - 'thumbhash', - 'type', - 'visibility', - 'width', - }; -} - diff --git a/mobile/openapi/lib/model/sync_auth_user_v1.dart b/mobile/openapi/lib/model/sync_auth_user_v1.dart deleted file mode 100644 index 0edd804c6a..0000000000 --- a/mobile/openapi/lib/model/sync_auth_user_v1.dart +++ /dev/null @@ -1,226 +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 SyncAuthUserV1 { - /// Returns a new [SyncAuthUserV1] instance. - SyncAuthUserV1({ - required this.avatarColor, - required this.deletedAt, - required this.email, - required this.hasProfileImage, - required this.id, - required this.isAdmin, - required this.name, - required this.oauthId, - required this.pinCode, - required this.profileChangedAt, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - required this.storageLabel, - }); - - /// User avatar color - UserAvatarColor? avatarColor; - - /// User deleted at - DateTime? deletedAt; - - /// User email - String email; - - /// User has profile image - bool hasProfileImage; - - /// User ID - String id; - - /// User is admin - bool isAdmin; - - /// User name - String name; - - /// User OAuth ID - String oauthId; - - /// User pin code - String? pinCode; - - /// User profile changed at - DateTime profileChangedAt; - - int? quotaSizeInBytes; - - int quotaUsageInBytes; - - /// User storage label - String? storageLabel; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncAuthUserV1 && - other.avatarColor == avatarColor && - other.deletedAt == deletedAt && - other.email == email && - other.hasProfileImage == hasProfileImage && - other.id == id && - other.isAdmin == isAdmin && - other.name == name && - other.oauthId == oauthId && - other.pinCode == pinCode && - other.profileChangedAt == profileChangedAt && - other.quotaSizeInBytes == quotaSizeInBytes && - other.quotaUsageInBytes == quotaUsageInBytes && - other.storageLabel == storageLabel; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (email.hashCode) + - (hasProfileImage.hashCode) + - (id.hashCode) + - (isAdmin.hashCode) + - (name.hashCode) + - (oauthId.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode) + - (profileChangedAt.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (quotaUsageInBytes.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode); - - @override - String toString() => 'SyncAuthUserV1[avatarColor=$avatarColor, deletedAt=$deletedAt, email=$email, hasProfileImage=$hasProfileImage, id=$id, isAdmin=$isAdmin, name=$name, oauthId=$oauthId, pinCode=$pinCode, profileChangedAt=$profileChangedAt, quotaSizeInBytes=$quotaSizeInBytes, quotaUsageInBytes=$quotaUsageInBytes, storageLabel=$storageLabel]'; - - Map toJson() { - final json = {}; - if (this.avatarColor != null) { - json[r'avatarColor'] = this.avatarColor; - } else { - // json[r'avatarColor'] = null; - } - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); - } else { - // json[r'deletedAt'] = null; - } - json[r'email'] = this.email; - json[r'hasProfileImage'] = this.hasProfileImage; - json[r'id'] = this.id; - json[r'isAdmin'] = this.isAdmin; - json[r'name'] = this.name; - json[r'oauthId'] = this.oauthId; - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - if (this.quotaSizeInBytes != null) { - json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; - } else { - // json[r'quotaSizeInBytes'] = null; - } - json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; - if (this.storageLabel != null) { - json[r'storageLabel'] = this.storageLabel; - } else { - // json[r'storageLabel'] = null; - } - return json; - } - - /// Returns a new [SyncAuthUserV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncAuthUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncAuthUserV1"); - if (value is Map) { - final json = value.cast(); - - return SyncAuthUserV1( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), - deletedAt: mapDateTime(json, r'deletedAt', r''), - email: mapValueOfType(json, r'email')!, - hasProfileImage: mapValueOfType(json, r'hasProfileImage')!, - id: mapValueOfType(json, r'id')!, - isAdmin: mapValueOfType(json, r'isAdmin')!, - name: mapValueOfType(json, r'name')!, - oauthId: mapValueOfType(json, r'oauthId')!, - pinCode: mapValueOfType(json, r'pinCode'), - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - quotaUsageInBytes: mapValueOfType(json, r'quotaUsageInBytes')!, - storageLabel: mapValueOfType(json, r'storageLabel'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncAuthUserV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncAuthUserV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncAuthUserV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncAuthUserV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'avatarColor', - 'deletedAt', - 'email', - 'hasProfileImage', - 'id', - 'isAdmin', - 'name', - 'oauthId', - 'pinCode', - 'profileChangedAt', - 'quotaSizeInBytes', - 'quotaUsageInBytes', - 'storageLabel', - }; -} - diff --git a/mobile/openapi/lib/model/sync_entity_type.dart b/mobile/openapi/lib/model/sync_entity_type.dart deleted file mode 100644 index d1e321f39b..0000000000 --- a/mobile/openapi/lib/model/sync_entity_type.dart +++ /dev/null @@ -1,220 +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; - -/// Sync entity type -class SyncEntityType { - /// Instantiate a new enum with the provided [value]. - const SyncEntityType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const authUserV1 = SyncEntityType._(r'AuthUserV1'); - static const userV1 = SyncEntityType._(r'UserV1'); - static const userDeleteV1 = SyncEntityType._(r'UserDeleteV1'); - static const assetV1 = SyncEntityType._(r'AssetV1'); - static const assetDeleteV1 = SyncEntityType._(r'AssetDeleteV1'); - static const assetExifV1 = SyncEntityType._(r'AssetExifV1'); - static const assetMetadataV1 = SyncEntityType._(r'AssetMetadataV1'); - static const assetMetadataDeleteV1 = SyncEntityType._(r'AssetMetadataDeleteV1'); - static const partnerV1 = SyncEntityType._(r'PartnerV1'); - static const partnerDeleteV1 = SyncEntityType._(r'PartnerDeleteV1'); - static const partnerAssetV1 = SyncEntityType._(r'PartnerAssetV1'); - static const partnerAssetBackfillV1 = SyncEntityType._(r'PartnerAssetBackfillV1'); - static const partnerAssetDeleteV1 = SyncEntityType._(r'PartnerAssetDeleteV1'); - static const partnerAssetExifV1 = SyncEntityType._(r'PartnerAssetExifV1'); - static const partnerAssetExifBackfillV1 = SyncEntityType._(r'PartnerAssetExifBackfillV1'); - static const partnerStackBackfillV1 = SyncEntityType._(r'PartnerStackBackfillV1'); - static const partnerStackDeleteV1 = SyncEntityType._(r'PartnerStackDeleteV1'); - static const partnerStackV1 = SyncEntityType._(r'PartnerStackV1'); - static const albumV1 = SyncEntityType._(r'AlbumV1'); - static const albumDeleteV1 = SyncEntityType._(r'AlbumDeleteV1'); - static const albumUserV1 = SyncEntityType._(r'AlbumUserV1'); - static const albumUserBackfillV1 = SyncEntityType._(r'AlbumUserBackfillV1'); - static const albumUserDeleteV1 = SyncEntityType._(r'AlbumUserDeleteV1'); - static const albumAssetCreateV1 = SyncEntityType._(r'AlbumAssetCreateV1'); - static const albumAssetUpdateV1 = SyncEntityType._(r'AlbumAssetUpdateV1'); - static const albumAssetBackfillV1 = SyncEntityType._(r'AlbumAssetBackfillV1'); - static const albumAssetExifCreateV1 = SyncEntityType._(r'AlbumAssetExifCreateV1'); - static const albumAssetExifUpdateV1 = SyncEntityType._(r'AlbumAssetExifUpdateV1'); - static const albumAssetExifBackfillV1 = SyncEntityType._(r'AlbumAssetExifBackfillV1'); - static const albumToAssetV1 = SyncEntityType._(r'AlbumToAssetV1'); - static const albumToAssetDeleteV1 = SyncEntityType._(r'AlbumToAssetDeleteV1'); - static const albumToAssetBackfillV1 = SyncEntityType._(r'AlbumToAssetBackfillV1'); - static const memoryV1 = SyncEntityType._(r'MemoryV1'); - static const memoryDeleteV1 = SyncEntityType._(r'MemoryDeleteV1'); - static const memoryToAssetV1 = SyncEntityType._(r'MemoryToAssetV1'); - static const memoryToAssetDeleteV1 = SyncEntityType._(r'MemoryToAssetDeleteV1'); - static const stackV1 = SyncEntityType._(r'StackV1'); - static const stackDeleteV1 = SyncEntityType._(r'StackDeleteV1'); - static const personV1 = SyncEntityType._(r'PersonV1'); - static const personDeleteV1 = SyncEntityType._(r'PersonDeleteV1'); - static const assetFaceV1 = SyncEntityType._(r'AssetFaceV1'); - static const assetFaceDeleteV1 = SyncEntityType._(r'AssetFaceDeleteV1'); - static const userMetadataV1 = SyncEntityType._(r'UserMetadataV1'); - static const userMetadataDeleteV1 = SyncEntityType._(r'UserMetadataDeleteV1'); - static const syncAckV1 = SyncEntityType._(r'SyncAckV1'); - static const syncResetV1 = SyncEntityType._(r'SyncResetV1'); - static const syncCompleteV1 = SyncEntityType._(r'SyncCompleteV1'); - - /// List of all possible values in this [enum][SyncEntityType]. - static const values = [ - authUserV1, - userV1, - userDeleteV1, - assetV1, - assetDeleteV1, - assetExifV1, - assetMetadataV1, - assetMetadataDeleteV1, - partnerV1, - partnerDeleteV1, - partnerAssetV1, - partnerAssetBackfillV1, - partnerAssetDeleteV1, - partnerAssetExifV1, - partnerAssetExifBackfillV1, - partnerStackBackfillV1, - partnerStackDeleteV1, - partnerStackV1, - albumV1, - albumDeleteV1, - albumUserV1, - albumUserBackfillV1, - albumUserDeleteV1, - albumAssetCreateV1, - albumAssetUpdateV1, - albumAssetBackfillV1, - albumAssetExifCreateV1, - albumAssetExifUpdateV1, - albumAssetExifBackfillV1, - albumToAssetV1, - albumToAssetDeleteV1, - albumToAssetBackfillV1, - memoryV1, - memoryDeleteV1, - memoryToAssetV1, - memoryToAssetDeleteV1, - stackV1, - stackDeleteV1, - personV1, - personDeleteV1, - assetFaceV1, - assetFaceDeleteV1, - userMetadataV1, - userMetadataDeleteV1, - syncAckV1, - syncResetV1, - syncCompleteV1, - ]; - - static SyncEntityType? fromJson(dynamic value) => SyncEntityTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncEntityType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SyncEntityType] to String, -/// and [decode] dynamic data back to [SyncEntityType]. -class SyncEntityTypeTypeTransformer { - factory SyncEntityTypeTypeTransformer() => _instance ??= const SyncEntityTypeTypeTransformer._(); - - const SyncEntityTypeTypeTransformer._(); - - String encode(SyncEntityType data) => data.value; - - /// Decodes a [dynamic value][data] to a SyncEntityType. - /// - /// 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. - SyncEntityType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'AuthUserV1': return SyncEntityType.authUserV1; - case r'UserV1': return SyncEntityType.userV1; - case r'UserDeleteV1': return SyncEntityType.userDeleteV1; - case r'AssetV1': return SyncEntityType.assetV1; - case r'AssetDeleteV1': return SyncEntityType.assetDeleteV1; - case r'AssetExifV1': return SyncEntityType.assetExifV1; - case r'AssetMetadataV1': return SyncEntityType.assetMetadataV1; - case r'AssetMetadataDeleteV1': return SyncEntityType.assetMetadataDeleteV1; - case r'PartnerV1': return SyncEntityType.partnerV1; - case r'PartnerDeleteV1': return SyncEntityType.partnerDeleteV1; - case r'PartnerAssetV1': return SyncEntityType.partnerAssetV1; - case r'PartnerAssetBackfillV1': return SyncEntityType.partnerAssetBackfillV1; - case r'PartnerAssetDeleteV1': return SyncEntityType.partnerAssetDeleteV1; - case r'PartnerAssetExifV1': return SyncEntityType.partnerAssetExifV1; - case r'PartnerAssetExifBackfillV1': return SyncEntityType.partnerAssetExifBackfillV1; - case r'PartnerStackBackfillV1': return SyncEntityType.partnerStackBackfillV1; - case r'PartnerStackDeleteV1': return SyncEntityType.partnerStackDeleteV1; - case r'PartnerStackV1': return SyncEntityType.partnerStackV1; - case r'AlbumV1': return SyncEntityType.albumV1; - case r'AlbumDeleteV1': return SyncEntityType.albumDeleteV1; - case r'AlbumUserV1': return SyncEntityType.albumUserV1; - case r'AlbumUserBackfillV1': return SyncEntityType.albumUserBackfillV1; - case r'AlbumUserDeleteV1': return SyncEntityType.albumUserDeleteV1; - case r'AlbumAssetCreateV1': return SyncEntityType.albumAssetCreateV1; - case r'AlbumAssetUpdateV1': return SyncEntityType.albumAssetUpdateV1; - case r'AlbumAssetBackfillV1': return SyncEntityType.albumAssetBackfillV1; - case r'AlbumAssetExifCreateV1': return SyncEntityType.albumAssetExifCreateV1; - case r'AlbumAssetExifUpdateV1': return SyncEntityType.albumAssetExifUpdateV1; - case r'AlbumAssetExifBackfillV1': return SyncEntityType.albumAssetExifBackfillV1; - case r'AlbumToAssetV1': return SyncEntityType.albumToAssetV1; - case r'AlbumToAssetDeleteV1': return SyncEntityType.albumToAssetDeleteV1; - case r'AlbumToAssetBackfillV1': return SyncEntityType.albumToAssetBackfillV1; - case r'MemoryV1': return SyncEntityType.memoryV1; - case r'MemoryDeleteV1': return SyncEntityType.memoryDeleteV1; - case r'MemoryToAssetV1': return SyncEntityType.memoryToAssetV1; - case r'MemoryToAssetDeleteV1': return SyncEntityType.memoryToAssetDeleteV1; - case r'StackV1': return SyncEntityType.stackV1; - case r'StackDeleteV1': return SyncEntityType.stackDeleteV1; - case r'PersonV1': return SyncEntityType.personV1; - case r'PersonDeleteV1': return SyncEntityType.personDeleteV1; - case r'AssetFaceV1': return SyncEntityType.assetFaceV1; - case r'AssetFaceDeleteV1': return SyncEntityType.assetFaceDeleteV1; - case r'UserMetadataV1': return SyncEntityType.userMetadataV1; - case r'UserMetadataDeleteV1': return SyncEntityType.userMetadataDeleteV1; - case r'SyncAckV1': return SyncEntityType.syncAckV1; - case r'SyncResetV1': return SyncEntityType.syncResetV1; - case r'SyncCompleteV1': return SyncEntityType.syncCompleteV1; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SyncEntityTypeTypeTransformer] instance. - static SyncEntityTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart b/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart deleted file mode 100644 index c37682d02d..0000000000 --- a/mobile/openapi/lib/model/sync_memory_asset_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncMemoryAssetDeleteV1 { - /// Returns a new [SyncMemoryAssetDeleteV1] instance. - SyncMemoryAssetDeleteV1({ - required this.assetId, - required this.memoryId, - }); - - /// Asset ID - String assetId; - - /// Memory ID - String memoryId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncMemoryAssetDeleteV1 && - other.assetId == assetId && - other.memoryId == memoryId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (memoryId.hashCode); - - @override - String toString() => 'SyncMemoryAssetDeleteV1[assetId=$assetId, memoryId=$memoryId]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'memoryId'] = this.memoryId; - return json; - } - - /// Returns a new [SyncMemoryAssetDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncMemoryAssetDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryAssetDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncMemoryAssetDeleteV1( - assetId: mapValueOfType(json, r'assetId')!, - memoryId: mapValueOfType(json, r'memoryId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncMemoryAssetDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncMemoryAssetDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncMemoryAssetDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncMemoryAssetDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'memoryId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_memory_asset_v1.dart b/mobile/openapi/lib/model/sync_memory_asset_v1.dart deleted file mode 100644 index 2cfab98afd..0000000000 --- a/mobile/openapi/lib/model/sync_memory_asset_v1.dart +++ /dev/null @@ -1,109 +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 SyncMemoryAssetV1 { - /// Returns a new [SyncMemoryAssetV1] instance. - SyncMemoryAssetV1({ - required this.assetId, - required this.memoryId, - }); - - /// Asset ID - String assetId; - - /// Memory ID - String memoryId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncMemoryAssetV1 && - other.assetId == assetId && - other.memoryId == memoryId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (memoryId.hashCode); - - @override - String toString() => 'SyncMemoryAssetV1[assetId=$assetId, memoryId=$memoryId]'; - - Map toJson() { - final json = {}; - json[r'assetId'] = this.assetId; - json[r'memoryId'] = this.memoryId; - return json; - } - - /// Returns a new [SyncMemoryAssetV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncMemoryAssetV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryAssetV1"); - if (value is Map) { - final json = value.cast(); - - return SyncMemoryAssetV1( - assetId: mapValueOfType(json, r'assetId')!, - memoryId: mapValueOfType(json, r'memoryId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncMemoryAssetV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncMemoryAssetV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncMemoryAssetV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncMemoryAssetV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetId', - 'memoryId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_memory_delete_v1.dart b/mobile/openapi/lib/model/sync_memory_delete_v1.dart deleted file mode 100644 index d5f63ec8fa..0000000000 --- a/mobile/openapi/lib/model/sync_memory_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncMemoryDeleteV1 { - /// Returns a new [SyncMemoryDeleteV1] instance. - SyncMemoryDeleteV1({ - required this.memoryId, - }); - - /// Memory ID - String memoryId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncMemoryDeleteV1 && - other.memoryId == memoryId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (memoryId.hashCode); - - @override - String toString() => 'SyncMemoryDeleteV1[memoryId=$memoryId]'; - - Map toJson() { - final json = {}; - json[r'memoryId'] = this.memoryId; - return json; - } - - /// Returns a new [SyncMemoryDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncMemoryDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncMemoryDeleteV1( - memoryId: mapValueOfType(json, r'memoryId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncMemoryDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncMemoryDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncMemoryDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncMemoryDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'memoryId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_memory_v1.dart b/mobile/openapi/lib/model/sync_memory_v1.dart deleted file mode 100644 index c506738d97..0000000000 --- a/mobile/openapi/lib/model/sync_memory_v1.dart +++ /dev/null @@ -1,215 +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 SyncMemoryV1 { - /// Returns a new [SyncMemoryV1] instance. - SyncMemoryV1({ - required this.createdAt, - required this.data, - required this.deletedAt, - required this.hideAt, - required this.id, - required this.isSaved, - required this.memoryAt, - required this.ownerId, - required this.seenAt, - required this.showAt, - required this.type, - required this.updatedAt, - }); - - /// Created at - DateTime createdAt; - - /// Data - Object data; - - /// Deleted at - DateTime? deletedAt; - - /// Hide at - DateTime? hideAt; - - /// Memory ID - String id; - - /// Is saved - bool isSaved; - - /// Memory at - DateTime memoryAt; - - /// Owner ID - String ownerId; - - /// Seen at - DateTime? seenAt; - - /// Show at - DateTime? showAt; - - /// Memory type - MemoryType type; - - /// Updated at - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncMemoryV1 && - other.createdAt == createdAt && - other.data == data && - other.deletedAt == deletedAt && - other.hideAt == hideAt && - other.id == id && - other.isSaved == isSaved && - other.memoryAt == memoryAt && - other.ownerId == ownerId && - other.seenAt == seenAt && - other.showAt == showAt && - other.type == type && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (createdAt.hashCode) + - (data.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (hideAt == null ? 0 : hideAt!.hashCode) + - (id.hashCode) + - (isSaved.hashCode) + - (memoryAt.hashCode) + - (ownerId.hashCode) + - (seenAt == null ? 0 : seenAt!.hashCode) + - (showAt == null ? 0 : showAt!.hashCode) + - (type.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'SyncMemoryV1[createdAt=$createdAt, data=$data, deletedAt=$deletedAt, hideAt=$hideAt, id=$id, isSaved=$isSaved, memoryAt=$memoryAt, ownerId=$ownerId, seenAt=$seenAt, showAt=$showAt, type=$type, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'data'] = this.data; - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); - } else { - // json[r'deletedAt'] = null; - } - if (this.hideAt != null) { - json[r'hideAt'] = this.hideAt!.toUtc().toIso8601String(); - } else { - // json[r'hideAt'] = null; - } - json[r'id'] = this.id; - json[r'isSaved'] = this.isSaved; - json[r'memoryAt'] = this.memoryAt.toUtc().toIso8601String(); - json[r'ownerId'] = this.ownerId; - if (this.seenAt != null) { - json[r'seenAt'] = this.seenAt!.toUtc().toIso8601String(); - } else { - // json[r'seenAt'] = null; - } - if (this.showAt != null) { - json[r'showAt'] = this.showAt!.toUtc().toIso8601String(); - } else { - // json[r'showAt'] = null; - } - json[r'type'] = this.type; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [SyncMemoryV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncMemoryV1? fromJson(dynamic value) { - upgradeDto(value, "SyncMemoryV1"); - if (value is Map) { - final json = value.cast(); - - return SyncMemoryV1( - createdAt: mapDateTime(json, r'createdAt', r'')!, - data: mapValueOfType(json, r'data')!, - deletedAt: mapDateTime(json, r'deletedAt', r''), - hideAt: mapDateTime(json, r'hideAt', r''), - id: mapValueOfType(json, r'id')!, - isSaved: mapValueOfType(json, r'isSaved')!, - memoryAt: mapDateTime(json, r'memoryAt', r'')!, - ownerId: mapValueOfType(json, r'ownerId')!, - seenAt: mapDateTime(json, r'seenAt', r''), - showAt: mapDateTime(json, r'showAt', r''), - type: MemoryType.fromJson(json[r'type'])!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncMemoryV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncMemoryV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncMemoryV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncMemoryV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'data', - 'deletedAt', - 'hideAt', - 'id', - 'isSaved', - 'memoryAt', - 'ownerId', - 'seenAt', - 'showAt', - 'type', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/sync_partner_delete_v1.dart b/mobile/openapi/lib/model/sync_partner_delete_v1.dart deleted file mode 100644 index 64dfb4eb98..0000000000 --- a/mobile/openapi/lib/model/sync_partner_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncPartnerDeleteV1 { - /// Returns a new [SyncPartnerDeleteV1] instance. - SyncPartnerDeleteV1({ - required this.sharedById, - required this.sharedWithId, - }); - - /// Shared by ID - String sharedById; - - /// Shared with ID - String sharedWithId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncPartnerDeleteV1 && - other.sharedById == sharedById && - other.sharedWithId == sharedWithId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (sharedById.hashCode) + - (sharedWithId.hashCode); - - @override - String toString() => 'SyncPartnerDeleteV1[sharedById=$sharedById, sharedWithId=$sharedWithId]'; - - Map toJson() { - final json = {}; - json[r'sharedById'] = this.sharedById; - json[r'sharedWithId'] = this.sharedWithId; - return json; - } - - /// Returns a new [SyncPartnerDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncPartnerDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPartnerDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncPartnerDeleteV1( - sharedById: mapValueOfType(json, r'sharedById')!, - sharedWithId: mapValueOfType(json, r'sharedWithId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncPartnerDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncPartnerDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncPartnerDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncPartnerDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'sharedById', - 'sharedWithId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_partner_v1.dart b/mobile/openapi/lib/model/sync_partner_v1.dart deleted file mode 100644 index 9f9c3d14c1..0000000000 --- a/mobile/openapi/lib/model/sync_partner_v1.dart +++ /dev/null @@ -1,118 +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 SyncPartnerV1 { - /// Returns a new [SyncPartnerV1] instance. - SyncPartnerV1({ - required this.inTimeline, - required this.sharedById, - required this.sharedWithId, - }); - - /// In timeline - bool inTimeline; - - /// Shared by ID - String sharedById; - - /// Shared with ID - String sharedWithId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncPartnerV1 && - other.inTimeline == inTimeline && - other.sharedById == sharedById && - other.sharedWithId == sharedWithId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (inTimeline.hashCode) + - (sharedById.hashCode) + - (sharedWithId.hashCode); - - @override - String toString() => 'SyncPartnerV1[inTimeline=$inTimeline, sharedById=$sharedById, sharedWithId=$sharedWithId]'; - - Map toJson() { - final json = {}; - json[r'inTimeline'] = this.inTimeline; - json[r'sharedById'] = this.sharedById; - json[r'sharedWithId'] = this.sharedWithId; - return json; - } - - /// Returns a new [SyncPartnerV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncPartnerV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPartnerV1"); - if (value is Map) { - final json = value.cast(); - - return SyncPartnerV1( - inTimeline: mapValueOfType(json, r'inTimeline')!, - sharedById: mapValueOfType(json, r'sharedById')!, - sharedWithId: mapValueOfType(json, r'sharedWithId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncPartnerV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncPartnerV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncPartnerV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncPartnerV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'inTimeline', - 'sharedById', - 'sharedWithId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_person_delete_v1.dart b/mobile/openapi/lib/model/sync_person_delete_v1.dart deleted file mode 100644 index 526bc26187..0000000000 --- a/mobile/openapi/lib/model/sync_person_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncPersonDeleteV1 { - /// Returns a new [SyncPersonDeleteV1] instance. - SyncPersonDeleteV1({ - required this.personId, - }); - - /// Person ID - String personId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncPersonDeleteV1 && - other.personId == personId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (personId.hashCode); - - @override - String toString() => 'SyncPersonDeleteV1[personId=$personId]'; - - Map toJson() { - final json = {}; - json[r'personId'] = this.personId; - return json; - } - - /// Returns a new [SyncPersonDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncPersonDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPersonDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncPersonDeleteV1( - personId: mapValueOfType(json, r'personId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncPersonDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncPersonDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncPersonDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncPersonDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'personId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_person_v1.dart b/mobile/openapi/lib/model/sync_person_v1.dart deleted file mode 100644 index fc2c36aa8c..0000000000 --- a/mobile/openapi/lib/model/sync_person_v1.dart +++ /dev/null @@ -1,193 +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 SyncPersonV1 { - /// Returns a new [SyncPersonV1] instance. - SyncPersonV1({ - required this.birthDate, - required this.color, - required this.createdAt, - required this.faceAssetId, - required this.id, - required this.isFavorite, - required this.isHidden, - required this.name, - required this.ownerId, - required this.updatedAt, - }); - - /// Birth date - DateTime? birthDate; - - /// Color - String? color; - - /// Created at - DateTime createdAt; - - /// Face asset ID - String? faceAssetId; - - /// Person ID - String id; - - /// Is favorite - bool isFavorite; - - /// Is hidden - bool isHidden; - - /// Person name - String name; - - /// Owner ID - String ownerId; - - /// Updated at - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncPersonV1 && - other.birthDate == birthDate && - other.color == color && - other.createdAt == createdAt && - other.faceAssetId == faceAssetId && - other.id == id && - other.isFavorite == isFavorite && - other.isHidden == isHidden && - other.name == name && - other.ownerId == ownerId && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + - (createdAt.hashCode) + - (faceAssetId == null ? 0 : faceAssetId!.hashCode) + - (id.hashCode) + - (isFavorite.hashCode) + - (isHidden.hashCode) + - (name.hashCode) + - (ownerId.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'SyncPersonV1[birthDate=$birthDate, color=$color, createdAt=$createdAt, faceAssetId=$faceAssetId, id=$id, isFavorite=$isFavorite, isHidden=$isHidden, name=$name, ownerId=$ownerId, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = this.birthDate!.toUtc().toIso8601String(); - } else { - // json[r'birthDate'] = null; - } - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.faceAssetId != null) { - json[r'faceAssetId'] = this.faceAssetId; - } else { - // json[r'faceAssetId'] = null; - } - json[r'id'] = this.id; - json[r'isFavorite'] = this.isFavorite; - json[r'isHidden'] = this.isHidden; - json[r'name'] = this.name; - json[r'ownerId'] = this.ownerId; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [SyncPersonV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncPersonV1? fromJson(dynamic value) { - upgradeDto(value, "SyncPersonV1"); - if (value is Map) { - final json = value.cast(); - - return SyncPersonV1( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), - createdAt: mapDateTime(json, r'createdAt', r'')!, - faceAssetId: mapValueOfType(json, r'faceAssetId'), - id: mapValueOfType(json, r'id')!, - isFavorite: mapValueOfType(json, r'isFavorite')!, - isHidden: mapValueOfType(json, r'isHidden')!, - name: mapValueOfType(json, r'name')!, - ownerId: mapValueOfType(json, r'ownerId')!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncPersonV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncPersonV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncPersonV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncPersonV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'birthDate', - 'color', - 'createdAt', - 'faceAssetId', - 'id', - 'isFavorite', - 'isHidden', - 'name', - 'ownerId', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/sync_request_type.dart b/mobile/openapi/lib/model/sync_request_type.dart deleted file mode 100644 index 135af3c7bb..0000000000 --- a/mobile/openapi/lib/model/sync_request_type.dart +++ /dev/null @@ -1,139 +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; - -/// Sync request types -class SyncRequestType { - /// Instantiate a new enum with the provided [value]. - const SyncRequestType._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const albumsV1 = SyncRequestType._(r'AlbumsV1'); - static const albumUsersV1 = SyncRequestType._(r'AlbumUsersV1'); - static const albumToAssetsV1 = SyncRequestType._(r'AlbumToAssetsV1'); - static const albumAssetsV1 = SyncRequestType._(r'AlbumAssetsV1'); - static const albumAssetExifsV1 = SyncRequestType._(r'AlbumAssetExifsV1'); - static const assetsV1 = SyncRequestType._(r'AssetsV1'); - static const assetExifsV1 = SyncRequestType._(r'AssetExifsV1'); - static const assetMetadataV1 = SyncRequestType._(r'AssetMetadataV1'); - static const authUsersV1 = SyncRequestType._(r'AuthUsersV1'); - static const memoriesV1 = SyncRequestType._(r'MemoriesV1'); - static const memoryToAssetsV1 = SyncRequestType._(r'MemoryToAssetsV1'); - static const partnersV1 = SyncRequestType._(r'PartnersV1'); - static const partnerAssetsV1 = SyncRequestType._(r'PartnerAssetsV1'); - static const partnerAssetExifsV1 = SyncRequestType._(r'PartnerAssetExifsV1'); - static const partnerStacksV1 = SyncRequestType._(r'PartnerStacksV1'); - static const stacksV1 = SyncRequestType._(r'StacksV1'); - static const usersV1 = SyncRequestType._(r'UsersV1'); - static const peopleV1 = SyncRequestType._(r'PeopleV1'); - static const assetFacesV1 = SyncRequestType._(r'AssetFacesV1'); - static const userMetadataV1 = SyncRequestType._(r'UserMetadataV1'); - - /// List of all possible values in this [enum][SyncRequestType]. - static const values = [ - albumsV1, - albumUsersV1, - albumToAssetsV1, - albumAssetsV1, - albumAssetExifsV1, - assetsV1, - assetExifsV1, - assetMetadataV1, - authUsersV1, - memoriesV1, - memoryToAssetsV1, - partnersV1, - partnerAssetsV1, - partnerAssetExifsV1, - partnerStacksV1, - stacksV1, - usersV1, - peopleV1, - assetFacesV1, - userMetadataV1, - ]; - - static SyncRequestType? fromJson(dynamic value) => SyncRequestTypeTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncRequestType.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [SyncRequestType] to String, -/// and [decode] dynamic data back to [SyncRequestType]. -class SyncRequestTypeTypeTransformer { - factory SyncRequestTypeTypeTransformer() => _instance ??= const SyncRequestTypeTypeTransformer._(); - - const SyncRequestTypeTypeTransformer._(); - - String encode(SyncRequestType data) => data.value; - - /// Decodes a [dynamic value][data] to a SyncRequestType. - /// - /// 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. - SyncRequestType? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'AlbumsV1': return SyncRequestType.albumsV1; - case r'AlbumUsersV1': return SyncRequestType.albumUsersV1; - case r'AlbumToAssetsV1': return SyncRequestType.albumToAssetsV1; - case r'AlbumAssetsV1': return SyncRequestType.albumAssetsV1; - case r'AlbumAssetExifsV1': return SyncRequestType.albumAssetExifsV1; - case r'AssetsV1': return SyncRequestType.assetsV1; - case r'AssetExifsV1': return SyncRequestType.assetExifsV1; - case r'AssetMetadataV1': return SyncRequestType.assetMetadataV1; - case r'AuthUsersV1': return SyncRequestType.authUsersV1; - case r'MemoriesV1': return SyncRequestType.memoriesV1; - case r'MemoryToAssetsV1': return SyncRequestType.memoryToAssetsV1; - case r'PartnersV1': return SyncRequestType.partnersV1; - case r'PartnerAssetsV1': return SyncRequestType.partnerAssetsV1; - case r'PartnerAssetExifsV1': return SyncRequestType.partnerAssetExifsV1; - case r'PartnerStacksV1': return SyncRequestType.partnerStacksV1; - case r'StacksV1': return SyncRequestType.stacksV1; - case r'UsersV1': return SyncRequestType.usersV1; - case r'PeopleV1': return SyncRequestType.peopleV1; - case r'AssetFacesV1': return SyncRequestType.assetFacesV1; - case r'UserMetadataV1': return SyncRequestType.userMetadataV1; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [SyncRequestTypeTypeTransformer] instance. - static SyncRequestTypeTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/sync_stack_delete_v1.dart b/mobile/openapi/lib/model/sync_stack_delete_v1.dart deleted file mode 100644 index 2a7398291a..0000000000 --- a/mobile/openapi/lib/model/sync_stack_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncStackDeleteV1 { - /// Returns a new [SyncStackDeleteV1] instance. - SyncStackDeleteV1({ - required this.stackId, - }); - - /// Stack ID - String stackId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncStackDeleteV1 && - other.stackId == stackId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (stackId.hashCode); - - @override - String toString() => 'SyncStackDeleteV1[stackId=$stackId]'; - - Map toJson() { - final json = {}; - json[r'stackId'] = this.stackId; - return json; - } - - /// Returns a new [SyncStackDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncStackDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncStackDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncStackDeleteV1( - stackId: mapValueOfType(json, r'stackId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncStackDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncStackDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncStackDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncStackDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'stackId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_stack_v1.dart b/mobile/openapi/lib/model/sync_stack_v1.dart deleted file mode 100644 index e4487ccfaf..0000000000 --- a/mobile/openapi/lib/model/sync_stack_v1.dart +++ /dev/null @@ -1,136 +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 SyncStackV1 { - /// Returns a new [SyncStackV1] instance. - SyncStackV1({ - required this.createdAt, - required this.id, - required this.ownerId, - required this.primaryAssetId, - required this.updatedAt, - }); - - /// Created at - DateTime createdAt; - - /// Stack ID - String id; - - /// Owner ID - String ownerId; - - /// Primary asset ID - String primaryAssetId; - - /// Updated at - DateTime updatedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncStackV1 && - other.createdAt == createdAt && - other.id == id && - other.ownerId == ownerId && - other.primaryAssetId == primaryAssetId && - other.updatedAt == updatedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (createdAt.hashCode) + - (id.hashCode) + - (ownerId.hashCode) + - (primaryAssetId.hashCode) + - (updatedAt.hashCode); - - @override - String toString() => 'SyncStackV1[createdAt=$createdAt, id=$id, ownerId=$ownerId, primaryAssetId=$primaryAssetId, updatedAt=$updatedAt]'; - - Map toJson() { - final json = {}; - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'id'] = this.id; - json[r'ownerId'] = this.ownerId; - json[r'primaryAssetId'] = this.primaryAssetId; - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [SyncStackV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncStackV1? fromJson(dynamic value) { - upgradeDto(value, "SyncStackV1"); - if (value is Map) { - final json = value.cast(); - - return SyncStackV1( - createdAt: mapDateTime(json, r'createdAt', r'')!, - id: mapValueOfType(json, r'id')!, - ownerId: mapValueOfType(json, r'ownerId')!, - primaryAssetId: mapValueOfType(json, r'primaryAssetId')!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncStackV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncStackV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncStackV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncStackV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'id', - 'ownerId', - 'primaryAssetId', - 'updatedAt', - }; -} - diff --git a/mobile/openapi/lib/model/sync_stream_dto.dart b/mobile/openapi/lib/model/sync_stream_dto.dart deleted file mode 100644 index 932477cb15..0000000000 --- a/mobile/openapi/lib/model/sync_stream_dto.dart +++ /dev/null @@ -1,118 +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 SyncStreamDto { - /// Returns a new [SyncStreamDto] instance. - SyncStreamDto({ - this.reset, - this.types = const [], - }); - - /// Reset sync state - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? reset; - - /// Sync request types - List types; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncStreamDto && - other.reset == reset && - _deepEquality.equals(other.types, types); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (reset == null ? 0 : reset!.hashCode) + - (types.hashCode); - - @override - String toString() => 'SyncStreamDto[reset=$reset, types=$types]'; - - Map toJson() { - final json = {}; - if (this.reset != null) { - json[r'reset'] = this.reset; - } else { - // json[r'reset'] = null; - } - json[r'types'] = this.types; - return json; - } - - /// Returns a new [SyncStreamDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncStreamDto? fromJson(dynamic value) { - upgradeDto(value, "SyncStreamDto"); - if (value is Map) { - final json = value.cast(); - - return SyncStreamDto( - reset: mapValueOfType(json, r'reset'), - types: SyncRequestType.listFromJson(json[r'types']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncStreamDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncStreamDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncStreamDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncStreamDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'types', - }; -} - diff --git a/mobile/openapi/lib/model/sync_user_delete_v1.dart b/mobile/openapi/lib/model/sync_user_delete_v1.dart deleted file mode 100644 index bbbdc147dd..0000000000 --- a/mobile/openapi/lib/model/sync_user_delete_v1.dart +++ /dev/null @@ -1,100 +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 SyncUserDeleteV1 { - /// Returns a new [SyncUserDeleteV1] instance. - SyncUserDeleteV1({ - required this.userId, - }); - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncUserDeleteV1 && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (userId.hashCode); - - @override - String toString() => 'SyncUserDeleteV1[userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [SyncUserDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncUserDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncUserDeleteV1( - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncUserDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncUserDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncUserDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncUserDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart b/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart deleted file mode 100644 index 61340a8f82..0000000000 --- a/mobile/openapi/lib/model/sync_user_metadata_delete_v1.dart +++ /dev/null @@ -1,109 +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 SyncUserMetadataDeleteV1 { - /// Returns a new [SyncUserMetadataDeleteV1] instance. - SyncUserMetadataDeleteV1({ - required this.key, - required this.userId, - }); - - /// User metadata key - UserMetadataKey key; - - /// User ID - String userId; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncUserMetadataDeleteV1 && - other.key == key && - other.userId == userId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (key.hashCode) + - (userId.hashCode); - - @override - String toString() => 'SyncUserMetadataDeleteV1[key=$key, userId=$userId]'; - - Map toJson() { - final json = {}; - json[r'key'] = this.key; - json[r'userId'] = this.userId; - return json; - } - - /// Returns a new [SyncUserMetadataDeleteV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncUserMetadataDeleteV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserMetadataDeleteV1"); - if (value is Map) { - final json = value.cast(); - - return SyncUserMetadataDeleteV1( - key: UserMetadataKey.fromJson(json[r'key'])!, - userId: mapValueOfType(json, r'userId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncUserMetadataDeleteV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncUserMetadataDeleteV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncUserMetadataDeleteV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncUserMetadataDeleteV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'key', - 'userId', - }; -} - diff --git a/mobile/openapi/lib/model/sync_user_metadata_v1.dart b/mobile/openapi/lib/model/sync_user_metadata_v1.dart deleted file mode 100644 index 23803d0be4..0000000000 --- a/mobile/openapi/lib/model/sync_user_metadata_v1.dart +++ /dev/null @@ -1,118 +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 SyncUserMetadataV1 { - /// Returns a new [SyncUserMetadataV1] instance. - SyncUserMetadataV1({ - required this.key, - required this.userId, - required this.value, - }); - - /// User metadata key - UserMetadataKey key; - - /// User ID - String userId; - - /// User metadata value - Object value; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncUserMetadataV1 && - other.key == key && - other.userId == userId && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (key.hashCode) + - (userId.hashCode) + - (value.hashCode); - - @override - String toString() => 'SyncUserMetadataV1[key=$key, userId=$userId, value=$value]'; - - Map toJson() { - final json = {}; - json[r'key'] = this.key; - json[r'userId'] = this.userId; - json[r'value'] = this.value; - return json; - } - - /// Returns a new [SyncUserMetadataV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncUserMetadataV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserMetadataV1"); - if (value is Map) { - final json = value.cast(); - - return SyncUserMetadataV1( - key: UserMetadataKey.fromJson(json[r'key'])!, - userId: mapValueOfType(json, r'userId')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncUserMetadataV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncUserMetadataV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncUserMetadataV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncUserMetadataV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'key', - 'userId', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/sync_user_v1.dart b/mobile/openapi/lib/model/sync_user_v1.dart deleted file mode 100644 index 6d425130a3..0000000000 --- a/mobile/openapi/lib/model/sync_user_v1.dart +++ /dev/null @@ -1,162 +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 SyncUserV1 { - /// Returns a new [SyncUserV1] instance. - SyncUserV1({ - required this.avatarColor, - required this.deletedAt, - required this.email, - required this.hasProfileImage, - required this.id, - required this.name, - required this.profileChangedAt, - }); - - /// User avatar color - UserAvatarColor? avatarColor; - - /// User deleted at - DateTime? deletedAt; - - /// User email - String email; - - /// User has profile image - bool hasProfileImage; - - /// User ID - String id; - - /// User name - String name; - - /// User profile changed at - DateTime profileChangedAt; - - @override - bool operator ==(Object other) => identical(this, other) || other is SyncUserV1 && - other.avatarColor == avatarColor && - other.deletedAt == deletedAt && - other.email == email && - other.hasProfileImage == hasProfileImage && - other.id == id && - other.name == name && - other.profileChangedAt == profileChangedAt; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (email.hashCode) + - (hasProfileImage.hashCode) + - (id.hashCode) + - (name.hashCode) + - (profileChangedAt.hashCode); - - @override - String toString() => 'SyncUserV1[avatarColor=$avatarColor, deletedAt=$deletedAt, email=$email, hasProfileImage=$hasProfileImage, id=$id, name=$name, profileChangedAt=$profileChangedAt]'; - - Map toJson() { - final json = {}; - if (this.avatarColor != null) { - json[r'avatarColor'] = this.avatarColor; - } else { - // json[r'avatarColor'] = null; - } - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); - } else { - // json[r'deletedAt'] = null; - } - json[r'email'] = this.email; - json[r'hasProfileImage'] = this.hasProfileImage; - json[r'id'] = this.id; - json[r'name'] = this.name; - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - return json; - } - - /// Returns a new [SyncUserV1] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SyncUserV1? fromJson(dynamic value) { - upgradeDto(value, "SyncUserV1"); - if (value is Map) { - final json = value.cast(); - - return SyncUserV1( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), - deletedAt: mapDateTime(json, r'deletedAt', r''), - email: mapValueOfType(json, r'email')!, - hasProfileImage: mapValueOfType(json, r'hasProfileImage')!, - id: mapValueOfType(json, r'id')!, - name: mapValueOfType(json, r'name')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SyncUserV1.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SyncUserV1.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SyncUserV1-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SyncUserV1.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'avatarColor', - 'deletedAt', - 'email', - 'hasProfileImage', - 'id', - 'name', - 'profileChangedAt', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_backups_dto.dart b/mobile/openapi/lib/model/system_config_backups_dto.dart deleted file mode 100644 index 82cd6e59eb..0000000000 --- a/mobile/openapi/lib/model/system_config_backups_dto.dart +++ /dev/null @@ -1,99 +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 SystemConfigBackupsDto { - /// Returns a new [SystemConfigBackupsDto] instance. - SystemConfigBackupsDto({ - required this.database, - }); - - DatabaseBackupConfig database; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigBackupsDto && - other.database == database; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (database.hashCode); - - @override - String toString() => 'SystemConfigBackupsDto[database=$database]'; - - Map toJson() { - final json = {}; - json[r'database'] = this.database; - return json; - } - - /// Returns a new [SystemConfigBackupsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigBackupsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigBackupsDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigBackupsDto( - database: DatabaseBackupConfig.fromJson(json[r'database'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigBackupsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigBackupsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigBackupsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigBackupsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'database', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_dto.dart b/mobile/openapi/lib/model/system_config_dto.dart deleted file mode 100644 index 38dbb30f0c..0000000000 --- a/mobile/openapi/lib/model/system_config_dto.dart +++ /dev/null @@ -1,259 +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 SystemConfigDto { - /// Returns a new [SystemConfigDto] instance. - SystemConfigDto({ - required this.backup, - required this.ffmpeg, - required this.image, - required this.job, - required this.library_, - required this.logging, - required this.machineLearning, - required this.map, - required this.metadata, - required this.newVersionCheck, - required this.nightlyTasks, - required this.notifications, - required this.oauth, - required this.passwordLogin, - required this.reverseGeocoding, - required this.server, - required this.storageTemplate, - required this.templates, - required this.theme, - required this.trash, - required this.user, - }); - - SystemConfigBackupsDto backup; - - SystemConfigFFmpegDto ffmpeg; - - SystemConfigImageDto image; - - SystemConfigJobDto job; - - SystemConfigLibraryDto library_; - - SystemConfigLoggingDto logging; - - SystemConfigMachineLearningDto machineLearning; - - SystemConfigMapDto map; - - SystemConfigMetadataDto metadata; - - SystemConfigNewVersionCheckDto newVersionCheck; - - SystemConfigNightlyTasksDto nightlyTasks; - - SystemConfigNotificationsDto notifications; - - SystemConfigOAuthDto oauth; - - SystemConfigPasswordLoginDto passwordLogin; - - SystemConfigReverseGeocodingDto reverseGeocoding; - - SystemConfigServerDto server; - - SystemConfigStorageTemplateDto storageTemplate; - - SystemConfigTemplatesDto templates; - - SystemConfigThemeDto theme; - - SystemConfigTrashDto trash; - - SystemConfigUserDto user; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto && - other.backup == backup && - other.ffmpeg == ffmpeg && - other.image == image && - other.job == job && - other.library_ == library_ && - other.logging == logging && - other.machineLearning == machineLearning && - other.map == map && - other.metadata == metadata && - other.newVersionCheck == newVersionCheck && - other.nightlyTasks == nightlyTasks && - other.notifications == notifications && - other.oauth == oauth && - other.passwordLogin == passwordLogin && - other.reverseGeocoding == reverseGeocoding && - other.server == server && - other.storageTemplate == storageTemplate && - other.templates == templates && - other.theme == theme && - other.trash == trash && - other.user == user; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (backup.hashCode) + - (ffmpeg.hashCode) + - (image.hashCode) + - (job.hashCode) + - (library_.hashCode) + - (logging.hashCode) + - (machineLearning.hashCode) + - (map.hashCode) + - (metadata.hashCode) + - (newVersionCheck.hashCode) + - (nightlyTasks.hashCode) + - (notifications.hashCode) + - (oauth.hashCode) + - (passwordLogin.hashCode) + - (reverseGeocoding.hashCode) + - (server.hashCode) + - (storageTemplate.hashCode) + - (templates.hashCode) + - (theme.hashCode) + - (trash.hashCode) + - (user.hashCode); - - @override - String toString() => 'SystemConfigDto[backup=$backup, ffmpeg=$ffmpeg, image=$image, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, metadata=$metadata, newVersionCheck=$newVersionCheck, nightlyTasks=$nightlyTasks, notifications=$notifications, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, templates=$templates, theme=$theme, trash=$trash, user=$user]'; - - Map toJson() { - final json = {}; - json[r'backup'] = this.backup; - json[r'ffmpeg'] = this.ffmpeg; - json[r'image'] = this.image; - json[r'job'] = this.job; - json[r'library'] = this.library_; - json[r'logging'] = this.logging; - json[r'machineLearning'] = this.machineLearning; - json[r'map'] = this.map; - json[r'metadata'] = this.metadata; - json[r'newVersionCheck'] = this.newVersionCheck; - json[r'nightlyTasks'] = this.nightlyTasks; - json[r'notifications'] = this.notifications; - json[r'oauth'] = this.oauth; - json[r'passwordLogin'] = this.passwordLogin; - json[r'reverseGeocoding'] = this.reverseGeocoding; - json[r'server'] = this.server; - json[r'storageTemplate'] = this.storageTemplate; - json[r'templates'] = this.templates; - json[r'theme'] = this.theme; - json[r'trash'] = this.trash; - json[r'user'] = this.user; - return json; - } - - /// Returns a new [SystemConfigDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigDto( - backup: SystemConfigBackupsDto.fromJson(json[r'backup'])!, - ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!, - image: SystemConfigImageDto.fromJson(json[r'image'])!, - job: SystemConfigJobDto.fromJson(json[r'job'])!, - library_: SystemConfigLibraryDto.fromJson(json[r'library'])!, - logging: SystemConfigLoggingDto.fromJson(json[r'logging'])!, - machineLearning: SystemConfigMachineLearningDto.fromJson(json[r'machineLearning'])!, - map: SystemConfigMapDto.fromJson(json[r'map'])!, - metadata: SystemConfigMetadataDto.fromJson(json[r'metadata'])!, - newVersionCheck: SystemConfigNewVersionCheckDto.fromJson(json[r'newVersionCheck'])!, - nightlyTasks: SystemConfigNightlyTasksDto.fromJson(json[r'nightlyTasks'])!, - notifications: SystemConfigNotificationsDto.fromJson(json[r'notifications'])!, - oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!, - passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!, - reverseGeocoding: SystemConfigReverseGeocodingDto.fromJson(json[r'reverseGeocoding'])!, - server: SystemConfigServerDto.fromJson(json[r'server'])!, - storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!, - templates: SystemConfigTemplatesDto.fromJson(json[r'templates'])!, - theme: SystemConfigThemeDto.fromJson(json[r'theme'])!, - trash: SystemConfigTrashDto.fromJson(json[r'trash'])!, - user: SystemConfigUserDto.fromJson(json[r'user'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'backup', - 'ffmpeg', - 'image', - 'job', - 'library', - 'logging', - 'machineLearning', - 'map', - 'metadata', - 'newVersionCheck', - 'nightlyTasks', - 'notifications', - 'oauth', - 'passwordLogin', - 'reverseGeocoding', - 'server', - 'storageTemplate', - 'templates', - 'theme', - 'trash', - 'user', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart b/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart deleted file mode 100644 index 6c7acbd218..0000000000 --- a/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart +++ /dev/null @@ -1,293 +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 SystemConfigFFmpegDto { - /// Returns a new [SystemConfigFFmpegDto] instance. - SystemConfigFFmpegDto({ - required this.accel, - required this.accelDecode, - this.acceptedAudioCodecs = const [], - this.acceptedContainers = const [], - this.acceptedVideoCodecs = const [], - required this.bframes, - required this.cqMode, - required this.crf, - required this.gopSize, - required this.maxBitrate, - required this.preferredHwDevice, - required this.preset, - required this.refs, - required this.targetAudioCodec, - required this.targetResolution, - required this.targetVideoCodec, - required this.temporalAQ, - required this.threads, - required this.tonemap, - required this.transcode, - required this.twoPass, - }); - - /// Transcode hardware acceleration - TranscodeHWAccel accel; - - /// Accelerated decode - bool accelDecode; - - /// Accepted audio codecs - List acceptedAudioCodecs; - - /// Accepted containers - List acceptedContainers; - - /// Accepted video codecs - List acceptedVideoCodecs; - - /// B-frames - /// - /// Minimum value: -1 - /// Maximum value: 16 - int bframes; - - /// CQ mode - CQMode cqMode; - - /// CRF - /// - /// Minimum value: 0 - /// Maximum value: 51 - int crf; - - /// GOP size - /// - /// Minimum value: 0 - int gopSize; - - /// Max bitrate - String maxBitrate; - - /// Preferred hardware device - String preferredHwDevice; - - /// Preset - String preset; - - /// References - /// - /// Minimum value: 0 - /// Maximum value: 6 - int refs; - - /// Target audio codec - AudioCodec targetAudioCodec; - - /// Target resolution - String targetResolution; - - /// Target video codec - VideoCodec targetVideoCodec; - - /// Temporal AQ - bool temporalAQ; - - /// Threads - /// - /// Minimum value: 0 - int threads; - - /// Tone mapping - ToneMapping tonemap; - - /// Transcode policy - TranscodePolicy transcode; - - /// Two pass - bool twoPass; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigFFmpegDto && - other.accel == accel && - other.accelDecode == accelDecode && - _deepEquality.equals(other.acceptedAudioCodecs, acceptedAudioCodecs) && - _deepEquality.equals(other.acceptedContainers, acceptedContainers) && - _deepEquality.equals(other.acceptedVideoCodecs, acceptedVideoCodecs) && - other.bframes == bframes && - other.cqMode == cqMode && - other.crf == crf && - other.gopSize == gopSize && - other.maxBitrate == maxBitrate && - other.preferredHwDevice == preferredHwDevice && - other.preset == preset && - other.refs == refs && - other.targetAudioCodec == targetAudioCodec && - other.targetResolution == targetResolution && - other.targetVideoCodec == targetVideoCodec && - other.temporalAQ == temporalAQ && - other.threads == threads && - other.tonemap == tonemap && - other.transcode == transcode && - other.twoPass == twoPass; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (accel.hashCode) + - (accelDecode.hashCode) + - (acceptedAudioCodecs.hashCode) + - (acceptedContainers.hashCode) + - (acceptedVideoCodecs.hashCode) + - (bframes.hashCode) + - (cqMode.hashCode) + - (crf.hashCode) + - (gopSize.hashCode) + - (maxBitrate.hashCode) + - (preferredHwDevice.hashCode) + - (preset.hashCode) + - (refs.hashCode) + - (targetAudioCodec.hashCode) + - (targetResolution.hashCode) + - (targetVideoCodec.hashCode) + - (temporalAQ.hashCode) + - (threads.hashCode) + - (tonemap.hashCode) + - (transcode.hashCode) + - (twoPass.hashCode); - - @override - String toString() => 'SystemConfigFFmpegDto[accel=$accel, accelDecode=$accelDecode, acceptedAudioCodecs=$acceptedAudioCodecs, acceptedContainers=$acceptedContainers, acceptedVideoCodecs=$acceptedVideoCodecs, bframes=$bframes, cqMode=$cqMode, crf=$crf, gopSize=$gopSize, maxBitrate=$maxBitrate, preferredHwDevice=$preferredHwDevice, preset=$preset, refs=$refs, targetAudioCodec=$targetAudioCodec, targetResolution=$targetResolution, targetVideoCodec=$targetVideoCodec, temporalAQ=$temporalAQ, threads=$threads, tonemap=$tonemap, transcode=$transcode, twoPass=$twoPass]'; - - Map toJson() { - final json = {}; - json[r'accel'] = this.accel; - json[r'accelDecode'] = this.accelDecode; - json[r'acceptedAudioCodecs'] = this.acceptedAudioCodecs; - json[r'acceptedContainers'] = this.acceptedContainers; - json[r'acceptedVideoCodecs'] = this.acceptedVideoCodecs; - json[r'bframes'] = this.bframes; - json[r'cqMode'] = this.cqMode; - json[r'crf'] = this.crf; - json[r'gopSize'] = this.gopSize; - json[r'maxBitrate'] = this.maxBitrate; - json[r'preferredHwDevice'] = this.preferredHwDevice; - json[r'preset'] = this.preset; - json[r'refs'] = this.refs; - json[r'targetAudioCodec'] = this.targetAudioCodec; - json[r'targetResolution'] = this.targetResolution; - json[r'targetVideoCodec'] = this.targetVideoCodec; - json[r'temporalAQ'] = this.temporalAQ; - json[r'threads'] = this.threads; - json[r'tonemap'] = this.tonemap; - json[r'transcode'] = this.transcode; - json[r'twoPass'] = this.twoPass; - return json; - } - - /// Returns a new [SystemConfigFFmpegDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigFFmpegDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigFFmpegDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigFFmpegDto( - accel: TranscodeHWAccel.fromJson(json[r'accel'])!, - accelDecode: mapValueOfType(json, r'accelDecode')!, - acceptedAudioCodecs: AudioCodec.listFromJson(json[r'acceptedAudioCodecs']), - acceptedContainers: VideoContainer.listFromJson(json[r'acceptedContainers']), - acceptedVideoCodecs: VideoCodec.listFromJson(json[r'acceptedVideoCodecs']), - bframes: mapValueOfType(json, r'bframes')!, - cqMode: CQMode.fromJson(json[r'cqMode'])!, - crf: mapValueOfType(json, r'crf')!, - gopSize: mapValueOfType(json, r'gopSize')!, - maxBitrate: mapValueOfType(json, r'maxBitrate')!, - preferredHwDevice: mapValueOfType(json, r'preferredHwDevice')!, - preset: mapValueOfType(json, r'preset')!, - refs: mapValueOfType(json, r'refs')!, - targetAudioCodec: AudioCodec.fromJson(json[r'targetAudioCodec'])!, - targetResolution: mapValueOfType(json, r'targetResolution')!, - targetVideoCodec: VideoCodec.fromJson(json[r'targetVideoCodec'])!, - temporalAQ: mapValueOfType(json, r'temporalAQ')!, - threads: mapValueOfType(json, r'threads')!, - tonemap: ToneMapping.fromJson(json[r'tonemap'])!, - transcode: TranscodePolicy.fromJson(json[r'transcode'])!, - twoPass: mapValueOfType(json, r'twoPass')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigFFmpegDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigFFmpegDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigFFmpegDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigFFmpegDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'accel', - 'accelDecode', - 'acceptedAudioCodecs', - 'acceptedContainers', - 'acceptedVideoCodecs', - 'bframes', - 'cqMode', - 'crf', - 'gopSize', - 'maxBitrate', - 'preferredHwDevice', - 'preset', - 'refs', - 'targetAudioCodec', - 'targetResolution', - 'targetVideoCodec', - 'temporalAQ', - 'threads', - 'tonemap', - 'transcode', - 'twoPass', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_faces_dto.dart b/mobile/openapi/lib/model/system_config_faces_dto.dart deleted file mode 100644 index f57303c310..0000000000 --- a/mobile/openapi/lib/model/system_config_faces_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigFacesDto { - /// Returns a new [SystemConfigFacesDto] instance. - SystemConfigFacesDto({ - required this.import_, - }); - - /// Import - bool import_; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigFacesDto && - other.import_ == import_; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (import_.hashCode); - - @override - String toString() => 'SystemConfigFacesDto[import_=$import_]'; - - Map toJson() { - final json = {}; - json[r'import'] = this.import_; - return json; - } - - /// Returns a new [SystemConfigFacesDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigFacesDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigFacesDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigFacesDto( - import_: mapValueOfType(json, r'import')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigFacesDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigFacesDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigFacesDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigFacesDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'import', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart b/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart deleted file mode 100644 index b5640f82c8..0000000000 --- a/mobile/openapi/lib/model/system_config_generated_fullsize_image_dto.dart +++ /dev/null @@ -1,129 +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 SystemConfigGeneratedFullsizeImageDto { - /// Returns a new [SystemConfigGeneratedFullsizeImageDto] instance. - SystemConfigGeneratedFullsizeImageDto({ - required this.enabled, - required this.format, - this.progressive = false, - required this.quality, - }); - - /// Enabled - bool enabled; - - /// Image format - ImageFormat format; - - /// Progressive - bool progressive; - - /// Quality - /// - /// Minimum value: 1 - /// Maximum value: 100 - int quality; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigGeneratedFullsizeImageDto && - other.enabled == enabled && - other.format == format && - other.progressive == progressive && - other.quality == quality; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (format.hashCode) + - (progressive.hashCode) + - (quality.hashCode); - - @override - String toString() => 'SystemConfigGeneratedFullsizeImageDto[enabled=$enabled, format=$format, progressive=$progressive, quality=$quality]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'format'] = this.format; - json[r'progressive'] = this.progressive; - json[r'quality'] = this.quality; - return json; - } - - /// Returns a new [SystemConfigGeneratedFullsizeImageDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigGeneratedFullsizeImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigGeneratedFullsizeImageDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigGeneratedFullsizeImageDto( - enabled: mapValueOfType(json, r'enabled')!, - format: ImageFormat.fromJson(json[r'format'])!, - progressive: mapValueOfType(json, r'progressive') ?? false, - quality: mapValueOfType(json, r'quality')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigGeneratedFullsizeImageDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigGeneratedFullsizeImageDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigGeneratedFullsizeImageDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigGeneratedFullsizeImageDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'format', - 'quality', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_generated_image_dto.dart b/mobile/openapi/lib/model/system_config_generated_image_dto.dart deleted file mode 100644 index 3e8fed2c68..0000000000 --- a/mobile/openapi/lib/model/system_config_generated_image_dto.dart +++ /dev/null @@ -1,130 +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 SystemConfigGeneratedImageDto { - /// Returns a new [SystemConfigGeneratedImageDto] instance. - SystemConfigGeneratedImageDto({ - required this.format, - this.progressive = false, - required this.quality, - required this.size, - }); - - /// Image format - ImageFormat format; - - bool progressive; - - /// Quality - /// - /// Minimum value: 1 - /// Maximum value: 100 - int quality; - - /// Size - /// - /// Minimum value: 1 - int size; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigGeneratedImageDto && - other.format == format && - other.progressive == progressive && - other.quality == quality && - other.size == size; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (format.hashCode) + - (progressive.hashCode) + - (quality.hashCode) + - (size.hashCode); - - @override - String toString() => 'SystemConfigGeneratedImageDto[format=$format, progressive=$progressive, quality=$quality, size=$size]'; - - Map toJson() { - final json = {}; - json[r'format'] = this.format; - json[r'progressive'] = this.progressive; - json[r'quality'] = this.quality; - json[r'size'] = this.size; - return json; - } - - /// Returns a new [SystemConfigGeneratedImageDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigGeneratedImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigGeneratedImageDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigGeneratedImageDto( - format: ImageFormat.fromJson(json[r'format'])!, - progressive: mapValueOfType(json, r'progressive') ?? false, - quality: mapValueOfType(json, r'quality')!, - size: mapValueOfType(json, r'size')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigGeneratedImageDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigGeneratedImageDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigGeneratedImageDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigGeneratedImageDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'format', - 'quality', - 'size', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_image_dto.dart b/mobile/openapi/lib/model/system_config_image_dto.dart deleted file mode 100644 index 217a666a67..0000000000 --- a/mobile/openapi/lib/model/system_config_image_dto.dart +++ /dev/null @@ -1,133 +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 SystemConfigImageDto { - /// Returns a new [SystemConfigImageDto] instance. - SystemConfigImageDto({ - required this.colorspace, - required this.extractEmbedded, - required this.fullsize, - required this.preview, - required this.thumbnail, - }); - - /// Colorspace - Colorspace colorspace; - - /// Extract embedded - bool extractEmbedded; - - SystemConfigGeneratedFullsizeImageDto fullsize; - - SystemConfigGeneratedImageDto preview; - - SystemConfigGeneratedImageDto thumbnail; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigImageDto && - other.colorspace == colorspace && - other.extractEmbedded == extractEmbedded && - other.fullsize == fullsize && - other.preview == preview && - other.thumbnail == thumbnail; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (colorspace.hashCode) + - (extractEmbedded.hashCode) + - (fullsize.hashCode) + - (preview.hashCode) + - (thumbnail.hashCode); - - @override - String toString() => 'SystemConfigImageDto[colorspace=$colorspace, extractEmbedded=$extractEmbedded, fullsize=$fullsize, preview=$preview, thumbnail=$thumbnail]'; - - Map toJson() { - final json = {}; - json[r'colorspace'] = this.colorspace; - json[r'extractEmbedded'] = this.extractEmbedded; - json[r'fullsize'] = this.fullsize; - json[r'preview'] = this.preview; - json[r'thumbnail'] = this.thumbnail; - return json; - } - - /// Returns a new [SystemConfigImageDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigImageDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigImageDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigImageDto( - colorspace: Colorspace.fromJson(json[r'colorspace'])!, - extractEmbedded: mapValueOfType(json, r'extractEmbedded')!, - fullsize: SystemConfigGeneratedFullsizeImageDto.fromJson(json[r'fullsize'])!, - preview: SystemConfigGeneratedImageDto.fromJson(json[r'preview'])!, - thumbnail: SystemConfigGeneratedImageDto.fromJson(json[r'thumbnail'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigImageDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigImageDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigImageDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigImageDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'colorspace', - 'extractEmbedded', - 'fullsize', - 'preview', - 'thumbnail', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_job_dto.dart b/mobile/openapi/lib/model/system_config_job_dto.dart deleted file mode 100644 index d54db6809f..0000000000 --- a/mobile/openapi/lib/model/system_config_job_dto.dart +++ /dev/null @@ -1,203 +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 SystemConfigJobDto { - /// Returns a new [SystemConfigJobDto] instance. - SystemConfigJobDto({ - required this.backgroundTask, - required this.editor, - required this.faceDetection, - required this.library_, - required this.metadataExtraction, - required this.migration, - required this.notifications, - required this.ocr, - required this.search, - required this.sidecar, - required this.smartSearch, - required this.thumbnailGeneration, - required this.videoConversion, - required this.workflow, - }); - - JobSettingsDto backgroundTask; - - JobSettingsDto editor; - - JobSettingsDto faceDetection; - - JobSettingsDto library_; - - JobSettingsDto metadataExtraction; - - JobSettingsDto migration; - - JobSettingsDto notifications; - - JobSettingsDto ocr; - - JobSettingsDto search; - - JobSettingsDto sidecar; - - JobSettingsDto smartSearch; - - JobSettingsDto thumbnailGeneration; - - JobSettingsDto videoConversion; - - JobSettingsDto workflow; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigJobDto && - other.backgroundTask == backgroundTask && - other.editor == editor && - other.faceDetection == faceDetection && - other.library_ == library_ && - other.metadataExtraction == metadataExtraction && - other.migration == migration && - other.notifications == notifications && - other.ocr == ocr && - other.search == search && - other.sidecar == sidecar && - other.smartSearch == smartSearch && - other.thumbnailGeneration == thumbnailGeneration && - other.videoConversion == videoConversion && - other.workflow == workflow; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (backgroundTask.hashCode) + - (editor.hashCode) + - (faceDetection.hashCode) + - (library_.hashCode) + - (metadataExtraction.hashCode) + - (migration.hashCode) + - (notifications.hashCode) + - (ocr.hashCode) + - (search.hashCode) + - (sidecar.hashCode) + - (smartSearch.hashCode) + - (thumbnailGeneration.hashCode) + - (videoConversion.hashCode) + - (workflow.hashCode); - - @override - String toString() => 'SystemConfigJobDto[backgroundTask=$backgroundTask, editor=$editor, faceDetection=$faceDetection, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]'; - - Map toJson() { - final json = {}; - json[r'backgroundTask'] = this.backgroundTask; - json[r'editor'] = this.editor; - json[r'faceDetection'] = this.faceDetection; - json[r'library'] = this.library_; - json[r'metadataExtraction'] = this.metadataExtraction; - json[r'migration'] = this.migration; - json[r'notifications'] = this.notifications; - json[r'ocr'] = this.ocr; - json[r'search'] = this.search; - json[r'sidecar'] = this.sidecar; - json[r'smartSearch'] = this.smartSearch; - json[r'thumbnailGeneration'] = this.thumbnailGeneration; - json[r'videoConversion'] = this.videoConversion; - json[r'workflow'] = this.workflow; - return json; - } - - /// Returns a new [SystemConfigJobDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigJobDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigJobDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigJobDto( - backgroundTask: JobSettingsDto.fromJson(json[r'backgroundTask'])!, - editor: JobSettingsDto.fromJson(json[r'editor'])!, - faceDetection: JobSettingsDto.fromJson(json[r'faceDetection'])!, - library_: JobSettingsDto.fromJson(json[r'library'])!, - metadataExtraction: JobSettingsDto.fromJson(json[r'metadataExtraction'])!, - migration: JobSettingsDto.fromJson(json[r'migration'])!, - notifications: JobSettingsDto.fromJson(json[r'notifications'])!, - ocr: JobSettingsDto.fromJson(json[r'ocr'])!, - search: JobSettingsDto.fromJson(json[r'search'])!, - sidecar: JobSettingsDto.fromJson(json[r'sidecar'])!, - smartSearch: JobSettingsDto.fromJson(json[r'smartSearch'])!, - thumbnailGeneration: JobSettingsDto.fromJson(json[r'thumbnailGeneration'])!, - videoConversion: JobSettingsDto.fromJson(json[r'videoConversion'])!, - workflow: JobSettingsDto.fromJson(json[r'workflow'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigJobDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigJobDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigJobDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigJobDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'backgroundTask', - 'editor', - 'faceDetection', - 'library', - 'metadataExtraction', - 'migration', - 'notifications', - 'ocr', - 'search', - 'sidecar', - 'smartSearch', - 'thumbnailGeneration', - 'videoConversion', - 'workflow', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_library_dto.dart b/mobile/openapi/lib/model/system_config_library_dto.dart deleted file mode 100644 index e728b0bf20..0000000000 --- a/mobile/openapi/lib/model/system_config_library_dto.dart +++ /dev/null @@ -1,107 +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 SystemConfigLibraryDto { - /// Returns a new [SystemConfigLibraryDto] instance. - SystemConfigLibraryDto({ - required this.scan, - required this.watch, - }); - - SystemConfigLibraryScanDto scan; - - SystemConfigLibraryWatchDto watch; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigLibraryDto && - other.scan == scan && - other.watch == watch; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (scan.hashCode) + - (watch.hashCode); - - @override - String toString() => 'SystemConfigLibraryDto[scan=$scan, watch=$watch]'; - - Map toJson() { - final json = {}; - json[r'scan'] = this.scan; - json[r'watch'] = this.watch; - return json; - } - - /// Returns a new [SystemConfigLibraryDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigLibraryDto( - scan: SystemConfigLibraryScanDto.fromJson(json[r'scan'])!, - watch: SystemConfigLibraryWatchDto.fromJson(json[r'watch'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigLibraryDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigLibraryDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigLibraryDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigLibraryDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'scan', - 'watch', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_library_scan_dto.dart b/mobile/openapi/lib/model/system_config_library_scan_dto.dart deleted file mode 100644 index 28ea603c2a..0000000000 --- a/mobile/openapi/lib/model/system_config_library_scan_dto.dart +++ /dev/null @@ -1,108 +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 SystemConfigLibraryScanDto { - /// Returns a new [SystemConfigLibraryScanDto] instance. - SystemConfigLibraryScanDto({ - required this.cronExpression, - required this.enabled, - }); - - String cronExpression; - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigLibraryScanDto && - other.cronExpression == cronExpression && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (cronExpression.hashCode) + - (enabled.hashCode); - - @override - String toString() => 'SystemConfigLibraryScanDto[cronExpression=$cronExpression, enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'cronExpression'] = this.cronExpression; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigLibraryScanDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigLibraryScanDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryScanDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigLibraryScanDto( - cronExpression: mapValueOfType(json, r'cronExpression')!, - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigLibraryScanDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigLibraryScanDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigLibraryScanDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigLibraryScanDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'cronExpression', - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_library_watch_dto.dart b/mobile/openapi/lib/model/system_config_library_watch_dto.dart deleted file mode 100644 index b4f171bd25..0000000000 --- a/mobile/openapi/lib/model/system_config_library_watch_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigLibraryWatchDto { - /// Returns a new [SystemConfigLibraryWatchDto] instance. - SystemConfigLibraryWatchDto({ - required this.enabled, - }); - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigLibraryWatchDto && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode); - - @override - String toString() => 'SystemConfigLibraryWatchDto[enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigLibraryWatchDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigLibraryWatchDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLibraryWatchDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigLibraryWatchDto( - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigLibraryWatchDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigLibraryWatchDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigLibraryWatchDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigLibraryWatchDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_logging_dto.dart b/mobile/openapi/lib/model/system_config_logging_dto.dart deleted file mode 100644 index 54278893db..0000000000 --- a/mobile/openapi/lib/model/system_config_logging_dto.dart +++ /dev/null @@ -1,108 +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 SystemConfigLoggingDto { - /// Returns a new [SystemConfigLoggingDto] instance. - SystemConfigLoggingDto({ - required this.enabled, - required this.level, - }); - - /// Enabled - bool enabled; - - LogLevel level; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigLoggingDto && - other.enabled == enabled && - other.level == level; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (level.hashCode); - - @override - String toString() => 'SystemConfigLoggingDto[enabled=$enabled, level=$level]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'level'] = this.level; - return json; - } - - /// Returns a new [SystemConfigLoggingDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigLoggingDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigLoggingDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigLoggingDto( - enabled: mapValueOfType(json, r'enabled')!, - level: LogLevel.fromJson(json[r'level'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigLoggingDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigLoggingDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigLoggingDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigLoggingDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'level', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_machine_learning_dto.dart b/mobile/openapi/lib/model/system_config_machine_learning_dto.dart deleted file mode 100644 index 2a0f1ffbc6..0000000000 --- a/mobile/openapi/lib/model/system_config_machine_learning_dto.dart +++ /dev/null @@ -1,150 +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 SystemConfigMachineLearningDto { - /// Returns a new [SystemConfigMachineLearningDto] instance. - SystemConfigMachineLearningDto({ - required this.availabilityChecks, - required this.clip, - required this.duplicateDetection, - required this.enabled, - required this.facialRecognition, - required this.ocr, - this.urls = const [], - }); - - MachineLearningAvailabilityChecksDto availabilityChecks; - - CLIPConfig clip; - - DuplicateDetectionConfig duplicateDetection; - - /// Enabled - bool enabled; - - FacialRecognitionConfig facialRecognition; - - OcrConfig ocr; - - List urls; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigMachineLearningDto && - other.availabilityChecks == availabilityChecks && - other.clip == clip && - other.duplicateDetection == duplicateDetection && - other.enabled == enabled && - other.facialRecognition == facialRecognition && - other.ocr == ocr && - _deepEquality.equals(other.urls, urls); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (availabilityChecks.hashCode) + - (clip.hashCode) + - (duplicateDetection.hashCode) + - (enabled.hashCode) + - (facialRecognition.hashCode) + - (ocr.hashCode) + - (urls.hashCode); - - @override - String toString() => 'SystemConfigMachineLearningDto[availabilityChecks=$availabilityChecks, clip=$clip, duplicateDetection=$duplicateDetection, enabled=$enabled, facialRecognition=$facialRecognition, ocr=$ocr, urls=$urls]'; - - Map toJson() { - final json = {}; - json[r'availabilityChecks'] = this.availabilityChecks; - json[r'clip'] = this.clip; - json[r'duplicateDetection'] = this.duplicateDetection; - json[r'enabled'] = this.enabled; - json[r'facialRecognition'] = this.facialRecognition; - json[r'ocr'] = this.ocr; - json[r'urls'] = this.urls; - return json; - } - - /// Returns a new [SystemConfigMachineLearningDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigMachineLearningDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMachineLearningDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigMachineLearningDto( - availabilityChecks: MachineLearningAvailabilityChecksDto.fromJson(json[r'availabilityChecks'])!, - clip: CLIPConfig.fromJson(json[r'clip'])!, - duplicateDetection: DuplicateDetectionConfig.fromJson(json[r'duplicateDetection'])!, - enabled: mapValueOfType(json, r'enabled')!, - facialRecognition: FacialRecognitionConfig.fromJson(json[r'facialRecognition'])!, - ocr: OcrConfig.fromJson(json[r'ocr'])!, - urls: json[r'urls'] is Iterable - ? (json[r'urls'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigMachineLearningDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigMachineLearningDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigMachineLearningDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigMachineLearningDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'availabilityChecks', - 'clip', - 'duplicateDetection', - 'enabled', - 'facialRecognition', - 'ocr', - 'urls', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_map_dto.dart b/mobile/openapi/lib/model/system_config_map_dto.dart deleted file mode 100644 index 109babd374..0000000000 --- a/mobile/openapi/lib/model/system_config_map_dto.dart +++ /dev/null @@ -1,116 +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 SystemConfigMapDto { - /// Returns a new [SystemConfigMapDto] instance. - SystemConfigMapDto({ - required this.darkStyle, - required this.enabled, - required this.lightStyle, - }); - - String darkStyle; - - /// Enabled - bool enabled; - - String lightStyle; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigMapDto && - other.darkStyle == darkStyle && - other.enabled == enabled && - other.lightStyle == lightStyle; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (darkStyle.hashCode) + - (enabled.hashCode) + - (lightStyle.hashCode); - - @override - String toString() => 'SystemConfigMapDto[darkStyle=$darkStyle, enabled=$enabled, lightStyle=$lightStyle]'; - - Map toJson() { - final json = {}; - json[r'darkStyle'] = this.darkStyle; - json[r'enabled'] = this.enabled; - json[r'lightStyle'] = this.lightStyle; - return json; - } - - /// Returns a new [SystemConfigMapDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigMapDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMapDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigMapDto( - darkStyle: mapValueOfType(json, r'darkStyle')!, - enabled: mapValueOfType(json, r'enabled')!, - lightStyle: mapValueOfType(json, r'lightStyle')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigMapDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigMapDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigMapDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigMapDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'darkStyle', - 'enabled', - 'lightStyle', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_metadata_dto.dart b/mobile/openapi/lib/model/system_config_metadata_dto.dart deleted file mode 100644 index 3c32fc551d..0000000000 --- a/mobile/openapi/lib/model/system_config_metadata_dto.dart +++ /dev/null @@ -1,99 +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 SystemConfigMetadataDto { - /// Returns a new [SystemConfigMetadataDto] instance. - SystemConfigMetadataDto({ - required this.faces, - }); - - SystemConfigFacesDto faces; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigMetadataDto && - other.faces == faces; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (faces.hashCode); - - @override - String toString() => 'SystemConfigMetadataDto[faces=$faces]'; - - Map toJson() { - final json = {}; - json[r'faces'] = this.faces; - return json; - } - - /// Returns a new [SystemConfigMetadataDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigMetadataDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigMetadataDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigMetadataDto( - faces: SystemConfigFacesDto.fromJson(json[r'faces'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigMetadataDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigMetadataDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigMetadataDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigMetadataDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'faces', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_new_version_check_dto.dart b/mobile/openapi/lib/model/system_config_new_version_check_dto.dart deleted file mode 100644 index ec2b400dfd..0000000000 --- a/mobile/openapi/lib/model/system_config_new_version_check_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigNewVersionCheckDto { - /// Returns a new [SystemConfigNewVersionCheckDto] instance. - SystemConfigNewVersionCheckDto({ - required this.enabled, - }); - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigNewVersionCheckDto && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode); - - @override - String toString() => 'SystemConfigNewVersionCheckDto[enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigNewVersionCheckDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigNewVersionCheckDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNewVersionCheckDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigNewVersionCheckDto( - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigNewVersionCheckDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigNewVersionCheckDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigNewVersionCheckDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigNewVersionCheckDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart b/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart deleted file mode 100644 index cfb18b181e..0000000000 --- a/mobile/openapi/lib/model/system_config_nightly_tasks_dto.dart +++ /dev/null @@ -1,144 +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 SystemConfigNightlyTasksDto { - /// Returns a new [SystemConfigNightlyTasksDto] instance. - SystemConfigNightlyTasksDto({ - required this.clusterNewFaces, - required this.databaseCleanup, - required this.generateMemories, - required this.missingThumbnails, - required this.startTime, - required this.syncQuotaUsage, - }); - - /// Cluster new faces - bool clusterNewFaces; - - /// Database cleanup - bool databaseCleanup; - - /// Generate memories - bool generateMemories; - - /// Missing thumbnails - bool missingThumbnails; - - String startTime; - - /// Sync quota usage - bool syncQuotaUsage; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigNightlyTasksDto && - other.clusterNewFaces == clusterNewFaces && - other.databaseCleanup == databaseCleanup && - other.generateMemories == generateMemories && - other.missingThumbnails == missingThumbnails && - other.startTime == startTime && - other.syncQuotaUsage == syncQuotaUsage; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (clusterNewFaces.hashCode) + - (databaseCleanup.hashCode) + - (generateMemories.hashCode) + - (missingThumbnails.hashCode) + - (startTime.hashCode) + - (syncQuotaUsage.hashCode); - - @override - String toString() => 'SystemConfigNightlyTasksDto[clusterNewFaces=$clusterNewFaces, databaseCleanup=$databaseCleanup, generateMemories=$generateMemories, missingThumbnails=$missingThumbnails, startTime=$startTime, syncQuotaUsage=$syncQuotaUsage]'; - - Map toJson() { - final json = {}; - json[r'clusterNewFaces'] = this.clusterNewFaces; - json[r'databaseCleanup'] = this.databaseCleanup; - json[r'generateMemories'] = this.generateMemories; - json[r'missingThumbnails'] = this.missingThumbnails; - json[r'startTime'] = this.startTime; - json[r'syncQuotaUsage'] = this.syncQuotaUsage; - return json; - } - - /// Returns a new [SystemConfigNightlyTasksDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigNightlyTasksDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNightlyTasksDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigNightlyTasksDto( - clusterNewFaces: mapValueOfType(json, r'clusterNewFaces')!, - databaseCleanup: mapValueOfType(json, r'databaseCleanup')!, - generateMemories: mapValueOfType(json, r'generateMemories')!, - missingThumbnails: mapValueOfType(json, r'missingThumbnails')!, - startTime: mapValueOfType(json, r'startTime')!, - syncQuotaUsage: mapValueOfType(json, r'syncQuotaUsage')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigNightlyTasksDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigNightlyTasksDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigNightlyTasksDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigNightlyTasksDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'clusterNewFaces', - 'databaseCleanup', - 'generateMemories', - 'missingThumbnails', - 'startTime', - 'syncQuotaUsage', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_notifications_dto.dart b/mobile/openapi/lib/model/system_config_notifications_dto.dart deleted file mode 100644 index 35d3d31833..0000000000 --- a/mobile/openapi/lib/model/system_config_notifications_dto.dart +++ /dev/null @@ -1,99 +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 SystemConfigNotificationsDto { - /// Returns a new [SystemConfigNotificationsDto] instance. - SystemConfigNotificationsDto({ - required this.smtp, - }); - - SystemConfigSmtpDto smtp; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigNotificationsDto && - other.smtp == smtp; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (smtp.hashCode); - - @override - String toString() => 'SystemConfigNotificationsDto[smtp=$smtp]'; - - Map toJson() { - final json = {}; - json[r'smtp'] = this.smtp; - return json; - } - - /// Returns a new [SystemConfigNotificationsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigNotificationsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigNotificationsDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigNotificationsDto( - smtp: SystemConfigSmtpDto.fromJson(json[r'smtp'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigNotificationsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigNotificationsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigNotificationsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigNotificationsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'smtp', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_o_auth_dto.dart b/mobile/openapi/lib/model/system_config_o_auth_dto.dart deleted file mode 100644 index 82195e498b..0000000000 --- a/mobile/openapi/lib/model/system_config_o_auth_dto.dart +++ /dev/null @@ -1,260 +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 SystemConfigOAuthDto { - /// Returns a new [SystemConfigOAuthDto] instance. - SystemConfigOAuthDto({ - required this.autoLaunch, - required this.autoRegister, - required this.buttonText, - required this.clientId, - required this.clientSecret, - required this.defaultStorageQuota, - required this.enabled, - required this.issuerUrl, - required this.mobileOverrideEnabled, - required this.mobileRedirectUri, - required this.profileSigningAlgorithm, - required this.roleClaim, - required this.scope, - required this.signingAlgorithm, - required this.storageLabelClaim, - required this.storageQuotaClaim, - required this.timeout, - required this.tokenEndpointAuthMethod, - }); - - /// Auto launch - bool autoLaunch; - - /// Auto register - bool autoRegister; - - /// Button text - String buttonText; - - /// Client ID - String clientId; - - /// Client secret - String clientSecret; - - /// Default storage quota - /// - /// Minimum value: 0 - int? defaultStorageQuota; - - /// Enabled - bool enabled; - - /// Issuer URL - String issuerUrl; - - /// Mobile override enabled - bool mobileOverrideEnabled; - - /// Mobile redirect URI - String mobileRedirectUri; - - /// Profile signing algorithm - String profileSigningAlgorithm; - - /// Role claim - String roleClaim; - - /// Scope - String scope; - - String signingAlgorithm; - - /// Storage label claim - String storageLabelClaim; - - /// Storage quota claim - String storageQuotaClaim; - - /// Timeout - /// - /// Minimum value: 1 - int timeout; - - /// Token endpoint auth method - OAuthTokenEndpointAuthMethod tokenEndpointAuthMethod; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigOAuthDto && - other.autoLaunch == autoLaunch && - other.autoRegister == autoRegister && - other.buttonText == buttonText && - other.clientId == clientId && - other.clientSecret == clientSecret && - other.defaultStorageQuota == defaultStorageQuota && - other.enabled == enabled && - other.issuerUrl == issuerUrl && - other.mobileOverrideEnabled == mobileOverrideEnabled && - other.mobileRedirectUri == mobileRedirectUri && - other.profileSigningAlgorithm == profileSigningAlgorithm && - other.roleClaim == roleClaim && - other.scope == scope && - other.signingAlgorithm == signingAlgorithm && - other.storageLabelClaim == storageLabelClaim && - other.storageQuotaClaim == storageQuotaClaim && - other.timeout == timeout && - other.tokenEndpointAuthMethod == tokenEndpointAuthMethod; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (autoLaunch.hashCode) + - (autoRegister.hashCode) + - (buttonText.hashCode) + - (clientId.hashCode) + - (clientSecret.hashCode) + - (defaultStorageQuota == null ? 0 : defaultStorageQuota!.hashCode) + - (enabled.hashCode) + - (issuerUrl.hashCode) + - (mobileOverrideEnabled.hashCode) + - (mobileRedirectUri.hashCode) + - (profileSigningAlgorithm.hashCode) + - (roleClaim.hashCode) + - (scope.hashCode) + - (signingAlgorithm.hashCode) + - (storageLabelClaim.hashCode) + - (storageQuotaClaim.hashCode) + - (timeout.hashCode) + - (tokenEndpointAuthMethod.hashCode); - - @override - String toString() => 'SystemConfigOAuthDto[autoLaunch=$autoLaunch, autoRegister=$autoRegister, buttonText=$buttonText, clientId=$clientId, clientSecret=$clientSecret, defaultStorageQuota=$defaultStorageQuota, enabled=$enabled, issuerUrl=$issuerUrl, mobileOverrideEnabled=$mobileOverrideEnabled, mobileRedirectUri=$mobileRedirectUri, profileSigningAlgorithm=$profileSigningAlgorithm, roleClaim=$roleClaim, scope=$scope, signingAlgorithm=$signingAlgorithm, storageLabelClaim=$storageLabelClaim, storageQuotaClaim=$storageQuotaClaim, timeout=$timeout, tokenEndpointAuthMethod=$tokenEndpointAuthMethod]'; - - Map toJson() { - final json = {}; - json[r'autoLaunch'] = this.autoLaunch; - json[r'autoRegister'] = this.autoRegister; - json[r'buttonText'] = this.buttonText; - json[r'clientId'] = this.clientId; - json[r'clientSecret'] = this.clientSecret; - if (this.defaultStorageQuota != null) { - json[r'defaultStorageQuota'] = this.defaultStorageQuota; - } else { - // json[r'defaultStorageQuota'] = null; - } - json[r'enabled'] = this.enabled; - json[r'issuerUrl'] = this.issuerUrl; - json[r'mobileOverrideEnabled'] = this.mobileOverrideEnabled; - json[r'mobileRedirectUri'] = this.mobileRedirectUri; - json[r'profileSigningAlgorithm'] = this.profileSigningAlgorithm; - json[r'roleClaim'] = this.roleClaim; - json[r'scope'] = this.scope; - json[r'signingAlgorithm'] = this.signingAlgorithm; - json[r'storageLabelClaim'] = this.storageLabelClaim; - json[r'storageQuotaClaim'] = this.storageQuotaClaim; - json[r'timeout'] = this.timeout; - json[r'tokenEndpointAuthMethod'] = this.tokenEndpointAuthMethod; - return json; - } - - /// Returns a new [SystemConfigOAuthDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigOAuthDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigOAuthDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigOAuthDto( - autoLaunch: mapValueOfType(json, r'autoLaunch')!, - autoRegister: mapValueOfType(json, r'autoRegister')!, - buttonText: mapValueOfType(json, r'buttonText')!, - clientId: mapValueOfType(json, r'clientId')!, - clientSecret: mapValueOfType(json, r'clientSecret')!, - defaultStorageQuota: mapValueOfType(json, r'defaultStorageQuota'), - enabled: mapValueOfType(json, r'enabled')!, - issuerUrl: mapValueOfType(json, r'issuerUrl')!, - mobileOverrideEnabled: mapValueOfType(json, r'mobileOverrideEnabled')!, - mobileRedirectUri: mapValueOfType(json, r'mobileRedirectUri')!, - profileSigningAlgorithm: mapValueOfType(json, r'profileSigningAlgorithm')!, - roleClaim: mapValueOfType(json, r'roleClaim')!, - scope: mapValueOfType(json, r'scope')!, - signingAlgorithm: mapValueOfType(json, r'signingAlgorithm')!, - storageLabelClaim: mapValueOfType(json, r'storageLabelClaim')!, - storageQuotaClaim: mapValueOfType(json, r'storageQuotaClaim')!, - timeout: mapValueOfType(json, r'timeout')!, - tokenEndpointAuthMethod: OAuthTokenEndpointAuthMethod.fromJson(json[r'tokenEndpointAuthMethod'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigOAuthDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigOAuthDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigOAuthDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigOAuthDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'autoLaunch', - 'autoRegister', - 'buttonText', - 'clientId', - 'clientSecret', - 'defaultStorageQuota', - 'enabled', - 'issuerUrl', - 'mobileOverrideEnabled', - 'mobileRedirectUri', - 'profileSigningAlgorithm', - 'roleClaim', - 'scope', - 'signingAlgorithm', - 'storageLabelClaim', - 'storageQuotaClaim', - 'timeout', - 'tokenEndpointAuthMethod', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_password_login_dto.dart b/mobile/openapi/lib/model/system_config_password_login_dto.dart deleted file mode 100644 index 1328a6acaa..0000000000 --- a/mobile/openapi/lib/model/system_config_password_login_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigPasswordLoginDto { - /// Returns a new [SystemConfigPasswordLoginDto] instance. - SystemConfigPasswordLoginDto({ - required this.enabled, - }); - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigPasswordLoginDto && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode); - - @override - String toString() => 'SystemConfigPasswordLoginDto[enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigPasswordLoginDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigPasswordLoginDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigPasswordLoginDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigPasswordLoginDto( - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigPasswordLoginDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigPasswordLoginDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigPasswordLoginDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigPasswordLoginDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart b/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart deleted file mode 100644 index 0374e19be1..0000000000 --- a/mobile/openapi/lib/model/system_config_reverse_geocoding_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigReverseGeocodingDto { - /// Returns a new [SystemConfigReverseGeocodingDto] instance. - SystemConfigReverseGeocodingDto({ - required this.enabled, - }); - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigReverseGeocodingDto && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode); - - @override - String toString() => 'SystemConfigReverseGeocodingDto[enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigReverseGeocodingDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigReverseGeocodingDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigReverseGeocodingDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigReverseGeocodingDto( - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigReverseGeocodingDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigReverseGeocodingDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigReverseGeocodingDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigReverseGeocodingDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_server_dto.dart b/mobile/openapi/lib/model/system_config_server_dto.dart deleted file mode 100644 index 200f75f7c6..0000000000 --- a/mobile/openapi/lib/model/system_config_server_dto.dart +++ /dev/null @@ -1,118 +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 SystemConfigServerDto { - /// Returns a new [SystemConfigServerDto] instance. - SystemConfigServerDto({ - required this.externalDomain, - required this.loginPageMessage, - required this.publicUsers, - }); - - /// External domain - String externalDomain; - - /// Login page message - String loginPageMessage; - - /// Public users - bool publicUsers; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigServerDto && - other.externalDomain == externalDomain && - other.loginPageMessage == loginPageMessage && - other.publicUsers == publicUsers; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (externalDomain.hashCode) + - (loginPageMessage.hashCode) + - (publicUsers.hashCode); - - @override - String toString() => 'SystemConfigServerDto[externalDomain=$externalDomain, loginPageMessage=$loginPageMessage, publicUsers=$publicUsers]'; - - Map toJson() { - final json = {}; - json[r'externalDomain'] = this.externalDomain; - json[r'loginPageMessage'] = this.loginPageMessage; - json[r'publicUsers'] = this.publicUsers; - return json; - } - - /// Returns a new [SystemConfigServerDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigServerDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigServerDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigServerDto( - externalDomain: mapValueOfType(json, r'externalDomain')!, - loginPageMessage: mapValueOfType(json, r'loginPageMessage')!, - publicUsers: mapValueOfType(json, r'publicUsers')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigServerDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigServerDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigServerDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigServerDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'externalDomain', - 'loginPageMessage', - 'publicUsers', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_smtp_dto.dart b/mobile/openapi/lib/model/system_config_smtp_dto.dart deleted file mode 100644 index a3d14cda63..0000000000 --- a/mobile/openapi/lib/model/system_config_smtp_dto.dart +++ /dev/null @@ -1,126 +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 SystemConfigSmtpDto { - /// Returns a new [SystemConfigSmtpDto] instance. - SystemConfigSmtpDto({ - required this.enabled, - required this.from, - required this.replyTo, - required this.transport, - }); - - /// Whether SMTP email notifications are enabled - bool enabled; - - /// Email address to send from - String from; - - /// Email address for replies - String replyTo; - - SystemConfigSmtpTransportDto transport; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigSmtpDto && - other.enabled == enabled && - other.from == from && - other.replyTo == replyTo && - other.transport == transport; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (from.hashCode) + - (replyTo.hashCode) + - (transport.hashCode); - - @override - String toString() => 'SystemConfigSmtpDto[enabled=$enabled, from=$from, replyTo=$replyTo, transport=$transport]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'from'] = this.from; - json[r'replyTo'] = this.replyTo; - json[r'transport'] = this.transport; - return json; - } - - /// Returns a new [SystemConfigSmtpDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigSmtpDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigSmtpDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigSmtpDto( - enabled: mapValueOfType(json, r'enabled')!, - from: mapValueOfType(json, r'from')!, - replyTo: mapValueOfType(json, r'replyTo')!, - transport: SystemConfigSmtpTransportDto.fromJson(json[r'transport'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigSmtpDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigSmtpDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigSmtpDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigSmtpDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'from', - 'replyTo', - 'transport', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart b/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart deleted file mode 100644 index 9e16e5badf..0000000000 --- a/mobile/openapi/lib/model/system_config_smtp_transport_dto.dart +++ /dev/null @@ -1,148 +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 SystemConfigSmtpTransportDto { - /// Returns a new [SystemConfigSmtpTransportDto] instance. - SystemConfigSmtpTransportDto({ - required this.host, - required this.ignoreCert, - required this.password, - required this.port, - required this.secure, - required this.username, - }); - - /// SMTP server hostname - String host; - - /// Whether to ignore SSL certificate errors - bool ignoreCert; - - /// SMTP password - String password; - - /// SMTP server port - /// - /// Minimum value: 0 - /// Maximum value: 65535 - num port; - - /// Whether to use secure connection (TLS/SSL) - bool secure; - - /// SMTP username - String username; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigSmtpTransportDto && - other.host == host && - other.ignoreCert == ignoreCert && - other.password == password && - other.port == port && - other.secure == secure && - other.username == username; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (host.hashCode) + - (ignoreCert.hashCode) + - (password.hashCode) + - (port.hashCode) + - (secure.hashCode) + - (username.hashCode); - - @override - String toString() => 'SystemConfigSmtpTransportDto[host=$host, ignoreCert=$ignoreCert, password=$password, port=$port, secure=$secure, username=$username]'; - - Map toJson() { - final json = {}; - json[r'host'] = this.host; - json[r'ignoreCert'] = this.ignoreCert; - json[r'password'] = this.password; - json[r'port'] = this.port; - json[r'secure'] = this.secure; - json[r'username'] = this.username; - return json; - } - - /// Returns a new [SystemConfigSmtpTransportDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigSmtpTransportDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigSmtpTransportDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigSmtpTransportDto( - host: mapValueOfType(json, r'host')!, - ignoreCert: mapValueOfType(json, r'ignoreCert')!, - password: mapValueOfType(json, r'password')!, - port: num.parse('${json[r'port']}'), - secure: mapValueOfType(json, r'secure')!, - username: mapValueOfType(json, r'username')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigSmtpTransportDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigSmtpTransportDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigSmtpTransportDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigSmtpTransportDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'host', - 'ignoreCert', - 'password', - 'port', - 'secure', - 'username', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_storage_template_dto.dart b/mobile/openapi/lib/model/system_config_storage_template_dto.dart deleted file mode 100644 index f9f37e48ad..0000000000 --- a/mobile/openapi/lib/model/system_config_storage_template_dto.dart +++ /dev/null @@ -1,118 +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 SystemConfigStorageTemplateDto { - /// Returns a new [SystemConfigStorageTemplateDto] instance. - SystemConfigStorageTemplateDto({ - required this.enabled, - required this.hashVerificationEnabled, - required this.template, - }); - - /// Enabled - bool enabled; - - /// Hash verification enabled - bool hashVerificationEnabled; - - /// Template - String template; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigStorageTemplateDto && - other.enabled == enabled && - other.hashVerificationEnabled == hashVerificationEnabled && - other.template == template; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (hashVerificationEnabled.hashCode) + - (template.hashCode); - - @override - String toString() => 'SystemConfigStorageTemplateDto[enabled=$enabled, hashVerificationEnabled=$hashVerificationEnabled, template=$template]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'hashVerificationEnabled'] = this.hashVerificationEnabled; - json[r'template'] = this.template; - return json; - } - - /// Returns a new [SystemConfigStorageTemplateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigStorageTemplateDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigStorageTemplateDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigStorageTemplateDto( - enabled: mapValueOfType(json, r'enabled')!, - hashVerificationEnabled: mapValueOfType(json, r'hashVerificationEnabled')!, - template: mapValueOfType(json, r'template')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigStorageTemplateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigStorageTemplateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigStorageTemplateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigStorageTemplateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'hashVerificationEnabled', - 'template', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_template_emails_dto.dart b/mobile/openapi/lib/model/system_config_template_emails_dto.dart deleted file mode 100644 index 9db85509f5..0000000000 --- a/mobile/openapi/lib/model/system_config_template_emails_dto.dart +++ /dev/null @@ -1,115 +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 SystemConfigTemplateEmailsDto { - /// Returns a new [SystemConfigTemplateEmailsDto] instance. - SystemConfigTemplateEmailsDto({ - required this.albumInviteTemplate, - required this.albumUpdateTemplate, - required this.welcomeTemplate, - }); - - String albumInviteTemplate; - - String albumUpdateTemplate; - - String welcomeTemplate; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigTemplateEmailsDto && - other.albumInviteTemplate == albumInviteTemplate && - other.albumUpdateTemplate == albumUpdateTemplate && - other.welcomeTemplate == welcomeTemplate; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumInviteTemplate.hashCode) + - (albumUpdateTemplate.hashCode) + - (welcomeTemplate.hashCode); - - @override - String toString() => 'SystemConfigTemplateEmailsDto[albumInviteTemplate=$albumInviteTemplate, albumUpdateTemplate=$albumUpdateTemplate, welcomeTemplate=$welcomeTemplate]'; - - Map toJson() { - final json = {}; - json[r'albumInviteTemplate'] = this.albumInviteTemplate; - json[r'albumUpdateTemplate'] = this.albumUpdateTemplate; - json[r'welcomeTemplate'] = this.welcomeTemplate; - return json; - } - - /// Returns a new [SystemConfigTemplateEmailsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigTemplateEmailsDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplateEmailsDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigTemplateEmailsDto( - albumInviteTemplate: mapValueOfType(json, r'albumInviteTemplate')!, - albumUpdateTemplate: mapValueOfType(json, r'albumUpdateTemplate')!, - welcomeTemplate: mapValueOfType(json, r'welcomeTemplate')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigTemplateEmailsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigTemplateEmailsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigTemplateEmailsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigTemplateEmailsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albumInviteTemplate', - 'albumUpdateTemplate', - 'welcomeTemplate', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart b/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart deleted file mode 100644 index 6f81513039..0000000000 --- a/mobile/openapi/lib/model/system_config_template_storage_option_dto.dart +++ /dev/null @@ -1,179 +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 SystemConfigTemplateStorageOptionDto { - /// Returns a new [SystemConfigTemplateStorageOptionDto] instance. - SystemConfigTemplateStorageOptionDto({ - this.dayOptions = const [], - this.hourOptions = const [], - this.minuteOptions = const [], - this.monthOptions = const [], - this.presetOptions = const [], - this.secondOptions = const [], - this.weekOptions = const [], - this.yearOptions = const [], - }); - - /// Available day format options for storage template - List dayOptions; - - /// Available hour format options for storage template - List hourOptions; - - /// Available minute format options for storage template - List minuteOptions; - - /// Available month format options for storage template - List monthOptions; - - /// Available preset template options - List presetOptions; - - /// Available second format options for storage template - List secondOptions; - - /// Available week format options for storage template - List weekOptions; - - /// Available year format options for storage template - List yearOptions; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigTemplateStorageOptionDto && - _deepEquality.equals(other.dayOptions, dayOptions) && - _deepEquality.equals(other.hourOptions, hourOptions) && - _deepEquality.equals(other.minuteOptions, minuteOptions) && - _deepEquality.equals(other.monthOptions, monthOptions) && - _deepEquality.equals(other.presetOptions, presetOptions) && - _deepEquality.equals(other.secondOptions, secondOptions) && - _deepEquality.equals(other.weekOptions, weekOptions) && - _deepEquality.equals(other.yearOptions, yearOptions); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (dayOptions.hashCode) + - (hourOptions.hashCode) + - (minuteOptions.hashCode) + - (monthOptions.hashCode) + - (presetOptions.hashCode) + - (secondOptions.hashCode) + - (weekOptions.hashCode) + - (yearOptions.hashCode); - - @override - String toString() => 'SystemConfigTemplateStorageOptionDto[dayOptions=$dayOptions, hourOptions=$hourOptions, minuteOptions=$minuteOptions, monthOptions=$monthOptions, presetOptions=$presetOptions, secondOptions=$secondOptions, weekOptions=$weekOptions, yearOptions=$yearOptions]'; - - Map toJson() { - final json = {}; - json[r'dayOptions'] = this.dayOptions; - json[r'hourOptions'] = this.hourOptions; - json[r'minuteOptions'] = this.minuteOptions; - json[r'monthOptions'] = this.monthOptions; - json[r'presetOptions'] = this.presetOptions; - json[r'secondOptions'] = this.secondOptions; - json[r'weekOptions'] = this.weekOptions; - json[r'yearOptions'] = this.yearOptions; - return json; - } - - /// Returns a new [SystemConfigTemplateStorageOptionDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigTemplateStorageOptionDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplateStorageOptionDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigTemplateStorageOptionDto( - dayOptions: json[r'dayOptions'] is Iterable - ? (json[r'dayOptions'] as Iterable).cast().toList(growable: false) - : const [], - hourOptions: json[r'hourOptions'] is Iterable - ? (json[r'hourOptions'] as Iterable).cast().toList(growable: false) - : const [], - minuteOptions: json[r'minuteOptions'] is Iterable - ? (json[r'minuteOptions'] as Iterable).cast().toList(growable: false) - : const [], - monthOptions: json[r'monthOptions'] is Iterable - ? (json[r'monthOptions'] as Iterable).cast().toList(growable: false) - : const [], - presetOptions: json[r'presetOptions'] is Iterable - ? (json[r'presetOptions'] as Iterable).cast().toList(growable: false) - : const [], - secondOptions: json[r'secondOptions'] is Iterable - ? (json[r'secondOptions'] as Iterable).cast().toList(growable: false) - : const [], - weekOptions: json[r'weekOptions'] is Iterable - ? (json[r'weekOptions'] as Iterable).cast().toList(growable: false) - : const [], - yearOptions: json[r'yearOptions'] is Iterable - ? (json[r'yearOptions'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigTemplateStorageOptionDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigTemplateStorageOptionDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigTemplateStorageOptionDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigTemplateStorageOptionDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'dayOptions', - 'hourOptions', - 'minuteOptions', - 'monthOptions', - 'presetOptions', - 'secondOptions', - 'weekOptions', - 'yearOptions', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_templates_dto.dart b/mobile/openapi/lib/model/system_config_templates_dto.dart deleted file mode 100644 index a5e8834978..0000000000 --- a/mobile/openapi/lib/model/system_config_templates_dto.dart +++ /dev/null @@ -1,99 +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 SystemConfigTemplatesDto { - /// Returns a new [SystemConfigTemplatesDto] instance. - SystemConfigTemplatesDto({ - required this.email, - }); - - SystemConfigTemplateEmailsDto email; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigTemplatesDto && - other.email == email; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (email.hashCode); - - @override - String toString() => 'SystemConfigTemplatesDto[email=$email]'; - - Map toJson() { - final json = {}; - json[r'email'] = this.email; - return json; - } - - /// Returns a new [SystemConfigTemplatesDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigTemplatesDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTemplatesDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigTemplatesDto( - email: SystemConfigTemplateEmailsDto.fromJson(json[r'email'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigTemplatesDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigTemplatesDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigTemplatesDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigTemplatesDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'email', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_theme_dto.dart b/mobile/openapi/lib/model/system_config_theme_dto.dart deleted file mode 100644 index fca38f71fb..0000000000 --- a/mobile/openapi/lib/model/system_config_theme_dto.dart +++ /dev/null @@ -1,100 +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 SystemConfigThemeDto { - /// Returns a new [SystemConfigThemeDto] instance. - SystemConfigThemeDto({ - required this.customCss, - }); - - /// Custom CSS for theming - String customCss; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigThemeDto && - other.customCss == customCss; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (customCss.hashCode); - - @override - String toString() => 'SystemConfigThemeDto[customCss=$customCss]'; - - Map toJson() { - final json = {}; - json[r'customCss'] = this.customCss; - return json; - } - - /// Returns a new [SystemConfigThemeDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigThemeDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigThemeDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigThemeDto( - customCss: mapValueOfType(json, r'customCss')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigThemeDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigThemeDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigThemeDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigThemeDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'customCss', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_trash_dto.dart b/mobile/openapi/lib/model/system_config_trash_dto.dart deleted file mode 100644 index 9bdaef92d3..0000000000 --- a/mobile/openapi/lib/model/system_config_trash_dto.dart +++ /dev/null @@ -1,111 +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 SystemConfigTrashDto { - /// Returns a new [SystemConfigTrashDto] instance. - SystemConfigTrashDto({ - required this.days, - required this.enabled, - }); - - /// Days - /// - /// Minimum value: 0 - int days; - - /// Enabled - bool enabled; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigTrashDto && - other.days == days && - other.enabled == enabled; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (days.hashCode) + - (enabled.hashCode); - - @override - String toString() => 'SystemConfigTrashDto[days=$days, enabled=$enabled]'; - - Map toJson() { - final json = {}; - json[r'days'] = this.days; - json[r'enabled'] = this.enabled; - return json; - } - - /// Returns a new [SystemConfigTrashDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigTrashDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigTrashDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigTrashDto( - days: mapValueOfType(json, r'days')!, - enabled: mapValueOfType(json, r'enabled')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigTrashDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigTrashDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigTrashDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigTrashDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'days', - 'enabled', - }; -} - diff --git a/mobile/openapi/lib/model/system_config_user_dto.dart b/mobile/openapi/lib/model/system_config_user_dto.dart deleted file mode 100644 index a7313560e6..0000000000 --- a/mobile/openapi/lib/model/system_config_user_dto.dart +++ /dev/null @@ -1,102 +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 SystemConfigUserDto { - /// Returns a new [SystemConfigUserDto] instance. - SystemConfigUserDto({ - required this.deleteDelay, - }); - - /// Delete delay - /// - /// Minimum value: 1 - int deleteDelay; - - @override - bool operator ==(Object other) => identical(this, other) || other is SystemConfigUserDto && - other.deleteDelay == deleteDelay; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (deleteDelay.hashCode); - - @override - String toString() => 'SystemConfigUserDto[deleteDelay=$deleteDelay]'; - - Map toJson() { - final json = {}; - json[r'deleteDelay'] = this.deleteDelay; - return json; - } - - /// Returns a new [SystemConfigUserDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static SystemConfigUserDto? fromJson(dynamic value) { - upgradeDto(value, "SystemConfigUserDto"); - if (value is Map) { - final json = value.cast(); - - return SystemConfigUserDto( - deleteDelay: mapValueOfType(json, r'deleteDelay')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = SystemConfigUserDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = SystemConfigUserDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of SystemConfigUserDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = SystemConfigUserDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'deleteDelay', - }; -} - diff --git a/mobile/openapi/lib/model/tag_bulk_assets_dto.dart b/mobile/openapi/lib/model/tag_bulk_assets_dto.dart deleted file mode 100644 index 16abc3bcdc..0000000000 --- a/mobile/openapi/lib/model/tag_bulk_assets_dto.dart +++ /dev/null @@ -1,113 +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 TagBulkAssetsDto { - /// Returns a new [TagBulkAssetsDto] instance. - TagBulkAssetsDto({ - this.assetIds = const [], - this.tagIds = const [], - }); - - /// Asset IDs - List assetIds; - - /// Tag IDs - List tagIds; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagBulkAssetsDto && - _deepEquality.equals(other.assetIds, assetIds) && - _deepEquality.equals(other.tagIds, tagIds); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (assetIds.hashCode) + - (tagIds.hashCode); - - @override - String toString() => 'TagBulkAssetsDto[assetIds=$assetIds, tagIds=$tagIds]'; - - Map toJson() { - final json = {}; - json[r'assetIds'] = this.assetIds; - json[r'tagIds'] = this.tagIds; - return json; - } - - /// Returns a new [TagBulkAssetsDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagBulkAssetsDto? fromJson(dynamic value) { - upgradeDto(value, "TagBulkAssetsDto"); - if (value is Map) { - final json = value.cast(); - - return TagBulkAssetsDto( - assetIds: json[r'assetIds'] is Iterable - ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) - : const [], - tagIds: json[r'tagIds'] is Iterable - ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagBulkAssetsDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagBulkAssetsDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagBulkAssetsDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagBulkAssetsDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'assetIds', - 'tagIds', - }; -} - diff --git a/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart b/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart deleted file mode 100644 index 5566846e3c..0000000000 --- a/mobile/openapi/lib/model/tag_bulk_assets_response_dto.dart +++ /dev/null @@ -1,100 +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 TagBulkAssetsResponseDto { - /// Returns a new [TagBulkAssetsResponseDto] instance. - TagBulkAssetsResponseDto({ - required this.count, - }); - - /// Number of assets tagged - int count; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagBulkAssetsResponseDto && - other.count == count; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode); - - @override - String toString() => 'TagBulkAssetsResponseDto[count=$count]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - return json; - } - - /// Returns a new [TagBulkAssetsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagBulkAssetsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TagBulkAssetsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TagBulkAssetsResponseDto( - count: mapValueOfType(json, r'count')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagBulkAssetsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagBulkAssetsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagBulkAssetsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagBulkAssetsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - }; -} - diff --git a/mobile/openapi/lib/model/tag_create_dto.dart b/mobile/openapi/lib/model/tag_create_dto.dart deleted file mode 100644 index fd6a10163c..0000000000 --- a/mobile/openapi/lib/model/tag_create_dto.dart +++ /dev/null @@ -1,130 +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 TagCreateDto { - /// Returns a new [TagCreateDto] instance. - TagCreateDto({ - this.color, - required this.name, - this.parentId, - }); - - /// Tag color (hex) - /// - /// 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? color; - - /// Tag name - String name; - - /// Parent tag ID - String? parentId; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagCreateDto && - other.color == color && - other.name == name && - other.parentId == parentId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (color == null ? 0 : color!.hashCode) + - (name.hashCode) + - (parentId == null ? 0 : parentId!.hashCode); - - @override - String toString() => 'TagCreateDto[color=$color, name=$name, parentId=$parentId]'; - - Map toJson() { - final json = {}; - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - json[r'name'] = this.name; - if (this.parentId != null) { - json[r'parentId'] = this.parentId; - } else { - // json[r'parentId'] = null; - } - return json; - } - - /// Returns a new [TagCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagCreateDto? fromJson(dynamic value) { - upgradeDto(value, "TagCreateDto"); - if (value is Map) { - final json = value.cast(); - - return TagCreateDto( - color: mapValueOfType(json, r'color'), - name: mapValueOfType(json, r'name')!, - parentId: mapValueOfType(json, r'parentId'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'name', - }; -} - diff --git a/mobile/openapi/lib/model/tag_response_dto.dart b/mobile/openapi/lib/model/tag_response_dto.dart deleted file mode 100644 index 9a71912153..0000000000 --- a/mobile/openapi/lib/model/tag_response_dto.dart +++ /dev/null @@ -1,172 +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 TagResponseDto { - /// Returns a new [TagResponseDto] instance. - TagResponseDto({ - this.color, - required this.createdAt, - required this.id, - required this.name, - this.parentId, - required this.updatedAt, - required this.value, - }); - - /// Tag color (hex) - /// - /// 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? color; - - /// Creation date - DateTime createdAt; - - /// Tag ID - String id; - - /// Tag name - String name; - - /// Parent tag ID - /// - /// 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? parentId; - - /// Last update date - DateTime updatedAt; - - /// Tag value (full path) - String value; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagResponseDto && - other.color == color && - other.createdAt == createdAt && - other.id == id && - other.name == name && - other.parentId == parentId && - other.updatedAt == updatedAt && - other.value == value; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (color == null ? 0 : color!.hashCode) + - (createdAt.hashCode) + - (id.hashCode) + - (name.hashCode) + - (parentId == null ? 0 : parentId!.hashCode) + - (updatedAt.hashCode) + - (value.hashCode); - - @override - String toString() => 'TagResponseDto[color=$color, createdAt=$createdAt, id=$id, name=$name, parentId=$parentId, updatedAt=$updatedAt, value=$value]'; - - Map toJson() { - final json = {}; - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - json[r'id'] = this.id; - json[r'name'] = this.name; - if (this.parentId != null) { - json[r'parentId'] = this.parentId; - } else { - // json[r'parentId'] = null; - } - json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); - json[r'value'] = this.value; - return json; - } - - /// Returns a new [TagResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TagResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TagResponseDto( - color: mapValueOfType(json, r'color'), - createdAt: mapDateTime(json, r'createdAt', r'')!, - id: mapValueOfType(json, r'id')!, - name: mapValueOfType(json, r'name')!, - parentId: mapValueOfType(json, r'parentId'), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, - value: mapValueOfType(json, r'value')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'createdAt', - 'id', - 'name', - 'updatedAt', - 'value', - }; -} - diff --git a/mobile/openapi/lib/model/tag_update_dto.dart b/mobile/openapi/lib/model/tag_update_dto.dart deleted file mode 100644 index 98cb6af523..0000000000 --- a/mobile/openapi/lib/model/tag_update_dto.dart +++ /dev/null @@ -1,103 +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 TagUpdateDto { - /// Returns a new [TagUpdateDto] instance. - TagUpdateDto({ - this.color, - }); - - /// Tag color (hex) - String? color; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagUpdateDto && - other.color == color; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (color == null ? 0 : color!.hashCode); - - @override - String toString() => 'TagUpdateDto[color=$color]'; - - Map toJson() { - final json = {}; - if (this.color != null) { - json[r'color'] = this.color; - } else { - // json[r'color'] = null; - } - return json; - } - - /// Returns a new [TagUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "TagUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return TagUpdateDto( - color: mapValueOfType(json, r'color'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/tag_upsert_dto.dart b/mobile/openapi/lib/model/tag_upsert_dto.dart deleted file mode 100644 index 3581ef1e8f..0000000000 --- a/mobile/openapi/lib/model/tag_upsert_dto.dart +++ /dev/null @@ -1,102 +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 TagUpsertDto { - /// Returns a new [TagUpsertDto] instance. - TagUpsertDto({ - this.tags = const [], - }); - - /// Tag names to upsert - List tags; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagUpsertDto && - _deepEquality.equals(other.tags, tags); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (tags.hashCode); - - @override - String toString() => 'TagUpsertDto[tags=$tags]'; - - Map toJson() { - final json = {}; - json[r'tags'] = this.tags; - return json; - } - - /// Returns a new [TagUpsertDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagUpsertDto? fromJson(dynamic value) { - upgradeDto(value, "TagUpsertDto"); - if (value is Map) { - final json = value.cast(); - - return TagUpsertDto( - tags: json[r'tags'] is Iterable - ? (json[r'tags'] as Iterable).cast().toList(growable: false) - : const [], - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagUpsertDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagUpsertDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagUpsertDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagUpsertDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'tags', - }; -} - diff --git a/mobile/openapi/lib/model/tags_response.dart b/mobile/openapi/lib/model/tags_response.dart deleted file mode 100644 index 1e4a4bd109..0000000000 --- a/mobile/openapi/lib/model/tags_response.dart +++ /dev/null @@ -1,109 +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 TagsResponse { - /// Returns a new [TagsResponse] instance. - TagsResponse({ - this.enabled = true, - this.sidebarWeb = true, - }); - - /// Whether tags are enabled - bool enabled; - - /// Whether tags appear in web sidebar - bool sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagsResponse && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled.hashCode) + - (sidebarWeb.hashCode); - - @override - String toString() => 'TagsResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - json[r'enabled'] = this.enabled; - json[r'sidebarWeb'] = this.sidebarWeb; - return json; - } - - /// Returns a new [TagsResponse] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagsResponse? fromJson(dynamic value) { - upgradeDto(value, "TagsResponse"); - if (value is Map) { - final json = value.cast(); - - return TagsResponse( - enabled: mapValueOfType(json, r'enabled')!, - sidebarWeb: mapValueOfType(json, r'sidebarWeb')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagsResponse.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagsResponse.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagsResponse-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagsResponse.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'enabled', - 'sidebarWeb', - }; -} - diff --git a/mobile/openapi/lib/model/tags_update.dart b/mobile/openapi/lib/model/tags_update.dart deleted file mode 100644 index e42357e3d4..0000000000 --- a/mobile/openapi/lib/model/tags_update.dart +++ /dev/null @@ -1,127 +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 TagsUpdate { - /// Returns a new [TagsUpdate] instance. - TagsUpdate({ - this.enabled, - this.sidebarWeb, - }); - - /// Whether tags are enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Whether tags appear in web sidebar - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? sidebarWeb; - - @override - bool operator ==(Object other) => identical(this, other) || other is TagsUpdate && - other.enabled == enabled && - other.sidebarWeb == sidebarWeb; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (enabled == null ? 0 : enabled!.hashCode) + - (sidebarWeb == null ? 0 : sidebarWeb!.hashCode); - - @override - String toString() => 'TagsUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]'; - - Map toJson() { - final json = {}; - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - if (this.sidebarWeb != null) { - json[r'sidebarWeb'] = this.sidebarWeb; - } else { - // json[r'sidebarWeb'] = null; - } - return json; - } - - /// Returns a new [TagsUpdate] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TagsUpdate? fromJson(dynamic value) { - upgradeDto(value, "TagsUpdate"); - if (value is Map) { - final json = value.cast(); - - return TagsUpdate( - enabled: mapValueOfType(json, r'enabled'), - sidebarWeb: mapValueOfType(json, r'sidebarWeb'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TagsUpdate.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TagsUpdate.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TagsUpdate-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TagsUpdate.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/template_dto.dart b/mobile/openapi/lib/model/template_dto.dart deleted file mode 100644 index b1eab848ed..0000000000 --- a/mobile/openapi/lib/model/template_dto.dart +++ /dev/null @@ -1,100 +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 TemplateDto { - /// Returns a new [TemplateDto] instance. - TemplateDto({ - required this.template, - }); - - /// Template name - String template; - - @override - bool operator ==(Object other) => identical(this, other) || other is TemplateDto && - other.template == template; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (template.hashCode); - - @override - String toString() => 'TemplateDto[template=$template]'; - - Map toJson() { - final json = {}; - json[r'template'] = this.template; - return json; - } - - /// Returns a new [TemplateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TemplateDto? fromJson(dynamic value) { - upgradeDto(value, "TemplateDto"); - if (value is Map) { - final json = value.cast(); - - return TemplateDto( - template: mapValueOfType(json, r'template')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TemplateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TemplateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TemplateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TemplateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'template', - }; -} - diff --git a/mobile/openapi/lib/model/template_response_dto.dart b/mobile/openapi/lib/model/template_response_dto.dart deleted file mode 100644 index f19c1eae7d..0000000000 --- a/mobile/openapi/lib/model/template_response_dto.dart +++ /dev/null @@ -1,109 +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 TemplateResponseDto { - /// Returns a new [TemplateResponseDto] instance. - TemplateResponseDto({ - required this.html, - required this.name, - }); - - /// Template HTML content - String html; - - /// Template name - String name; - - @override - bool operator ==(Object other) => identical(this, other) || other is TemplateResponseDto && - other.html == html && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (html.hashCode) + - (name.hashCode); - - @override - String toString() => 'TemplateResponseDto[html=$html, name=$name]'; - - Map toJson() { - final json = {}; - json[r'html'] = this.html; - json[r'name'] = this.name; - return json; - } - - /// Returns a new [TemplateResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TemplateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TemplateResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TemplateResponseDto( - html: mapValueOfType(json, r'html')!, - name: mapValueOfType(json, r'name')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TemplateResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TemplateResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TemplateResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TemplateResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'html', - 'name', - }; -} - diff --git a/mobile/openapi/lib/model/test_email_response_dto.dart b/mobile/openapi/lib/model/test_email_response_dto.dart deleted file mode 100644 index e14783f3c4..0000000000 --- a/mobile/openapi/lib/model/test_email_response_dto.dart +++ /dev/null @@ -1,100 +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 TestEmailResponseDto { - /// Returns a new [TestEmailResponseDto] instance. - TestEmailResponseDto({ - required this.messageId, - }); - - /// Email message ID - String messageId; - - @override - bool operator ==(Object other) => identical(this, other) || other is TestEmailResponseDto && - other.messageId == messageId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (messageId.hashCode); - - @override - String toString() => 'TestEmailResponseDto[messageId=$messageId]'; - - Map toJson() { - final json = {}; - json[r'messageId'] = this.messageId; - return json; - } - - /// Returns a new [TestEmailResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TestEmailResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TestEmailResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TestEmailResponseDto( - messageId: mapValueOfType(json, r'messageId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TestEmailResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TestEmailResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TestEmailResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TestEmailResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'messageId', - }; -} - diff --git a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart b/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart deleted file mode 100644 index 720323cd14..0000000000 --- a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart +++ /dev/null @@ -1,286 +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 TimeBucketAssetResponseDto { - /// Returns a new [TimeBucketAssetResponseDto] instance. - TimeBucketAssetResponseDto({ - this.city = const [], - this.country = const [], - this.duration = const [], - this.fileCreatedAt = const [], - this.id = const [], - this.isFavorite = const [], - this.isImage = const [], - this.isTrashed = const [], - this.latitude = const [], - this.livePhotoVideoId = const [], - this.localOffsetHours = const [], - this.longitude = const [], - this.ownerId = const [], - this.projectionType = const [], - this.ratio = const [], - this.stack = const [], - this.thumbhash = const [], - this.visibility = const [], - }); - - /// Array of city names extracted from EXIF GPS data - List city; - - /// Array of country names extracted from EXIF GPS data - List country; - - /// Array of video durations in HH:MM:SS format (null for images) - List duration; - - /// Array of file creation timestamps in UTC - List fileCreatedAt; - - /// Array of asset IDs in the time bucket - List id; - - /// Array indicating whether each asset is favorited - List isFavorite; - - /// Array indicating whether each asset is an image (false for videos) - List isImage; - - /// Array indicating whether each asset is in the trash - List isTrashed; - - /// Array of latitude coordinates extracted from EXIF GPS data - List latitude; - - /// Array of live photo video asset IDs (null for non-live photos) - List livePhotoVideoId; - - /// Array of UTC offset hours at the time each photo was taken. Positive values are east of UTC, negative values are west of UTC. Values may be fractional (e.g., 5.5 for +05:30, -9.75 for -09:45). Applying this offset to 'fileCreatedAt' will give you the time the photo was taken from the photographer's perspective. - List localOffsetHours; - - /// Array of longitude coordinates extracted from EXIF GPS data - List longitude; - - /// Array of owner IDs for each asset - List ownerId; - - /// Array of projection types for 360° content (e.g., \"EQUIRECTANGULAR\", \"CUBEFACE\", \"CYLINDRICAL\") - List projectionType; - - /// Array of aspect ratios (width/height) for each asset - List ratio; - - /// Array of stack information as [stackId, assetCount] tuples (null for non-stacked assets) - List?> stack; - - /// Array of BlurHash strings for generating asset previews (base64 encoded) - List thumbhash; - - /// Array of visibility statuses for each asset (e.g., ARCHIVE, TIMELINE, HIDDEN, LOCKED) - List visibility; - - @override - bool operator ==(Object other) => identical(this, other) || other is TimeBucketAssetResponseDto && - _deepEquality.equals(other.city, city) && - _deepEquality.equals(other.country, country) && - _deepEquality.equals(other.duration, duration) && - _deepEquality.equals(other.fileCreatedAt, fileCreatedAt) && - _deepEquality.equals(other.id, id) && - _deepEquality.equals(other.isFavorite, isFavorite) && - _deepEquality.equals(other.isImage, isImage) && - _deepEquality.equals(other.isTrashed, isTrashed) && - _deepEquality.equals(other.latitude, latitude) && - _deepEquality.equals(other.livePhotoVideoId, livePhotoVideoId) && - _deepEquality.equals(other.localOffsetHours, localOffsetHours) && - _deepEquality.equals(other.longitude, longitude) && - _deepEquality.equals(other.ownerId, ownerId) && - _deepEquality.equals(other.projectionType, projectionType) && - _deepEquality.equals(other.ratio, ratio) && - _deepEquality.equals(other.stack, stack) && - _deepEquality.equals(other.thumbhash, thumbhash) && - _deepEquality.equals(other.visibility, visibility); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (city.hashCode) + - (country.hashCode) + - (duration.hashCode) + - (fileCreatedAt.hashCode) + - (id.hashCode) + - (isFavorite.hashCode) + - (isImage.hashCode) + - (isTrashed.hashCode) + - (latitude.hashCode) + - (livePhotoVideoId.hashCode) + - (localOffsetHours.hashCode) + - (longitude.hashCode) + - (ownerId.hashCode) + - (projectionType.hashCode) + - (ratio.hashCode) + - (stack.hashCode) + - (thumbhash.hashCode) + - (visibility.hashCode); - - @override - String toString() => 'TimeBucketAssetResponseDto[city=$city, country=$country, duration=$duration, fileCreatedAt=$fileCreatedAt, id=$id, isFavorite=$isFavorite, isImage=$isImage, isTrashed=$isTrashed, latitude=$latitude, livePhotoVideoId=$livePhotoVideoId, localOffsetHours=$localOffsetHours, longitude=$longitude, ownerId=$ownerId, projectionType=$projectionType, ratio=$ratio, stack=$stack, thumbhash=$thumbhash, visibility=$visibility]'; - - Map toJson() { - final json = {}; - json[r'city'] = this.city; - json[r'country'] = this.country; - json[r'duration'] = this.duration; - json[r'fileCreatedAt'] = this.fileCreatedAt; - json[r'id'] = this.id; - json[r'isFavorite'] = this.isFavorite; - json[r'isImage'] = this.isImage; - json[r'isTrashed'] = this.isTrashed; - json[r'latitude'] = this.latitude; - json[r'livePhotoVideoId'] = this.livePhotoVideoId; - json[r'localOffsetHours'] = this.localOffsetHours; - json[r'longitude'] = this.longitude; - json[r'ownerId'] = this.ownerId; - json[r'projectionType'] = this.projectionType; - json[r'ratio'] = this.ratio; - json[r'stack'] = this.stack; - json[r'thumbhash'] = this.thumbhash; - json[r'visibility'] = this.visibility; - return json; - } - - /// Returns a new [TimeBucketAssetResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TimeBucketAssetResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TimeBucketAssetResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TimeBucketAssetResponseDto( - city: json[r'city'] is Iterable - ? (json[r'city'] as Iterable).cast().toList(growable: false) - : const [], - country: json[r'country'] is Iterable - ? (json[r'country'] as Iterable).cast().toList(growable: false) - : const [], - duration: json[r'duration'] is Iterable - ? (json[r'duration'] as Iterable).cast().toList(growable: false) - : const [], - fileCreatedAt: json[r'fileCreatedAt'] is Iterable - ? (json[r'fileCreatedAt'] as Iterable).cast().toList(growable: false) - : const [], - id: json[r'id'] is Iterable - ? (json[r'id'] as Iterable).cast().toList(growable: false) - : const [], - isFavorite: json[r'isFavorite'] is Iterable - ? (json[r'isFavorite'] as Iterable).cast().toList(growable: false) - : const [], - isImage: json[r'isImage'] is Iterable - ? (json[r'isImage'] as Iterable).cast().toList(growable: false) - : const [], - isTrashed: json[r'isTrashed'] is Iterable - ? (json[r'isTrashed'] as Iterable).cast().toList(growable: false) - : const [], - latitude: json[r'latitude'] is Iterable - ? (json[r'latitude'] as Iterable).cast().toList(growable: false) - : const [], - livePhotoVideoId: json[r'livePhotoVideoId'] is Iterable - ? (json[r'livePhotoVideoId'] as Iterable).cast().toList(growable: false) - : const [], - localOffsetHours: json[r'localOffsetHours'] is Iterable - ? (json[r'localOffsetHours'] as Iterable).cast().toList(growable: false) - : const [], - longitude: json[r'longitude'] is Iterable - ? (json[r'longitude'] as Iterable).cast().toList(growable: false) - : const [], - ownerId: json[r'ownerId'] is Iterable - ? (json[r'ownerId'] as Iterable).cast().toList(growable: false) - : const [], - projectionType: json[r'projectionType'] is Iterable - ? (json[r'projectionType'] as Iterable).cast().toList(growable: false) - : const [], - ratio: json[r'ratio'] is Iterable - ? (json[r'ratio'] as Iterable).cast().toList(growable: false) - : const [], - stack: json[r'stack'] is List - ? (json[r'stack'] as List).map((e) => - e == null ? null : (e as List).cast() - ).toList() - : const [], - thumbhash: json[r'thumbhash'] is Iterable - ? (json[r'thumbhash'] as Iterable).cast().toList(growable: false) - : const [], - visibility: AssetVisibility.listFromJson(json[r'visibility']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TimeBucketAssetResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TimeBucketAssetResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TimeBucketAssetResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TimeBucketAssetResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'city', - 'country', - 'duration', - 'fileCreatedAt', - 'id', - 'isFavorite', - 'isImage', - 'isTrashed', - 'livePhotoVideoId', - 'localOffsetHours', - 'ownerId', - 'projectionType', - 'ratio', - 'thumbhash', - 'visibility', - }; -} - diff --git a/mobile/openapi/lib/model/time_buckets_response_dto.dart b/mobile/openapi/lib/model/time_buckets_response_dto.dart deleted file mode 100644 index 11faa815e2..0000000000 --- a/mobile/openapi/lib/model/time_buckets_response_dto.dart +++ /dev/null @@ -1,109 +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 TimeBucketsResponseDto { - /// Returns a new [TimeBucketsResponseDto] instance. - TimeBucketsResponseDto({ - required this.count, - required this.timeBucket, - }); - - /// Number of assets in this time bucket - int count; - - /// Time bucket identifier in YYYY-MM-DD format representing the start of the time period - String timeBucket; - - @override - bool operator ==(Object other) => identical(this, other) || other is TimeBucketsResponseDto && - other.count == count && - other.timeBucket == timeBucket; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode) + - (timeBucket.hashCode); - - @override - String toString() => 'TimeBucketsResponseDto[count=$count, timeBucket=$timeBucket]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - json[r'timeBucket'] = this.timeBucket; - return json; - } - - /// Returns a new [TimeBucketsResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TimeBucketsResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TimeBucketsResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TimeBucketsResponseDto( - count: mapValueOfType(json, r'count')!, - timeBucket: mapValueOfType(json, r'timeBucket')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TimeBucketsResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TimeBucketsResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TimeBucketsResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TimeBucketsResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - 'timeBucket', - }; -} - diff --git a/mobile/openapi/lib/model/tone_mapping.dart b/mobile/openapi/lib/model/tone_mapping.dart deleted file mode 100644 index a1db2f5c9c..0000000000 --- a/mobile/openapi/lib/model/tone_mapping.dart +++ /dev/null @@ -1,91 +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; - -/// Tone mapping -class ToneMapping { - /// Instantiate a new enum with the provided [value]. - const ToneMapping._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const hable = ToneMapping._(r'hable'); - static const mobius = ToneMapping._(r'mobius'); - static const reinhard = ToneMapping._(r'reinhard'); - static const disabled = ToneMapping._(r'disabled'); - - /// List of all possible values in this [enum][ToneMapping]. - static const values = [ - hable, - mobius, - reinhard, - disabled, - ]; - - static ToneMapping? fromJson(dynamic value) => ToneMappingTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ToneMapping.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [ToneMapping] to String, -/// and [decode] dynamic data back to [ToneMapping]. -class ToneMappingTypeTransformer { - factory ToneMappingTypeTransformer() => _instance ??= const ToneMappingTypeTransformer._(); - - const ToneMappingTypeTransformer._(); - - String encode(ToneMapping data) => data.value; - - /// Decodes a [dynamic value][data] to a ToneMapping. - /// - /// 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. - ToneMapping? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'hable': return ToneMapping.hable; - case r'mobius': return ToneMapping.mobius; - case r'reinhard': return ToneMapping.reinhard; - case r'disabled': return ToneMapping.disabled; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [ToneMappingTypeTransformer] instance. - static ToneMappingTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/transcode_hw_accel.dart b/mobile/openapi/lib/model/transcode_hw_accel.dart deleted file mode 100644 index 22d20de320..0000000000 --- a/mobile/openapi/lib/model/transcode_hw_accel.dart +++ /dev/null @@ -1,94 +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; - -/// Transcode hardware acceleration -class TranscodeHWAccel { - /// Instantiate a new enum with the provided [value]. - const TranscodeHWAccel._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const nvenc = TranscodeHWAccel._(r'nvenc'); - static const qsv = TranscodeHWAccel._(r'qsv'); - static const vaapi = TranscodeHWAccel._(r'vaapi'); - static const rkmpp = TranscodeHWAccel._(r'rkmpp'); - static const disabled = TranscodeHWAccel._(r'disabled'); - - /// List of all possible values in this [enum][TranscodeHWAccel]. - static const values = [ - nvenc, - qsv, - vaapi, - rkmpp, - disabled, - ]; - - static TranscodeHWAccel? fromJson(dynamic value) => TranscodeHWAccelTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TranscodeHWAccel.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [TranscodeHWAccel] to String, -/// and [decode] dynamic data back to [TranscodeHWAccel]. -class TranscodeHWAccelTypeTransformer { - factory TranscodeHWAccelTypeTransformer() => _instance ??= const TranscodeHWAccelTypeTransformer._(); - - const TranscodeHWAccelTypeTransformer._(); - - String encode(TranscodeHWAccel data) => data.value; - - /// Decodes a [dynamic value][data] to a TranscodeHWAccel. - /// - /// 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. - TranscodeHWAccel? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'nvenc': return TranscodeHWAccel.nvenc; - case r'qsv': return TranscodeHWAccel.qsv; - case r'vaapi': return TranscodeHWAccel.vaapi; - case r'rkmpp': return TranscodeHWAccel.rkmpp; - case r'disabled': return TranscodeHWAccel.disabled; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [TranscodeHWAccelTypeTransformer] instance. - static TranscodeHWAccelTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/transcode_policy.dart b/mobile/openapi/lib/model/transcode_policy.dart deleted file mode 100644 index ab3a876a93..0000000000 --- a/mobile/openapi/lib/model/transcode_policy.dart +++ /dev/null @@ -1,94 +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; - -/// Transcode policy -class TranscodePolicy { - /// Instantiate a new enum with the provided [value]. - const TranscodePolicy._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const all = TranscodePolicy._(r'all'); - static const optimal = TranscodePolicy._(r'optimal'); - static const bitrate = TranscodePolicy._(r'bitrate'); - static const required_ = TranscodePolicy._(r'required'); - static const disabled = TranscodePolicy._(r'disabled'); - - /// List of all possible values in this [enum][TranscodePolicy]. - static const values = [ - all, - optimal, - bitrate, - required_, - disabled, - ]; - - static TranscodePolicy? fromJson(dynamic value) => TranscodePolicyTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TranscodePolicy.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [TranscodePolicy] to String, -/// and [decode] dynamic data back to [TranscodePolicy]. -class TranscodePolicyTypeTransformer { - factory TranscodePolicyTypeTransformer() => _instance ??= const TranscodePolicyTypeTransformer._(); - - const TranscodePolicyTypeTransformer._(); - - String encode(TranscodePolicy data) => data.value; - - /// Decodes a [dynamic value][data] to a TranscodePolicy. - /// - /// 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. - TranscodePolicy? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'all': return TranscodePolicy.all; - case r'optimal': return TranscodePolicy.optimal; - case r'bitrate': return TranscodePolicy.bitrate; - case r'required': return TranscodePolicy.required_; - case r'disabled': return TranscodePolicy.disabled; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [TranscodePolicyTypeTransformer] instance. - static TranscodePolicyTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/trash_response_dto.dart b/mobile/openapi/lib/model/trash_response_dto.dart deleted file mode 100644 index 7edd5d032a..0000000000 --- a/mobile/openapi/lib/model/trash_response_dto.dart +++ /dev/null @@ -1,100 +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 TrashResponseDto { - /// Returns a new [TrashResponseDto] instance. - TrashResponseDto({ - required this.count, - }); - - /// Number of items in trash - int count; - - @override - bool operator ==(Object other) => identical(this, other) || other is TrashResponseDto && - other.count == count; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (count.hashCode); - - @override - String toString() => 'TrashResponseDto[count=$count]'; - - Map toJson() { - final json = {}; - json[r'count'] = this.count; - return json; - } - - /// Returns a new [TrashResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static TrashResponseDto? fromJson(dynamic value) { - upgradeDto(value, "TrashResponseDto"); - if (value is Map) { - final json = value.cast(); - - return TrashResponseDto( - count: mapValueOfType(json, r'count')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = TrashResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = TrashResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of TrashResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = TrashResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'count', - }; -} - diff --git a/mobile/openapi/lib/model/update_album_dto.dart b/mobile/openapi/lib/model/update_album_dto.dart deleted file mode 100644 index 46ce8b0ecc..0000000000 --- a/mobile/openapi/lib/model/update_album_dto.dart +++ /dev/null @@ -1,181 +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 UpdateAlbumDto { - /// Returns a new [UpdateAlbumDto] instance. - UpdateAlbumDto({ - this.albumName, - this.albumThumbnailAssetId, - this.description, - this.isActivityEnabled, - this.order, - }); - - /// Album name - /// - /// 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? albumName; - - /// Album thumbnail asset ID - /// - /// 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? albumThumbnailAssetId; - - /// Album description - /// - /// 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? description; - - /// Enable activity feed - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isActivityEnabled; - - /// Asset sort order - /// - /// 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; - - @override - bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumDto && - other.albumName == albumName && - other.albumThumbnailAssetId == albumThumbnailAssetId && - other.description == description && - other.isActivityEnabled == isActivityEnabled && - other.order == order; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albumName == null ? 0 : albumName!.hashCode) + - (albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (isActivityEnabled == null ? 0 : isActivityEnabled!.hashCode) + - (order == null ? 0 : order!.hashCode); - - @override - String toString() => 'UpdateAlbumDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, description=$description, isActivityEnabled=$isActivityEnabled, order=$order]'; - - Map toJson() { - final json = {}; - if (this.albumName != null) { - json[r'albumName'] = this.albumName; - } else { - // json[r'albumName'] = null; - } - if (this.albumThumbnailAssetId != null) { - json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; - } else { - // json[r'albumThumbnailAssetId'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.isActivityEnabled != null) { - json[r'isActivityEnabled'] = this.isActivityEnabled; - } else { - // json[r'isActivityEnabled'] = null; - } - if (this.order != null) { - json[r'order'] = this.order; - } else { - // json[r'order'] = null; - } - return json; - } - - /// Returns a new [UpdateAlbumDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UpdateAlbumDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAlbumDto"); - if (value is Map) { - final json = value.cast(); - - return UpdateAlbumDto( - albumName: mapValueOfType(json, r'albumName'), - albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), - description: mapValueOfType(json, r'description'), - isActivityEnabled: mapValueOfType(json, r'isActivityEnabled'), - order: AssetOrder.fromJson(json[r'order']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UpdateAlbumDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UpdateAlbumDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UpdateAlbumDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UpdateAlbumDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/update_album_user_dto.dart b/mobile/openapi/lib/model/update_album_user_dto.dart deleted file mode 100644 index 9d934eb465..0000000000 --- a/mobile/openapi/lib/model/update_album_user_dto.dart +++ /dev/null @@ -1,100 +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 UpdateAlbumUserDto { - /// Returns a new [UpdateAlbumUserDto] instance. - UpdateAlbumUserDto({ - required this.role, - }); - - /// Album user role - AlbumUserRole role; - - @override - bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumUserDto && - other.role == role; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (role.hashCode); - - @override - String toString() => 'UpdateAlbumUserDto[role=$role]'; - - Map toJson() { - final json = {}; - json[r'role'] = this.role; - return json; - } - - /// Returns a new [UpdateAlbumUserDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UpdateAlbumUserDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAlbumUserDto"); - if (value is Map) { - final json = value.cast(); - - return UpdateAlbumUserDto( - role: AlbumUserRole.fromJson(json[r'role'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UpdateAlbumUserDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UpdateAlbumUserDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UpdateAlbumUserDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UpdateAlbumUserDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'role', - }; -} - diff --git a/mobile/openapi/lib/model/update_asset_dto.dart b/mobile/openapi/lib/model/update_asset_dto.dart deleted file mode 100644 index 42e8ec387f..0000000000 --- a/mobile/openapi/lib/model/update_asset_dto.dart +++ /dev/null @@ -1,232 +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 UpdateAssetDto { - /// Returns a new [UpdateAssetDto] instance. - UpdateAssetDto({ - this.dateTimeOriginal, - this.description, - this.isFavorite, - this.latitude, - this.livePhotoVideoId, - this.longitude, - this.rating, - this.visibility, - }); - - /// Original date and time - /// - /// 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? dateTimeOriginal; - - /// Asset description - /// - /// 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? description; - - /// Mark as favorite - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isFavorite; - - /// Latitude coordinate - /// - /// 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. - /// - num? latitude; - - /// Live photo video ID - String? livePhotoVideoId; - - /// Longitude coordinate - /// - /// 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. - /// - num? longitude; - - /// Rating - /// - /// Minimum value: -1 - /// Maximum value: 5 - /// - /// 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. - /// - num? rating; - - /// Asset visibility - /// - /// 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. - /// - AssetVisibility? visibility; - - @override - bool operator ==(Object other) => identical(this, other) || other is UpdateAssetDto && - other.dateTimeOriginal == dateTimeOriginal && - other.description == description && - other.isFavorite == isFavorite && - other.latitude == latitude && - other.livePhotoVideoId == livePhotoVideoId && - other.longitude == longitude && - other.rating == rating && - other.visibility == visibility; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (isFavorite == null ? 0 : isFavorite!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (visibility == null ? 0 : visibility!.hashCode); - - @override - String toString() => 'UpdateAssetDto[dateTimeOriginal=$dateTimeOriginal, description=$description, isFavorite=$isFavorite, latitude=$latitude, livePhotoVideoId=$livePhotoVideoId, longitude=$longitude, rating=$rating, visibility=$visibility]'; - - Map toJson() { - final json = {}; - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal; - } else { - // json[r'dateTimeOriginal'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.isFavorite != null) { - json[r'isFavorite'] = this.isFavorite; - } else { - // json[r'isFavorite'] = null; - } - if (this.latitude != null) { - json[r'latitude'] = this.latitude; - } else { - // json[r'latitude'] = null; - } - if (this.livePhotoVideoId != null) { - json[r'livePhotoVideoId'] = this.livePhotoVideoId; - } else { - // json[r'livePhotoVideoId'] = null; - } - if (this.longitude != null) { - json[r'longitude'] = this.longitude; - } else { - // json[r'longitude'] = null; - } - if (this.rating != null) { - json[r'rating'] = this.rating; - } else { - // json[r'rating'] = null; - } - if (this.visibility != null) { - json[r'visibility'] = this.visibility; - } else { - // json[r'visibility'] = null; - } - return json; - } - - /// Returns a new [UpdateAssetDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UpdateAssetDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateAssetDto"); - if (value is Map) { - final json = value.cast(); - - return UpdateAssetDto( - dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), - description: mapValueOfType(json, r'description'), - isFavorite: mapValueOfType(json, r'isFavorite'), - latitude: num.parse('${json[r'latitude']}'), - livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), - longitude: num.parse('${json[r'longitude']}'), - rating: num.parse('${json[r'rating']}'), - visibility: AssetVisibility.fromJson(json[r'visibility']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UpdateAssetDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UpdateAssetDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UpdateAssetDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UpdateAssetDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/update_library_dto.dart b/mobile/openapi/lib/model/update_library_dto.dart deleted file mode 100644 index 628bdc0055..0000000000 --- a/mobile/openapi/lib/model/update_library_dto.dart +++ /dev/null @@ -1,129 +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 UpdateLibraryDto { - /// Returns a new [UpdateLibraryDto] instance. - UpdateLibraryDto({ - this.exclusionPatterns = const {}, - this.importPaths = const {}, - this.name, - }); - - /// Exclusion patterns (max 128) - Set exclusionPatterns; - - /// Import paths (max 128) - Set importPaths; - - /// Library name - /// - /// 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? name; - - @override - bool operator ==(Object other) => identical(this, other) || other is UpdateLibraryDto && - _deepEquality.equals(other.exclusionPatterns, exclusionPatterns) && - _deepEquality.equals(other.importPaths, importPaths) && - other.name == name; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (exclusionPatterns.hashCode) + - (importPaths.hashCode) + - (name == null ? 0 : name!.hashCode); - - @override - String toString() => 'UpdateLibraryDto[exclusionPatterns=$exclusionPatterns, importPaths=$importPaths, name=$name]'; - - Map toJson() { - final json = {}; - json[r'exclusionPatterns'] = this.exclusionPatterns.toList(growable: false); - json[r'importPaths'] = this.importPaths.toList(growable: false); - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - return json; - } - - /// Returns a new [UpdateLibraryDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UpdateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "UpdateLibraryDto"); - if (value is Map) { - final json = value.cast(); - - return UpdateLibraryDto( - exclusionPatterns: json[r'exclusionPatterns'] is Iterable - ? (json[r'exclusionPatterns'] as Iterable).cast().toSet() - : const {}, - importPaths: json[r'importPaths'] is Iterable - ? (json[r'importPaths'] as Iterable).cast().toSet() - : const {}, - name: mapValueOfType(json, r'name'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UpdateLibraryDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UpdateLibraryDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UpdateLibraryDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UpdateLibraryDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/usage_by_user_dto.dart b/mobile/openapi/lib/model/usage_by_user_dto.dart deleted file mode 100644 index da1fe600a5..0000000000 --- a/mobile/openapi/lib/model/usage_by_user_dto.dart +++ /dev/null @@ -1,167 +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 UsageByUserDto { - /// Returns a new [UsageByUserDto] instance. - UsageByUserDto({ - required this.photos, - required this.quotaSizeInBytes, - required this.usage, - required this.usagePhotos, - required this.usageVideos, - required this.userId, - required this.userName, - required this.videos, - }); - - /// Number of photos - int photos; - - /// User quota size in bytes (null if unlimited) - int? quotaSizeInBytes; - - /// Total storage usage in bytes - int usage; - - /// Storage usage for photos in bytes - int usagePhotos; - - /// Storage usage for videos in bytes - int usageVideos; - - /// User ID - String userId; - - /// User name - String userName; - - /// Number of videos - int videos; - - @override - bool operator ==(Object other) => identical(this, other) || other is UsageByUserDto && - other.photos == photos && - other.quotaSizeInBytes == quotaSizeInBytes && - other.usage == usage && - other.usagePhotos == usagePhotos && - other.usageVideos == usageVideos && - other.userId == userId && - other.userName == userName && - other.videos == videos; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (photos.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (usage.hashCode) + - (usagePhotos.hashCode) + - (usageVideos.hashCode) + - (userId.hashCode) + - (userName.hashCode) + - (videos.hashCode); - - @override - String toString() => 'UsageByUserDto[photos=$photos, quotaSizeInBytes=$quotaSizeInBytes, usage=$usage, usagePhotos=$usagePhotos, usageVideos=$usageVideos, userId=$userId, userName=$userName, videos=$videos]'; - - Map toJson() { - final json = {}; - json[r'photos'] = this.photos; - if (this.quotaSizeInBytes != null) { - json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; - } else { - // json[r'quotaSizeInBytes'] = null; - } - json[r'usage'] = this.usage; - json[r'usagePhotos'] = this.usagePhotos; - json[r'usageVideos'] = this.usageVideos; - json[r'userId'] = this.userId; - json[r'userName'] = this.userName; - json[r'videos'] = this.videos; - return json; - } - - /// Returns a new [UsageByUserDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UsageByUserDto? fromJson(dynamic value) { - upgradeDto(value, "UsageByUserDto"); - if (value is Map) { - final json = value.cast(); - - return UsageByUserDto( - photos: mapValueOfType(json, r'photos')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - usage: mapValueOfType(json, r'usage')!, - usagePhotos: mapValueOfType(json, r'usagePhotos')!, - usageVideos: mapValueOfType(json, r'usageVideos')!, - userId: mapValueOfType(json, r'userId')!, - userName: mapValueOfType(json, r'userName')!, - videos: mapValueOfType(json, r'videos')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UsageByUserDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UsageByUserDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UsageByUserDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UsageByUserDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'photos', - 'quotaSizeInBytes', - 'usage', - 'usagePhotos', - 'usageVideos', - 'userId', - 'userName', - 'videos', - }; -} - diff --git a/mobile/openapi/lib/model/user_admin_create_dto.dart b/mobile/openapi/lib/model/user_admin_create_dto.dart deleted file mode 100644 index 485b2e00e5..0000000000 --- a/mobile/openapi/lib/model/user_admin_create_dto.dart +++ /dev/null @@ -1,222 +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 UserAdminCreateDto { - /// Returns a new [UserAdminCreateDto] instance. - UserAdminCreateDto({ - this.avatarColor, - required this.email, - this.isAdmin, - required this.name, - this.notify, - required this.password, - this.pinCode, - this.quotaSizeInBytes, - this.shouldChangePassword, - this.storageLabel, - }); - - /// Avatar color - UserAvatarColor? avatarColor; - - /// User email - String email; - - /// Grant admin privileges - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isAdmin; - - /// User name - String name; - - /// Send notification email - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? notify; - - /// User password - String password; - - /// PIN code - String? pinCode; - - /// Storage quota in bytes - /// - /// Minimum value: 0 - int? quotaSizeInBytes; - - /// Require password change on next login - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? shouldChangePassword; - - /// Storage label - String? storageLabel; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserAdminCreateDto && - other.avatarColor == avatarColor && - other.email == email && - other.isAdmin == isAdmin && - other.name == name && - other.notify == notify && - other.password == password && - other.pinCode == pinCode && - other.quotaSizeInBytes == quotaSizeInBytes && - other.shouldChangePassword == shouldChangePassword && - other.storageLabel == storageLabel; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + - (email.hashCode) + - (isAdmin == null ? 0 : isAdmin!.hashCode) + - (name.hashCode) + - (notify == null ? 0 : notify!.hashCode) + - (password.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode); - - @override - String toString() => 'UserAdminCreateDto[avatarColor=$avatarColor, email=$email, isAdmin=$isAdmin, name=$name, notify=$notify, password=$password, pinCode=$pinCode, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]'; - - Map toJson() { - final json = {}; - if (this.avatarColor != null) { - json[r'avatarColor'] = this.avatarColor; - } else { - // json[r'avatarColor'] = null; - } - json[r'email'] = this.email; - if (this.isAdmin != null) { - json[r'isAdmin'] = this.isAdmin; - } else { - // json[r'isAdmin'] = null; - } - json[r'name'] = this.name; - if (this.notify != null) { - json[r'notify'] = this.notify; - } else { - // json[r'notify'] = null; - } - json[r'password'] = this.password; - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - if (this.quotaSizeInBytes != null) { - json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; - } else { - // json[r'quotaSizeInBytes'] = null; - } - if (this.shouldChangePassword != null) { - json[r'shouldChangePassword'] = this.shouldChangePassword; - } else { - // json[r'shouldChangePassword'] = null; - } - if (this.storageLabel != null) { - json[r'storageLabel'] = this.storageLabel; - } else { - // json[r'storageLabel'] = null; - } - return json; - } - - /// Returns a new [UserAdminCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserAdminCreateDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminCreateDto"); - if (value is Map) { - final json = value.cast(); - - return UserAdminCreateDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), - email: mapValueOfType(json, r'email')!, - isAdmin: mapValueOfType(json, r'isAdmin'), - name: mapValueOfType(json, r'name')!, - notify: mapValueOfType(json, r'notify'), - password: mapValueOfType(json, r'password')!, - pinCode: mapValueOfType(json, r'pinCode'), - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - shouldChangePassword: mapValueOfType(json, r'shouldChangePassword'), - storageLabel: mapValueOfType(json, r'storageLabel'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserAdminCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserAdminCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserAdminCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserAdminCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'email', - 'name', - 'password', - }; -} - diff --git a/mobile/openapi/lib/model/user_admin_delete_dto.dart b/mobile/openapi/lib/model/user_admin_delete_dto.dart deleted file mode 100644 index 6be70f37b7..0000000000 --- a/mobile/openapi/lib/model/user_admin_delete_dto.dart +++ /dev/null @@ -1,109 +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 UserAdminDeleteDto { - /// Returns a new [UserAdminDeleteDto] instance. - UserAdminDeleteDto({ - this.force, - }); - - /// Force delete even if user has assets - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? force; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserAdminDeleteDto && - other.force == force; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (force == null ? 0 : force!.hashCode); - - @override - String toString() => 'UserAdminDeleteDto[force=$force]'; - - Map toJson() { - final json = {}; - if (this.force != null) { - json[r'force'] = this.force; - } else { - // json[r'force'] = null; - } - return json; - } - - /// Returns a new [UserAdminDeleteDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserAdminDeleteDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminDeleteDto"); - if (value is Map) { - final json = value.cast(); - - return UserAdminDeleteDto( - force: mapValueOfType(json, r'force'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserAdminDeleteDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserAdminDeleteDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserAdminDeleteDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserAdminDeleteDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/user_admin_response_dto.dart b/mobile/openapi/lib/model/user_admin_response_dto.dart index 706f65cf35..a26db706f2 100644 --- a/mobile/openapi/lib/model/user_admin_response_dto.dart +++ b/mobile/openapi/lib/model/user_admin_response_dto.dart @@ -13,27 +13,31 @@ part of openapi.api; class UserAdminResponseDto { /// Returns a new [UserAdminResponseDto] instance. UserAdminResponseDto({ - required this.avatarColor, + required this.id, + required this.name, + required this.email, + required this.shouldChangePassword, + required this.isAdmin, required this.createdAt, required this.deletedAt, - required this.email, - required this.id, - required this.isAdmin, - required this.license, - required this.name, - required this.oauthId, - required this.profileChangedAt, - required this.profileImagePath, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, - required this.shouldChangePassword, - required this.status, - required this.storageLabel, required this.updatedAt, + required this.status, }); - /// Avatar color - UserAvatarColor avatarColor; + /// User ID + String id; + + /// User name + String name; + + /// User email + String email; + + /// Require password change on next login + bool shouldChangePassword; + + /// Is admin user + bool isAdmin; /// Creation date DateTime createdAt; @@ -41,131 +45,55 @@ class UserAdminResponseDto { /// Deletion date DateTime? deletedAt; - /// User email - String email; - - /// User ID - String id; - - /// Is admin user - bool isAdmin; - - /// User license - UserLicense? license; - - /// User name - String name; - - /// OAuth ID - String oauthId; - - /// Profile change date - DateTime profileChangedAt; - - /// Profile image path - String profileImagePath; - - /// Storage quota in bytes - int? quotaSizeInBytes; - - /// Storage usage in bytes - int? quotaUsageInBytes; - - /// Require password change on next login - bool shouldChangePassword; + /// Last update date + DateTime updatedAt; /// User status UserStatus status; - /// Storage label - String? storageLabel; - - /// Last update date - DateTime updatedAt; - @override bool operator ==(Object other) => identical(this, other) || other is UserAdminResponseDto && - other.avatarColor == avatarColor && + other.id == id && + other.name == name && + other.email == email && + other.shouldChangePassword == shouldChangePassword && + other.isAdmin == isAdmin && other.createdAt == createdAt && other.deletedAt == deletedAt && - other.email == email && - other.id == id && - other.isAdmin == isAdmin && - other.license == license && - other.name == name && - other.oauthId == oauthId && - other.profileChangedAt == profileChangedAt && - other.profileImagePath == profileImagePath && - other.quotaSizeInBytes == quotaSizeInBytes && - other.quotaUsageInBytes == quotaUsageInBytes && - other.shouldChangePassword == shouldChangePassword && - other.status == status && - other.storageLabel == storageLabel && - other.updatedAt == updatedAt; + other.updatedAt == updatedAt && + other.status == status; @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor.hashCode) + + (id.hashCode) + + (name.hashCode) + + (email.hashCode) + + (shouldChangePassword.hashCode) + + (isAdmin.hashCode) + (createdAt.hashCode) + (deletedAt == null ? 0 : deletedAt!.hashCode) + - (email.hashCode) + - (id.hashCode) + - (isAdmin.hashCode) + - (license == null ? 0 : license!.hashCode) + - (name.hashCode) + - (oauthId.hashCode) + - (profileChangedAt.hashCode) + - (profileImagePath.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) + - (shouldChangePassword.hashCode) + - (status.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode) + - (updatedAt.hashCode); + (updatedAt.hashCode) + + (status.hashCode); @override - String toString() => 'UserAdminResponseDto[avatarColor=$avatarColor, createdAt=$createdAt, deletedAt=$deletedAt, email=$email, id=$id, isAdmin=$isAdmin, license=$license, name=$name, oauthId=$oauthId, profileChangedAt=$profileChangedAt, profileImagePath=$profileImagePath, quotaSizeInBytes=$quotaSizeInBytes, quotaUsageInBytes=$quotaUsageInBytes, shouldChangePassword=$shouldChangePassword, status=$status, storageLabel=$storageLabel, updatedAt=$updatedAt]'; + String toString() => 'UserAdminResponseDto[id=$id, name=$name, email=$email, shouldChangePassword=$shouldChangePassword, isAdmin=$isAdmin, createdAt=$createdAt, deletedAt=$deletedAt, updatedAt=$updatedAt, status=$status]'; Map toJson() { final json = {}; - json[r'avatarColor'] = this.avatarColor; + json[r'id'] = this.id; + json[r'name'] = this.name; + json[r'email'] = this.email; + json[r'shouldChangePassword'] = this.shouldChangePassword; + json[r'isAdmin'] = this.isAdmin; json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); if (this.deletedAt != null) { json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); } else { // json[r'deletedAt'] = null; - } - json[r'email'] = this.email; - json[r'id'] = this.id; - json[r'isAdmin'] = this.isAdmin; - if (this.license != null) { - json[r'license'] = this.license; - } else { - // json[r'license'] = null; - } - json[r'name'] = this.name; - json[r'oauthId'] = this.oauthId; - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - json[r'profileImagePath'] = this.profileImagePath; - if (this.quotaSizeInBytes != null) { - json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; - } else { - // json[r'quotaSizeInBytes'] = null; - } - if (this.quotaUsageInBytes != null) { - json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; - } else { - // json[r'quotaUsageInBytes'] = null; - } - json[r'shouldChangePassword'] = this.shouldChangePassword; - json[r'status'] = this.status; - if (this.storageLabel != null) { - json[r'storageLabel'] = this.storageLabel; - } else { - // json[r'storageLabel'] = null; } json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); + json[r'status'] = this.status; return json; } @@ -178,23 +106,15 @@ class UserAdminResponseDto { final json = value.cast(); return UserAdminResponseDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, + id: mapValueOfType(json, r'id')!, + name: mapValueOfType(json, r'name')!, + email: mapValueOfType(json, r'email')!, + shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, + isAdmin: mapValueOfType(json, r'isAdmin')!, createdAt: mapDateTime(json, r'createdAt', r'')!, deletedAt: mapDateTime(json, r'deletedAt', r''), - email: mapValueOfType(json, r'email')!, - id: mapValueOfType(json, r'id')!, - isAdmin: mapValueOfType(json, r'isAdmin')!, - license: UserLicense.fromJson(json[r'license']), - name: mapValueOfType(json, r'name')!, - oauthId: mapValueOfType(json, r'oauthId')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - profileImagePath: mapValueOfType(json, r'profileImagePath')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - quotaUsageInBytes: mapValueOfType(json, r'quotaUsageInBytes'), - shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, - status: UserStatus.fromJson(json[r'status'])!, - storageLabel: mapValueOfType(json, r'storageLabel'), updatedAt: mapDateTime(json, r'updatedAt', r'')!, + status: UserStatus.fromJson(json[r'status'])!, ); } return null; @@ -242,23 +162,15 @@ class UserAdminResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'avatarColor', + 'id', + 'name', + 'email', + 'shouldChangePassword', + 'isAdmin', 'createdAt', 'deletedAt', - 'email', - 'id', - 'isAdmin', - 'license', - 'name', - 'oauthId', - 'profileChangedAt', - 'profileImagePath', - 'quotaSizeInBytes', - 'quotaUsageInBytes', - 'shouldChangePassword', - 'status', - 'storageLabel', 'updatedAt', + 'status', }; } diff --git a/mobile/openapi/lib/model/user_admin_update_dto.dart b/mobile/openapi/lib/model/user_admin_update_dto.dart deleted file mode 100644 index 3cce65745f..0000000000 --- a/mobile/openapi/lib/model/user_admin_update_dto.dart +++ /dev/null @@ -1,231 +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 UserAdminUpdateDto { - /// Returns a new [UserAdminUpdateDto] instance. - UserAdminUpdateDto({ - this.avatarColor, - this.email, - this.isAdmin, - this.name, - this.password, - this.pinCode, - this.quotaSizeInBytes, - this.shouldChangePassword, - this.storageLabel, - }); - - /// Avatar color - UserAvatarColor? avatarColor; - - /// User email - /// - /// 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? email; - - /// Grant admin privileges - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? isAdmin; - - /// User name - /// - /// 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? name; - - /// User password - /// - /// 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? password; - - /// PIN code - String? pinCode; - - /// Storage quota in bytes - /// - /// Minimum value: 0 - int? quotaSizeInBytes; - - /// Require password change on next login - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? shouldChangePassword; - - /// Storage label - String? storageLabel; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserAdminUpdateDto && - other.avatarColor == avatarColor && - other.email == email && - other.isAdmin == isAdmin && - other.name == name && - other.password == password && - other.pinCode == pinCode && - other.quotaSizeInBytes == quotaSizeInBytes && - other.shouldChangePassword == shouldChangePassword && - other.storageLabel == storageLabel; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + - (email == null ? 0 : email!.hashCode) + - (isAdmin == null ? 0 : isAdmin!.hashCode) + - (name == null ? 0 : name!.hashCode) + - (password == null ? 0 : password!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode); - - @override - String toString() => 'UserAdminUpdateDto[avatarColor=$avatarColor, email=$email, isAdmin=$isAdmin, name=$name, password=$password, pinCode=$pinCode, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]'; - - Map toJson() { - final json = {}; - if (this.avatarColor != null) { - json[r'avatarColor'] = this.avatarColor; - } else { - // json[r'avatarColor'] = null; - } - if (this.email != null) { - json[r'email'] = this.email; - } else { - // json[r'email'] = null; - } - if (this.isAdmin != null) { - json[r'isAdmin'] = this.isAdmin; - } else { - // json[r'isAdmin'] = null; - } - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } - if (this.pinCode != null) { - json[r'pinCode'] = this.pinCode; - } else { - // json[r'pinCode'] = null; - } - if (this.quotaSizeInBytes != null) { - json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; - } else { - // json[r'quotaSizeInBytes'] = null; - } - if (this.shouldChangePassword != null) { - json[r'shouldChangePassword'] = this.shouldChangePassword; - } else { - // json[r'shouldChangePassword'] = null; - } - if (this.storageLabel != null) { - json[r'storageLabel'] = this.storageLabel; - } else { - // json[r'storageLabel'] = null; - } - return json; - } - - /// Returns a new [UserAdminUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserAdminUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "UserAdminUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return UserAdminUpdateDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), - email: mapValueOfType(json, r'email'), - isAdmin: mapValueOfType(json, r'isAdmin'), - name: mapValueOfType(json, r'name'), - password: mapValueOfType(json, r'password'), - pinCode: mapValueOfType(json, r'pinCode'), - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - shouldChangePassword: mapValueOfType(json, r'shouldChangePassword'), - storageLabel: mapValueOfType(json, r'storageLabel'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserAdminUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserAdminUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserAdminUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserAdminUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/user_avatar_color.dart b/mobile/openapi/lib/model/user_avatar_color.dart deleted file mode 100644 index 4fcf518550..0000000000 --- a/mobile/openapi/lib/model/user_avatar_color.dart +++ /dev/null @@ -1,109 +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; - -/// Avatar color -class UserAvatarColor { - /// Instantiate a new enum with the provided [value]. - const UserAvatarColor._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const primary = UserAvatarColor._(r'primary'); - static const pink = UserAvatarColor._(r'pink'); - static const red = UserAvatarColor._(r'red'); - static const yellow = UserAvatarColor._(r'yellow'); - static const blue = UserAvatarColor._(r'blue'); - static const green = UserAvatarColor._(r'green'); - static const purple = UserAvatarColor._(r'purple'); - static const orange = UserAvatarColor._(r'orange'); - static const gray = UserAvatarColor._(r'gray'); - static const amber = UserAvatarColor._(r'amber'); - - /// List of all possible values in this [enum][UserAvatarColor]. - static const values = [ - primary, - pink, - red, - yellow, - blue, - green, - purple, - orange, - gray, - amber, - ]; - - static UserAvatarColor? fromJson(dynamic value) => UserAvatarColorTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserAvatarColor.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [UserAvatarColor] to String, -/// and [decode] dynamic data back to [UserAvatarColor]. -class UserAvatarColorTypeTransformer { - factory UserAvatarColorTypeTransformer() => _instance ??= const UserAvatarColorTypeTransformer._(); - - const UserAvatarColorTypeTransformer._(); - - String encode(UserAvatarColor data) => data.value; - - /// Decodes a [dynamic value][data] to a UserAvatarColor. - /// - /// 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. - UserAvatarColor? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'primary': return UserAvatarColor.primary; - case r'pink': return UserAvatarColor.pink; - case r'red': return UserAvatarColor.red; - case r'yellow': return UserAvatarColor.yellow; - case r'blue': return UserAvatarColor.blue; - case r'green': return UserAvatarColor.green; - case r'purple': return UserAvatarColor.purple; - case r'orange': return UserAvatarColor.orange; - case r'gray': return UserAvatarColor.gray; - case r'amber': return UserAvatarColor.amber; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [UserAvatarColorTypeTransformer] instance. - static UserAvatarColorTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/user_license.dart b/mobile/openapi/lib/model/user_license.dart deleted file mode 100644 index f02dc73bef..0000000000 --- a/mobile/openapi/lib/model/user_license.dart +++ /dev/null @@ -1,118 +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 UserLicense { - /// Returns a new [UserLicense] instance. - UserLicense({ - required this.activatedAt, - required this.activationKey, - required this.licenseKey, - }); - - /// Activation date - DateTime activatedAt; - - /// Activation key - String activationKey; - - /// License key - String licenseKey; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserLicense && - other.activatedAt == activatedAt && - other.activationKey == activationKey && - other.licenseKey == licenseKey; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (activatedAt.hashCode) + - (activationKey.hashCode) + - (licenseKey.hashCode); - - @override - String toString() => 'UserLicense[activatedAt=$activatedAt, activationKey=$activationKey, licenseKey=$licenseKey]'; - - Map toJson() { - final json = {}; - json[r'activatedAt'] = this.activatedAt.toUtc().toIso8601String(); - json[r'activationKey'] = this.activationKey; - json[r'licenseKey'] = this.licenseKey; - return json; - } - - /// Returns a new [UserLicense] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserLicense? fromJson(dynamic value) { - upgradeDto(value, "UserLicense"); - if (value is Map) { - final json = value.cast(); - - return UserLicense( - activatedAt: mapDateTime(json, r'activatedAt', r'')!, - activationKey: mapValueOfType(json, r'activationKey')!, - licenseKey: mapValueOfType(json, r'licenseKey')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserLicense.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserLicense.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserLicense-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserLicense.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'activatedAt', - 'activationKey', - 'licenseKey', - }; -} - diff --git a/mobile/openapi/lib/model/user_metadata_key.dart b/mobile/openapi/lib/model/user_metadata_key.dart deleted file mode 100644 index 2b4c11a73d..0000000000 --- a/mobile/openapi/lib/model/user_metadata_key.dart +++ /dev/null @@ -1,88 +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; - -/// User metadata key -class UserMetadataKey { - /// Instantiate a new enum with the provided [value]. - const UserMetadataKey._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const preferences = UserMetadataKey._(r'preferences'); - static const license = UserMetadataKey._(r'license'); - static const onboarding = UserMetadataKey._(r'onboarding'); - - /// List of all possible values in this [enum][UserMetadataKey]. - static const values = [ - preferences, - license, - onboarding, - ]; - - static UserMetadataKey? fromJson(dynamic value) => UserMetadataKeyTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserMetadataKey.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [UserMetadataKey] to String, -/// and [decode] dynamic data back to [UserMetadataKey]. -class UserMetadataKeyTypeTransformer { - factory UserMetadataKeyTypeTransformer() => _instance ??= const UserMetadataKeyTypeTransformer._(); - - const UserMetadataKeyTypeTransformer._(); - - String encode(UserMetadataKey data) => data.value; - - /// Decodes a [dynamic value][data] to a UserMetadataKey. - /// - /// 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. - UserMetadataKey? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'preferences': return UserMetadataKey.preferences; - case r'license': return UserMetadataKey.license; - case r'onboarding': return UserMetadataKey.onboarding; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [UserMetadataKeyTypeTransformer] instance. - static UserMetadataKeyTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/user_preferences_response_dto.dart b/mobile/openapi/lib/model/user_preferences_response_dto.dart deleted file mode 100644 index 7a6e0252af..0000000000 --- a/mobile/openapi/lib/model/user_preferences_response_dto.dart +++ /dev/null @@ -1,179 +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 UserPreferencesResponseDto { - /// Returns a new [UserPreferencesResponseDto] instance. - UserPreferencesResponseDto({ - required this.albums, - required this.cast, - required this.download, - required this.emailNotifications, - required this.folders, - required this.memories, - required this.people, - required this.purchase, - required this.ratings, - required this.sharedLinks, - required this.tags, - }); - - AlbumsResponse albums; - - CastResponse cast; - - DownloadResponse download; - - EmailNotificationsResponse emailNotifications; - - FoldersResponse folders; - - MemoriesResponse memories; - - PeopleResponse people; - - PurchaseResponse purchase; - - RatingsResponse ratings; - - SharedLinksResponse sharedLinks; - - TagsResponse tags; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserPreferencesResponseDto && - other.albums == albums && - other.cast == cast && - other.download == download && - other.emailNotifications == emailNotifications && - other.folders == folders && - other.memories == memories && - other.people == people && - other.purchase == purchase && - other.ratings == ratings && - other.sharedLinks == sharedLinks && - other.tags == tags; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albums.hashCode) + - (cast.hashCode) + - (download.hashCode) + - (emailNotifications.hashCode) + - (folders.hashCode) + - (memories.hashCode) + - (people.hashCode) + - (purchase.hashCode) + - (ratings.hashCode) + - (sharedLinks.hashCode) + - (tags.hashCode); - - @override - String toString() => 'UserPreferencesResponseDto[albums=$albums, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]'; - - Map toJson() { - final json = {}; - json[r'albums'] = this.albums; - json[r'cast'] = this.cast; - json[r'download'] = this.download; - json[r'emailNotifications'] = this.emailNotifications; - json[r'folders'] = this.folders; - json[r'memories'] = this.memories; - json[r'people'] = this.people; - json[r'purchase'] = this.purchase; - json[r'ratings'] = this.ratings; - json[r'sharedLinks'] = this.sharedLinks; - json[r'tags'] = this.tags; - return json; - } - - /// Returns a new [UserPreferencesResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserPreferencesResponseDto? fromJson(dynamic value) { - upgradeDto(value, "UserPreferencesResponseDto"); - if (value is Map) { - final json = value.cast(); - - return UserPreferencesResponseDto( - albums: AlbumsResponse.fromJson(json[r'albums'])!, - cast: CastResponse.fromJson(json[r'cast'])!, - download: DownloadResponse.fromJson(json[r'download'])!, - emailNotifications: EmailNotificationsResponse.fromJson(json[r'emailNotifications'])!, - folders: FoldersResponse.fromJson(json[r'folders'])!, - memories: MemoriesResponse.fromJson(json[r'memories'])!, - people: PeopleResponse.fromJson(json[r'people'])!, - purchase: PurchaseResponse.fromJson(json[r'purchase'])!, - ratings: RatingsResponse.fromJson(json[r'ratings'])!, - sharedLinks: SharedLinksResponse.fromJson(json[r'sharedLinks'])!, - tags: TagsResponse.fromJson(json[r'tags'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserPreferencesResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserPreferencesResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserPreferencesResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserPreferencesResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'albums', - 'cast', - 'download', - 'emailNotifications', - 'folders', - 'memories', - 'people', - 'purchase', - 'ratings', - 'sharedLinks', - 'tags', - }; -} - diff --git a/mobile/openapi/lib/model/user_preferences_update_dto.dart b/mobile/openapi/lib/model/user_preferences_update_dto.dart deleted file mode 100644 index 3b9b178b55..0000000000 --- a/mobile/openapi/lib/model/user_preferences_update_dto.dart +++ /dev/null @@ -1,295 +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 UserPreferencesUpdateDto { - /// Returns a new [UserPreferencesUpdateDto] instance. - UserPreferencesUpdateDto({ - this.albums, - this.avatar, - this.cast, - this.download, - this.emailNotifications, - this.folders, - this.memories, - this.people, - this.purchase, - this.ratings, - this.sharedLinks, - this.tags, - }); - - /// - /// 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. - /// - AlbumsUpdate? albums; - - /// - /// 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. - /// - AvatarUpdate? avatar; - - /// - /// 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. - /// - CastUpdate? cast; - - /// - /// 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. - /// - DownloadUpdate? download; - - /// - /// 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. - /// - EmailNotificationsUpdate? emailNotifications; - - /// - /// 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. - /// - FoldersUpdate? folders; - - /// - /// 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. - /// - MemoriesUpdate? memories; - - /// - /// 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. - /// - PeopleUpdate? people; - - /// - /// 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. - /// - PurchaseUpdate? purchase; - - /// - /// 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. - /// - RatingsUpdate? ratings; - - /// - /// 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. - /// - SharedLinksUpdate? sharedLinks; - - /// - /// 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. - /// - TagsUpdate? tags; - - @override - bool operator ==(Object other) => identical(this, other) || other is UserPreferencesUpdateDto && - other.albums == albums && - other.avatar == avatar && - other.cast == cast && - other.download == download && - other.emailNotifications == emailNotifications && - other.folders == folders && - other.memories == memories && - other.people == people && - other.purchase == purchase && - other.ratings == ratings && - other.sharedLinks == sharedLinks && - other.tags == tags; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (albums == null ? 0 : albums!.hashCode) + - (avatar == null ? 0 : avatar!.hashCode) + - (cast == null ? 0 : cast!.hashCode) + - (download == null ? 0 : download!.hashCode) + - (emailNotifications == null ? 0 : emailNotifications!.hashCode) + - (folders == null ? 0 : folders!.hashCode) + - (memories == null ? 0 : memories!.hashCode) + - (people == null ? 0 : people!.hashCode) + - (purchase == null ? 0 : purchase!.hashCode) + - (ratings == null ? 0 : ratings!.hashCode) + - (sharedLinks == null ? 0 : sharedLinks!.hashCode) + - (tags == null ? 0 : tags!.hashCode); - - @override - String toString() => 'UserPreferencesUpdateDto[albums=$albums, avatar=$avatar, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]'; - - Map toJson() { - final json = {}; - if (this.albums != null) { - json[r'albums'] = this.albums; - } else { - // json[r'albums'] = null; - } - if (this.avatar != null) { - json[r'avatar'] = this.avatar; - } else { - // json[r'avatar'] = null; - } - if (this.cast != null) { - json[r'cast'] = this.cast; - } else { - // json[r'cast'] = null; - } - if (this.download != null) { - json[r'download'] = this.download; - } else { - // json[r'download'] = null; - } - if (this.emailNotifications != null) { - json[r'emailNotifications'] = this.emailNotifications; - } else { - // json[r'emailNotifications'] = null; - } - if (this.folders != null) { - json[r'folders'] = this.folders; - } else { - // json[r'folders'] = null; - } - if (this.memories != null) { - json[r'memories'] = this.memories; - } else { - // json[r'memories'] = null; - } - if (this.people != null) { - json[r'people'] = this.people; - } else { - // json[r'people'] = null; - } - if (this.purchase != null) { - json[r'purchase'] = this.purchase; - } else { - // json[r'purchase'] = null; - } - if (this.ratings != null) { - json[r'ratings'] = this.ratings; - } else { - // json[r'ratings'] = null; - } - if (this.sharedLinks != null) { - json[r'sharedLinks'] = this.sharedLinks; - } else { - // json[r'sharedLinks'] = null; - } - if (this.tags != null) { - json[r'tags'] = this.tags; - } else { - // json[r'tags'] = null; - } - return json; - } - - /// Returns a new [UserPreferencesUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static UserPreferencesUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "UserPreferencesUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return UserPreferencesUpdateDto( - albums: AlbumsUpdate.fromJson(json[r'albums']), - avatar: AvatarUpdate.fromJson(json[r'avatar']), - cast: CastUpdate.fromJson(json[r'cast']), - download: DownloadUpdate.fromJson(json[r'download']), - emailNotifications: EmailNotificationsUpdate.fromJson(json[r'emailNotifications']), - folders: FoldersUpdate.fromJson(json[r'folders']), - memories: MemoriesUpdate.fromJson(json[r'memories']), - people: PeopleUpdate.fromJson(json[r'people']), - purchase: PurchaseUpdate.fromJson(json[r'purchase']), - ratings: RatingsUpdate.fromJson(json[r'ratings']), - sharedLinks: SharedLinksUpdate.fromJson(json[r'sharedLinks']), - tags: TagsUpdate.fromJson(json[r'tags']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = UserPreferencesUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = UserPreferencesUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of UserPreferencesUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = UserPreferencesUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/user_response_dto.dart b/mobile/openapi/lib/model/user_response_dto.dart index bf0e2cbf09..70298debbe 100644 --- a/mobile/openapi/lib/model/user_response_dto.dart +++ b/mobile/openapi/lib/model/user_response_dto.dart @@ -13,62 +13,41 @@ part of openapi.api; class UserResponseDto { /// Returns a new [UserResponseDto] instance. UserResponseDto({ - required this.avatarColor, - required this.email, required this.id, required this.name, - required this.profileChangedAt, - required this.profileImagePath, + required this.email, }); - /// Avatar color - UserAvatarColor avatarColor; - - /// User email - String email; - /// User ID String id; /// User name String name; - /// Profile change date - DateTime profileChangedAt; - - /// Profile image path - String profileImagePath; + /// User email + String email; @override bool operator ==(Object other) => identical(this, other) || other is UserResponseDto && - other.avatarColor == avatarColor && - other.email == email && other.id == id && other.name == name && - other.profileChangedAt == profileChangedAt && - other.profileImagePath == profileImagePath; + other.email == email; @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor.hashCode) + - (email.hashCode) + (id.hashCode) + (name.hashCode) + - (profileChangedAt.hashCode) + - (profileImagePath.hashCode); + (email.hashCode); @override - String toString() => 'UserResponseDto[avatarColor=$avatarColor, email=$email, id=$id, name=$name, profileChangedAt=$profileChangedAt, profileImagePath=$profileImagePath]'; + String toString() => 'UserResponseDto[id=$id, name=$name, email=$email]'; Map toJson() { final json = {}; - json[r'avatarColor'] = this.avatarColor; - json[r'email'] = this.email; json[r'id'] = this.id; json[r'name'] = this.name; - json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); - json[r'profileImagePath'] = this.profileImagePath; + json[r'email'] = this.email; return json; } @@ -81,12 +60,9 @@ class UserResponseDto { final json = value.cast(); return UserResponseDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, - email: mapValueOfType(json, r'email')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, - profileImagePath: mapValueOfType(json, r'profileImagePath')!, + email: mapValueOfType(json, r'email')!, ); } return null; @@ -134,12 +110,9 @@ class UserResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { - 'avatarColor', - 'email', 'id', 'name', - 'profileChangedAt', - 'profileImagePath', + 'email', }; } diff --git a/mobile/openapi/lib/model/user_update_me_dto.dart b/mobile/openapi/lib/model/user_update_me_dto.dart index 066c435eb3..b943a5d6cd 100644 --- a/mobile/openapi/lib/model/user_update_me_dto.dart +++ b/mobile/openapi/lib/model/user_update_me_dto.dart @@ -13,15 +13,10 @@ part of openapi.api; class UserUpdateMeDto { /// Returns a new [UserUpdateMeDto] instance. UserUpdateMeDto({ - this.avatarColor, this.email, this.name, - this.password, }); - /// Avatar color - UserAvatarColor? avatarColor; - /// User email /// /// Please note: This property should have been non-nullable! Since the specification file @@ -40,40 +35,22 @@ class UserUpdateMeDto { /// String? name; - /// User password (deprecated, use change password endpoint) - /// - /// 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? password; - @override bool operator ==(Object other) => identical(this, other) || other is UserUpdateMeDto && - other.avatarColor == avatarColor && other.email == email && - other.name == name && - other.password == password; + other.name == name; @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + (email == null ? 0 : email!.hashCode) + - (name == null ? 0 : name!.hashCode) + - (password == null ? 0 : password!.hashCode); + (name == null ? 0 : name!.hashCode); @override - String toString() => 'UserUpdateMeDto[avatarColor=$avatarColor, email=$email, name=$name, password=$password]'; + String toString() => 'UserUpdateMeDto[email=$email, name=$name]'; Map toJson() { final json = {}; - if (this.avatarColor != null) { - json[r'avatarColor'] = this.avatarColor; - } else { - // json[r'avatarColor'] = null; - } if (this.email != null) { json[r'email'] = this.email; } else { @@ -84,11 +61,6 @@ class UserUpdateMeDto { } else { // json[r'name'] = null; } - if (this.password != null) { - json[r'password'] = this.password; - } else { - // json[r'password'] = null; - } return json; } @@ -101,10 +73,8 @@ class UserUpdateMeDto { final json = value.cast(); return UserUpdateMeDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), email: mapValueOfType(json, r'email'), name: mapValueOfType(json, r'name'), - password: mapValueOfType(json, r'password'), ); } return null; diff --git a/mobile/openapi/lib/model/validate_library_dto.dart b/mobile/openapi/lib/model/validate_library_dto.dart deleted file mode 100644 index 59c3680782..0000000000 --- a/mobile/openapi/lib/model/validate_library_dto.dart +++ /dev/null @@ -1,111 +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 ValidateLibraryDto { - /// Returns a new [ValidateLibraryDto] instance. - ValidateLibraryDto({ - this.exclusionPatterns = const {}, - this.importPaths = const {}, - }); - - /// Exclusion patterns (max 128) - Set exclusionPatterns; - - /// Import paths to validate (max 128) - Set importPaths; - - @override - bool operator ==(Object other) => identical(this, other) || other is ValidateLibraryDto && - _deepEquality.equals(other.exclusionPatterns, exclusionPatterns) && - _deepEquality.equals(other.importPaths, importPaths); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (exclusionPatterns.hashCode) + - (importPaths.hashCode); - - @override - String toString() => 'ValidateLibraryDto[exclusionPatterns=$exclusionPatterns, importPaths=$importPaths]'; - - Map toJson() { - final json = {}; - json[r'exclusionPatterns'] = this.exclusionPatterns.toList(growable: false); - json[r'importPaths'] = this.importPaths.toList(growable: false); - return json; - } - - /// Returns a new [ValidateLibraryDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ValidateLibraryDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryDto"); - if (value is Map) { - final json = value.cast(); - - return ValidateLibraryDto( - exclusionPatterns: json[r'exclusionPatterns'] is Iterable - ? (json[r'exclusionPatterns'] as Iterable).cast().toSet() - : const {}, - importPaths: json[r'importPaths'] is Iterable - ? (json[r'importPaths'] as Iterable).cast().toSet() - : const {}, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ValidateLibraryDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ValidateLibraryDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ValidateLibraryDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ValidateLibraryDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart b/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart deleted file mode 100644 index 78cc03dc94..0000000000 --- a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart +++ /dev/null @@ -1,127 +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 ValidateLibraryImportPathResponseDto { - /// Returns a new [ValidateLibraryImportPathResponseDto] instance. - ValidateLibraryImportPathResponseDto({ - required this.importPath, - this.isValid = false, - this.message, - }); - - /// Import path - String importPath; - - /// Is valid - bool isValid; - - /// Validation message - /// - /// 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? message; - - @override - bool operator ==(Object other) => identical(this, other) || other is ValidateLibraryImportPathResponseDto && - other.importPath == importPath && - other.isValid == isValid && - other.message == message; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (importPath.hashCode) + - (isValid.hashCode) + - (message == null ? 0 : message!.hashCode); - - @override - String toString() => 'ValidateLibraryImportPathResponseDto[importPath=$importPath, isValid=$isValid, message=$message]'; - - Map toJson() { - final json = {}; - json[r'importPath'] = this.importPath; - json[r'isValid'] = this.isValid; - if (this.message != null) { - json[r'message'] = this.message; - } else { - // json[r'message'] = null; - } - return json; - } - - /// Returns a new [ValidateLibraryImportPathResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ValidateLibraryImportPathResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryImportPathResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ValidateLibraryImportPathResponseDto( - importPath: mapValueOfType(json, r'importPath')!, - isValid: mapValueOfType(json, r'isValid')!, - message: mapValueOfType(json, r'message'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ValidateLibraryImportPathResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ValidateLibraryImportPathResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ValidateLibraryImportPathResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ValidateLibraryImportPathResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'importPath', - 'isValid', - }; -} - diff --git a/mobile/openapi/lib/model/validate_library_response_dto.dart b/mobile/openapi/lib/model/validate_library_response_dto.dart deleted file mode 100644 index 37f6ad07d1..0000000000 --- a/mobile/openapi/lib/model/validate_library_response_dto.dart +++ /dev/null @@ -1,99 +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 ValidateLibraryResponseDto { - /// Returns a new [ValidateLibraryResponseDto] instance. - ValidateLibraryResponseDto({ - this.importPaths = const [], - }); - - /// Validation results for import paths - List importPaths; - - @override - bool operator ==(Object other) => identical(this, other) || other is ValidateLibraryResponseDto && - _deepEquality.equals(other.importPaths, importPaths); - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (importPaths.hashCode); - - @override - String toString() => 'ValidateLibraryResponseDto[importPaths=$importPaths]'; - - Map toJson() { - final json = {}; - json[r'importPaths'] = this.importPaths; - return json; - } - - /// Returns a new [ValidateLibraryResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ValidateLibraryResponseDto? fromJson(dynamic value) { - upgradeDto(value, "ValidateLibraryResponseDto"); - if (value is Map) { - final json = value.cast(); - - return ValidateLibraryResponseDto( - importPaths: ValidateLibraryImportPathResponseDto.listFromJson(json[r'importPaths']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = ValidateLibraryResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = ValidateLibraryResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ValidateLibraryResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = ValidateLibraryResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/mobile/openapi/lib/model/version_check_state_response_dto.dart b/mobile/openapi/lib/model/version_check_state_response_dto.dart deleted file mode 100644 index 71075a681c..0000000000 --- a/mobile/openapi/lib/model/version_check_state_response_dto.dart +++ /dev/null @@ -1,117 +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 VersionCheckStateResponseDto { - /// Returns a new [VersionCheckStateResponseDto] instance. - VersionCheckStateResponseDto({ - required this.checkedAt, - required this.releaseVersion, - }); - - /// Last check timestamp - String? checkedAt; - - /// Release version - String? releaseVersion; - - @override - bool operator ==(Object other) => identical(this, other) || other is VersionCheckStateResponseDto && - other.checkedAt == checkedAt && - other.releaseVersion == releaseVersion; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (checkedAt == null ? 0 : checkedAt!.hashCode) + - (releaseVersion == null ? 0 : releaseVersion!.hashCode); - - @override - String toString() => 'VersionCheckStateResponseDto[checkedAt=$checkedAt, releaseVersion=$releaseVersion]'; - - Map toJson() { - final json = {}; - if (this.checkedAt != null) { - json[r'checkedAt'] = this.checkedAt; - } else { - // json[r'checkedAt'] = null; - } - if (this.releaseVersion != null) { - json[r'releaseVersion'] = this.releaseVersion; - } else { - // json[r'releaseVersion'] = null; - } - return json; - } - - /// Returns a new [VersionCheckStateResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static VersionCheckStateResponseDto? fromJson(dynamic value) { - upgradeDto(value, "VersionCheckStateResponseDto"); - if (value is Map) { - final json = value.cast(); - - return VersionCheckStateResponseDto( - checkedAt: mapValueOfType(json, r'checkedAt'), - releaseVersion: mapValueOfType(json, r'releaseVersion'), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = VersionCheckStateResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = VersionCheckStateResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of VersionCheckStateResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = VersionCheckStateResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'checkedAt', - 'releaseVersion', - }; -} - diff --git a/mobile/openapi/lib/model/video_codec.dart b/mobile/openapi/lib/model/video_codec.dart deleted file mode 100644 index ba6441c8f7..0000000000 --- a/mobile/openapi/lib/model/video_codec.dart +++ /dev/null @@ -1,91 +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; - -/// Target video codec -class VideoCodec { - /// Instantiate a new enum with the provided [value]. - const VideoCodec._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const h264 = VideoCodec._(r'h264'); - static const hevc = VideoCodec._(r'hevc'); - static const vp9 = VideoCodec._(r'vp9'); - static const av1 = VideoCodec._(r'av1'); - - /// List of all possible values in this [enum][VideoCodec]. - static const values = [ - h264, - hevc, - vp9, - av1, - ]; - - static VideoCodec? fromJson(dynamic value) => VideoCodecTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = VideoCodec.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [VideoCodec] to String, -/// and [decode] dynamic data back to [VideoCodec]. -class VideoCodecTypeTransformer { - factory VideoCodecTypeTransformer() => _instance ??= const VideoCodecTypeTransformer._(); - - const VideoCodecTypeTransformer._(); - - String encode(VideoCodec data) => data.value; - - /// Decodes a [dynamic value][data] to a VideoCodec. - /// - /// 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. - VideoCodec? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'h264': return VideoCodec.h264; - case r'hevc': return VideoCodec.hevc; - case r'vp9': return VideoCodec.vp9; - case r'av1': return VideoCodec.av1; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [VideoCodecTypeTransformer] instance. - static VideoCodecTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/video_container.dart b/mobile/openapi/lib/model/video_container.dart deleted file mode 100644 index b1a47c8721..0000000000 --- a/mobile/openapi/lib/model/video_container.dart +++ /dev/null @@ -1,91 +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; - -/// Accepted containers -class VideoContainer { - /// Instantiate a new enum with the provided [value]. - const VideoContainer._(this.value); - - /// The underlying value of this enum member. - final String value; - - @override - String toString() => value; - - String toJson() => value; - - static const mov = VideoContainer._(r'mov'); - static const mp4 = VideoContainer._(r'mp4'); - static const ogg = VideoContainer._(r'ogg'); - static const webm = VideoContainer._(r'webm'); - - /// List of all possible values in this [enum][VideoContainer]. - static const values = [ - mov, - mp4, - ogg, - webm, - ]; - - static VideoContainer? fromJson(dynamic value) => VideoContainerTypeTransformer().decode(value); - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = VideoContainer.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } -} - -/// Transformation class that can [encode] an instance of [VideoContainer] to String, -/// and [decode] dynamic data back to [VideoContainer]. -class VideoContainerTypeTransformer { - factory VideoContainerTypeTransformer() => _instance ??= const VideoContainerTypeTransformer._(); - - const VideoContainerTypeTransformer._(); - - String encode(VideoContainer data) => data.value; - - /// Decodes a [dynamic value][data] to a VideoContainer. - /// - /// 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. - VideoContainer? decode(dynamic data, {bool allowNull = true}) { - if (data != null) { - switch (data) { - case r'mov': return VideoContainer.mov; - case r'mp4': return VideoContainer.mp4; - case r'ogg': return VideoContainer.ogg; - case r'webm': return VideoContainer.webm; - default: - if (!allowNull) { - throw ArgumentError('Unknown enum value to decode: $data'); - } - } - } - return null; - } - - /// Singleton [VideoContainerTypeTransformer] instance. - static VideoContainerTypeTransformer? _instance; -} - diff --git a/mobile/openapi/lib/model/workflow_action_item_dto.dart b/mobile/openapi/lib/model/workflow_action_item_dto.dart deleted file mode 100644 index 9222dd6ba7..0000000000 --- a/mobile/openapi/lib/model/workflow_action_item_dto.dart +++ /dev/null @@ -1,118 +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 WorkflowActionItemDto { - /// Returns a new [WorkflowActionItemDto] instance. - WorkflowActionItemDto({ - this.actionConfig, - required this.pluginActionId, - }); - - /// Action configuration - /// - /// 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. - /// - Object? actionConfig; - - /// Plugin action ID - String pluginActionId; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowActionItemDto && - other.actionConfig == actionConfig && - other.pluginActionId == pluginActionId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actionConfig == null ? 0 : actionConfig!.hashCode) + - (pluginActionId.hashCode); - - @override - String toString() => 'WorkflowActionItemDto[actionConfig=$actionConfig, pluginActionId=$pluginActionId]'; - - Map toJson() { - final json = {}; - if (this.actionConfig != null) { - json[r'actionConfig'] = this.actionConfig; - } else { - // json[r'actionConfig'] = null; - } - json[r'pluginActionId'] = this.pluginActionId; - return json; - } - - /// Returns a new [WorkflowActionItemDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowActionItemDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowActionItemDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowActionItemDto( - actionConfig: mapValueOfType(json, r'actionConfig'), - pluginActionId: mapValueOfType(json, r'pluginActionId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowActionItemDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowActionItemDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowActionItemDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowActionItemDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'pluginActionId', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_action_response_dto.dart b/mobile/openapi/lib/model/workflow_action_response_dto.dart deleted file mode 100644 index 8f77e9cf2b..0000000000 --- a/mobile/openapi/lib/model/workflow_action_response_dto.dart +++ /dev/null @@ -1,140 +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 WorkflowActionResponseDto { - /// Returns a new [WorkflowActionResponseDto] instance. - WorkflowActionResponseDto({ - required this.actionConfig, - required this.id, - required this.order, - required this.pluginActionId, - required this.workflowId, - }); - - /// Action configuration - Object? actionConfig; - - /// Action ID - String id; - - /// Action order - num order; - - /// Plugin action ID - String pluginActionId; - - /// Workflow ID - String workflowId; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowActionResponseDto && - other.actionConfig == actionConfig && - other.id == id && - other.order == order && - other.pluginActionId == pluginActionId && - other.workflowId == workflowId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actionConfig == null ? 0 : actionConfig!.hashCode) + - (id.hashCode) + - (order.hashCode) + - (pluginActionId.hashCode) + - (workflowId.hashCode); - - @override - String toString() => 'WorkflowActionResponseDto[actionConfig=$actionConfig, id=$id, order=$order, pluginActionId=$pluginActionId, workflowId=$workflowId]'; - - Map toJson() { - final json = {}; - if (this.actionConfig != null) { - json[r'actionConfig'] = this.actionConfig; - } else { - // json[r'actionConfig'] = null; - } - json[r'id'] = this.id; - json[r'order'] = this.order; - json[r'pluginActionId'] = this.pluginActionId; - json[r'workflowId'] = this.workflowId; - return json; - } - - /// Returns a new [WorkflowActionResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowActionResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowActionResponseDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowActionResponseDto( - actionConfig: mapValueOfType(json, r'actionConfig'), - id: mapValueOfType(json, r'id')!, - order: num.parse('${json[r'order']}'), - pluginActionId: mapValueOfType(json, r'pluginActionId')!, - workflowId: mapValueOfType(json, r'workflowId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowActionResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowActionResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowActionResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowActionResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'actionConfig', - 'id', - 'order', - 'pluginActionId', - 'workflowId', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_create_dto.dart b/mobile/openapi/lib/model/workflow_create_dto.dart deleted file mode 100644 index 38665a1912..0000000000 --- a/mobile/openapi/lib/model/workflow_create_dto.dart +++ /dev/null @@ -1,163 +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 WorkflowCreateDto { - /// Returns a new [WorkflowCreateDto] instance. - WorkflowCreateDto({ - this.actions = const [], - this.description, - this.enabled, - this.filters = const [], - required this.name, - required this.triggerType, - }); - - /// Workflow actions - List actions; - - /// Workflow description - /// - /// 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? description; - - /// Workflow enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Workflow filters - List filters; - - /// Workflow name - String name; - - /// Workflow trigger type - PluginTriggerType triggerType; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowCreateDto && - _deepEquality.equals(other.actions, actions) && - other.description == description && - other.enabled == enabled && - _deepEquality.equals(other.filters, filters) && - other.name == name && - other.triggerType == triggerType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actions.hashCode) + - (description == null ? 0 : description!.hashCode) + - (enabled == null ? 0 : enabled!.hashCode) + - (filters.hashCode) + - (name.hashCode) + - (triggerType.hashCode); - - @override - String toString() => 'WorkflowCreateDto[actions=$actions, description=$description, enabled=$enabled, filters=$filters, name=$name, triggerType=$triggerType]'; - - Map toJson() { - final json = {}; - json[r'actions'] = this.actions; - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - json[r'filters'] = this.filters; - json[r'name'] = this.name; - json[r'triggerType'] = this.triggerType; - return json; - } - - /// Returns a new [WorkflowCreateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowCreateDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowCreateDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowCreateDto( - actions: WorkflowActionItemDto.listFromJson(json[r'actions']), - description: mapValueOfType(json, r'description'), - enabled: mapValueOfType(json, r'enabled'), - filters: WorkflowFilterItemDto.listFromJson(json[r'filters']), - name: mapValueOfType(json, r'name')!, - triggerType: PluginTriggerType.fromJson(json[r'triggerType'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowCreateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowCreateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowCreateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowCreateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'actions', - 'filters', - 'name', - 'triggerType', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_filter_item_dto.dart b/mobile/openapi/lib/model/workflow_filter_item_dto.dart deleted file mode 100644 index 52e29c3e93..0000000000 --- a/mobile/openapi/lib/model/workflow_filter_item_dto.dart +++ /dev/null @@ -1,118 +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 WorkflowFilterItemDto { - /// Returns a new [WorkflowFilterItemDto] instance. - WorkflowFilterItemDto({ - this.filterConfig, - required this.pluginFilterId, - }); - - /// Filter configuration - /// - /// 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. - /// - Object? filterConfig; - - /// Plugin filter ID - String pluginFilterId; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowFilterItemDto && - other.filterConfig == filterConfig && - other.pluginFilterId == pluginFilterId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (filterConfig == null ? 0 : filterConfig!.hashCode) + - (pluginFilterId.hashCode); - - @override - String toString() => 'WorkflowFilterItemDto[filterConfig=$filterConfig, pluginFilterId=$pluginFilterId]'; - - Map toJson() { - final json = {}; - if (this.filterConfig != null) { - json[r'filterConfig'] = this.filterConfig; - } else { - // json[r'filterConfig'] = null; - } - json[r'pluginFilterId'] = this.pluginFilterId; - return json; - } - - /// Returns a new [WorkflowFilterItemDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowFilterItemDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowFilterItemDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowFilterItemDto( - filterConfig: mapValueOfType(json, r'filterConfig'), - pluginFilterId: mapValueOfType(json, r'pluginFilterId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowFilterItemDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowFilterItemDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowFilterItemDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowFilterItemDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'pluginFilterId', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_filter_response_dto.dart b/mobile/openapi/lib/model/workflow_filter_response_dto.dart deleted file mode 100644 index 355378adac..0000000000 --- a/mobile/openapi/lib/model/workflow_filter_response_dto.dart +++ /dev/null @@ -1,140 +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 WorkflowFilterResponseDto { - /// Returns a new [WorkflowFilterResponseDto] instance. - WorkflowFilterResponseDto({ - required this.filterConfig, - required this.id, - required this.order, - required this.pluginFilterId, - required this.workflowId, - }); - - /// Filter configuration - Object? filterConfig; - - /// Filter ID - String id; - - /// Filter order - num order; - - /// Plugin filter ID - String pluginFilterId; - - /// Workflow ID - String workflowId; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowFilterResponseDto && - other.filterConfig == filterConfig && - other.id == id && - other.order == order && - other.pluginFilterId == pluginFilterId && - other.workflowId == workflowId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (filterConfig == null ? 0 : filterConfig!.hashCode) + - (id.hashCode) + - (order.hashCode) + - (pluginFilterId.hashCode) + - (workflowId.hashCode); - - @override - String toString() => 'WorkflowFilterResponseDto[filterConfig=$filterConfig, id=$id, order=$order, pluginFilterId=$pluginFilterId, workflowId=$workflowId]'; - - Map toJson() { - final json = {}; - if (this.filterConfig != null) { - json[r'filterConfig'] = this.filterConfig; - } else { - // json[r'filterConfig'] = null; - } - json[r'id'] = this.id; - json[r'order'] = this.order; - json[r'pluginFilterId'] = this.pluginFilterId; - json[r'workflowId'] = this.workflowId; - return json; - } - - /// Returns a new [WorkflowFilterResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowFilterResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowFilterResponseDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowFilterResponseDto( - filterConfig: mapValueOfType(json, r'filterConfig'), - id: mapValueOfType(json, r'id')!, - order: num.parse('${json[r'order']}'), - pluginFilterId: mapValueOfType(json, r'pluginFilterId')!, - workflowId: mapValueOfType(json, r'workflowId')!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowFilterResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowFilterResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowFilterResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowFilterResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'filterConfig', - 'id', - 'order', - 'pluginFilterId', - 'workflowId', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_response_dto.dart b/mobile/openapi/lib/model/workflow_response_dto.dart deleted file mode 100644 index ae3e6510aa..0000000000 --- a/mobile/openapi/lib/model/workflow_response_dto.dart +++ /dev/null @@ -1,176 +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 WorkflowResponseDto { - /// Returns a new [WorkflowResponseDto] instance. - WorkflowResponseDto({ - this.actions = const [], - required this.createdAt, - required this.description, - required this.enabled, - this.filters = const [], - required this.id, - required this.name, - required this.ownerId, - required this.triggerType, - }); - - /// Workflow actions - List actions; - - /// Creation date - String createdAt; - - /// Workflow description - String description; - - /// Workflow enabled - bool enabled; - - /// Workflow filters - List filters; - - /// Workflow ID - String id; - - /// Workflow name - String? name; - - /// Owner user ID - String ownerId; - - /// Workflow trigger type - PluginTriggerType triggerType; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowResponseDto && - _deepEquality.equals(other.actions, actions) && - other.createdAt == createdAt && - other.description == description && - other.enabled == enabled && - _deepEquality.equals(other.filters, filters) && - other.id == id && - other.name == name && - other.ownerId == ownerId && - other.triggerType == triggerType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actions.hashCode) + - (createdAt.hashCode) + - (description.hashCode) + - (enabled.hashCode) + - (filters.hashCode) + - (id.hashCode) + - (name == null ? 0 : name!.hashCode) + - (ownerId.hashCode) + - (triggerType.hashCode); - - @override - String toString() => 'WorkflowResponseDto[actions=$actions, createdAt=$createdAt, description=$description, enabled=$enabled, filters=$filters, id=$id, name=$name, ownerId=$ownerId, triggerType=$triggerType]'; - - Map toJson() { - final json = {}; - json[r'actions'] = this.actions; - json[r'createdAt'] = this.createdAt; - json[r'description'] = this.description; - json[r'enabled'] = this.enabled; - json[r'filters'] = this.filters; - json[r'id'] = this.id; - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - json[r'ownerId'] = this.ownerId; - json[r'triggerType'] = this.triggerType; - return json; - } - - /// Returns a new [WorkflowResponseDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowResponseDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowResponseDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowResponseDto( - actions: WorkflowActionResponseDto.listFromJson(json[r'actions']), - createdAt: mapValueOfType(json, r'createdAt')!, - description: mapValueOfType(json, r'description')!, - enabled: mapValueOfType(json, r'enabled')!, - filters: WorkflowFilterResponseDto.listFromJson(json[r'filters']), - id: mapValueOfType(json, r'id')!, - name: mapValueOfType(json, r'name'), - ownerId: mapValueOfType(json, r'ownerId')!, - triggerType: PluginTriggerType.fromJson(json[r'triggerType'])!, - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowResponseDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowResponseDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowResponseDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowResponseDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'actions', - 'createdAt', - 'description', - 'enabled', - 'filters', - 'id', - 'name', - 'ownerId', - 'triggerType', - }; -} - diff --git a/mobile/openapi/lib/model/workflow_update_dto.dart b/mobile/openapi/lib/model/workflow_update_dto.dart deleted file mode 100644 index 9891fff079..0000000000 --- a/mobile/openapi/lib/model/workflow_update_dto.dart +++ /dev/null @@ -1,179 +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 WorkflowUpdateDto { - /// Returns a new [WorkflowUpdateDto] instance. - WorkflowUpdateDto({ - this.actions = const [], - this.description, - this.enabled, - this.filters = const [], - this.name, - this.triggerType, - }); - - /// Workflow actions - List actions; - - /// Workflow description - /// - /// 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? description; - - /// Workflow enabled - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - bool? enabled; - - /// Workflow filters - List filters; - - /// Workflow name - /// - /// 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? name; - - /// Workflow trigger type - /// - /// 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. - /// - PluginTriggerType? triggerType; - - @override - bool operator ==(Object other) => identical(this, other) || other is WorkflowUpdateDto && - _deepEquality.equals(other.actions, actions) && - other.description == description && - other.enabled == enabled && - _deepEquality.equals(other.filters, filters) && - other.name == name && - other.triggerType == triggerType; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (actions.hashCode) + - (description == null ? 0 : description!.hashCode) + - (enabled == null ? 0 : enabled!.hashCode) + - (filters.hashCode) + - (name == null ? 0 : name!.hashCode) + - (triggerType == null ? 0 : triggerType!.hashCode); - - @override - String toString() => 'WorkflowUpdateDto[actions=$actions, description=$description, enabled=$enabled, filters=$filters, name=$name, triggerType=$triggerType]'; - - Map toJson() { - final json = {}; - json[r'actions'] = this.actions; - if (this.description != null) { - json[r'description'] = this.description; - } else { - // json[r'description'] = null; - } - if (this.enabled != null) { - json[r'enabled'] = this.enabled; - } else { - // json[r'enabled'] = null; - } - json[r'filters'] = this.filters; - if (this.name != null) { - json[r'name'] = this.name; - } else { - // json[r'name'] = null; - } - if (this.triggerType != null) { - json[r'triggerType'] = this.triggerType; - } else { - // json[r'triggerType'] = null; - } - return json; - } - - /// Returns a new [WorkflowUpdateDto] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static WorkflowUpdateDto? fromJson(dynamic value) { - upgradeDto(value, "WorkflowUpdateDto"); - if (value is Map) { - final json = value.cast(); - - return WorkflowUpdateDto( - actions: WorkflowActionItemDto.listFromJson(json[r'actions']), - description: mapValueOfType(json, r'description'), - enabled: mapValueOfType(json, r'enabled'), - filters: WorkflowFilterItemDto.listFromJson(json[r'filters']), - name: mapValueOfType(json, r'name'), - triggerType: PluginTriggerType.fromJson(json[r'triggerType']), - ); - } - return null; - } - - static List listFromJson(dynamic json, {bool growable = false,}) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = WorkflowUpdateDto.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = WorkflowUpdateDto.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of WorkflowUpdateDto-objects as value to a dart map - static Map> mapListFromJson(dynamic json, {bool growable = false,}) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = WorkflowUpdateDto.listFromJson(entry.value, growable: growable,); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - }; -} - diff --git a/open-api/bin/generate-open-api.sh b/open-api/bin/generate-open-api.sh index 522063185f..0fb2d802d7 100755 --- a/open-api/bin/generate-open-api.sh +++ b/open-api/bin/generate-open-api.sh @@ -1,47 +1,44 @@ #!/usr/bin/env bash -OPENAPI_GENERATOR_VERSION=v7.12.0 - -# usage: ./bin/generate-open-api.sh +set -euo pipefail function dart { rm -rf ../mobile/openapi cd ./templates/mobile/serialization/native - wget -O native_class.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/$OPENAPI_GENERATOR_VERSION/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache + wget -O native_class.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/v7.12.0/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache patch --no-backup-if-mismatch -u native_class.mustache