From 66a79885ef9a45dcce415767d7319860464e8a95 Mon Sep 17 00:00:00 2001 From: Daniele Ricci Date: Wed, 23 Oct 2024 11:28:48 +0200 Subject: [PATCH] Upgrade to Immich API 1.118.2 --- .../immich_client/api/activities/__init__.py | 0 .../api/activities/create_activity.py | 156 +++++ .../api/activities/delete_activity.py | 92 +++ .../api/activities/get_activities.py | 237 +++++++ .../api/activities/get_activity_statistics.py | 174 ++++++ .../immich_client/api/albums/__init__.py | 0 .../api/albums/add_assets_to_album.py | 195 ++++++ .../api/albums/add_users_to_album.py | 170 +++++ .../immich_client/api/albums/create_album.py | 156 +++++ .../immich_client/api/albums/delete_album.py | 92 +++ .../api/albums/get_album_info.py | 183 ++++++ .../api/albums/get_album_statistics.py | 122 ++++ .../api/albums/get_all_albums.py | 178 ++++++ .../api/albums/remove_asset_from_album.py | 175 ++++++ .../api/albums/remove_user_from_album.py | 99 +++ .../api/albums/update_album_info.py | 170 +++++ .../api/albums/update_album_user.py | 116 ++++ .../immich_client/api/api_keys/__init__.py | 0 .../api/api_keys/create_api_key.py | 156 +++++ .../api/api_keys/delete_api_key.py | 92 +++ .../immich_client/api/api_keys/get_api_key.py | 147 +++++ .../api/api_keys/get_api_keys.py | 127 ++++ .../api/api_keys/update_api_key.py | 170 +++++ .../immich_client/api/assets/__init__.py | 0 .../api/assets/check_bulk_upload.py | 160 +++++ .../api/assets/check_existing_assets.py | 160 +++++ .../immich_client/api/assets/delete_assets.py | 101 +++ .../api/assets/download_asset.py | 164 +++++ .../get_all_user_assets_by_device_id.py | 145 +++++ .../api/assets/get_asset_info.py | 168 +++++ .../api/assets/get_asset_statistics.py | 184 ++++++ .../api/assets/get_memory_lane.py | 174 ++++++ .../immich_client/api/assets/get_random.py | 163 +++++ .../api/assets/play_asset_video.py | 164 +++++ .../immich_client/api/assets/replace_asset.py | 193 ++++++ .../api/assets/run_asset_jobs.py | 101 +++ .../immich_client/api/assets/update_asset.py | 170 +++++ .../immich_client/api/assets/update_assets.py | 101 +++ .../immich_client/api/assets/upload_asset.py | 190 ++++++ .../immich_client/api/assets/view_asset.py | 184 ++++++ .../immich_client/api/download/__init__.py | 0 .../api/download/download_archive.py | 172 +++++ .../api/download/get_download_info.py | 176 ++++++ .../immich_client/api/duplicates/__init__.py | 0 .../api/duplicates/get_asset_duplicates.py | 127 ++++ .../immich_client/api/faces/__init__.py | 0 .../immich_client/api/faces/get_faces.py | 161 +++++ .../api/faces/reassign_faces_by_id.py | 170 +++++ .../api/file_reports/__init__.py | 0 .../api/file_reports/fix_audit_files.py | 101 +++ .../api/file_reports/get_audit_files.py | 118 ++++ .../api/file_reports/get_file_checksums.py | 161 +++++ .../immich_client/api/jobs/__init__.py | 0 .../immich_client/api/jobs/create_job.py | 101 +++ .../api/jobs/get_all_jobs_status.py | 122 ++++ .../api/jobs/send_job_command.py | 166 +++++ .../immich_client/api/libraries/__init__.py | 0 .../api/libraries/create_library.py | 156 +++++ .../api/libraries/delete_library.py | 92 +++ .../api/libraries/get_all_libraries.py | 127 ++++ .../api/libraries/get_library.py | 147 +++++ .../api/libraries/get_library_statistics.py | 147 +++++ .../api/libraries/scan_library.py | 92 +++ .../api/libraries/update_library.py | 170 +++++ .../immich_client/api/libraries/validate.py | 170 +++++ .../immich_client/api/map_/__init__.py | 0 .../immich_client/api/map_/get_map_markers.py | 241 +++++++ .../immich_client/api/map_/reverse_geocode.py | 174 ++++++ .../immich_client/api/memories/__init__.py | 0 .../api/memories/add_memory_assets.py | 175 ++++++ .../api/memories/create_memory.py | 156 +++++ .../api/memories/delete_memory.py | 92 +++ .../immich_client/api/memories/get_memory.py | 147 +++++ .../api/memories/remove_memory_assets.py | 175 ++++++ .../api/memories/search_memories.py | 127 ++++ .../api/memories/update_memory.py | 170 +++++ .../api/notifications/__init__.py | 0 .../api/notifications/send_test_email.py | 156 +++++ .../immich_client/api/partners/__init__.py | 0 .../api/partners/create_partner.py | 147 +++++ .../api/partners/get_partners.py | 161 +++++ .../api/partners/remove_partner.py | 92 +++ .../api/partners/update_partner.py | 170 +++++ .../immich_client/api/people/__init__.py | 0 .../immich_client/api/people/create_person.py | 156 +++++ .../api/people/get_all_people.py | 184 ++++++ .../immich_client/api/people/get_person.py | 147 +++++ .../api/people/get_person_statistics.py | 147 +++++ .../api/people/get_person_thumbnail.py | 143 +++++ .../immich_client/api/people/merge_person.py | 175 ++++++ .../api/people/reassign_faces.py | 175 ++++++ .../immich_client/api/people/update_people.py | 161 +++++ .../immich_client/api/people/update_person.py | 170 +++++ .../api/search/get_assets_by_city.py | 127 ++++ .../api/search/get_search_suggestions.py | 226 +++++++ .../api/search/search_metadata.py | 156 +++++ .../immich_client/api/search/search_places.py | 159 +++++ .../immich_client/api/search/search_random.py | 161 +++++ .../immich_client/api/search/search_smart.py | 156 +++++ .../immich_client/api/server/__init__.py | 0 .../api/server/delete_server_license.py | 77 +++ .../api/server/get_about_info.py | 122 ++++ .../api/server/get_server_config.py | 122 ++++ .../api/server/get_server_features.py | 122 ++++ .../api/server/get_server_license.py | 125 ++++ .../api/server/get_server_statistics.py | 122 ++++ .../api/server/get_server_version.py | 122 ++++ .../immich_client/api/server/get_storage.py | 122 ++++ .../api/server/get_supported_media_types.py | 122 ++++ .../immich_client/api/server/get_theme.py | 122 ++++ .../api/server/get_version_history.py | 127 ++++ .../immich_client/api/server/ping_server.py | 122 ++++ .../api/server/set_server_license.py | 156 +++++ .../immich_client/api/sessions/__init__.py | 0 .../api/sessions/delete_all_sessions.py | 77 +++ .../api/sessions/delete_session.py | 92 +++ .../api/sessions/get_sessions.py | 127 ++++ .../api/shared_links/__init__.py | 0 .../shared_links/add_shared_link_assets.py | 195 ++++++ .../api/shared_links/create_shared_link.py | 156 +++++ .../api/shared_links/get_all_shared_links.py | 127 ++++ .../api/shared_links/get_my_shared_link.py | 184 ++++++ .../api/shared_links/get_shared_link_by_id.py | 147 +++++ .../api/shared_links/remove_shared_link.py | 92 +++ .../shared_links/remove_shared_link_assets.py | 195 ++++++ .../api/shared_links/update_shared_link.py | 170 +++++ .../immich_client/api/stacks/__init__.py | 0 .../immich_client/api/stacks/create_stack.py | 156 +++++ .../immich_client/api/stacks/delete_stack.py | 92 +++ .../immich_client/api/stacks/delete_stacks.py | 101 +++ .../immich_client/api/stacks/get_stack.py | 147 +++++ .../immich_client/api/stacks/search_stacks.py | 159 +++++ .../immich_client/api/stacks/update_stack.py | 170 +++++ .../immich_client/api/sync/__init__.py | 0 .../immich_client/api/sync/get_delta_sync.py | 156 +++++ .../api/sync/get_full_sync_for_user.py | 161 +++++ .../api/system_metadata/__init__.py | 0 .../system_metadata/get_admin_onboarding.py | 122 ++++ .../get_reverse_geocoding_state.py | 122 ++++ .../update_admin_onboarding.py | 101 +++ .../immich_client/api/tags/__init__.py | 0 .../immich_client/api/tags/bulk_tag_assets.py | 156 +++++ .../immich_client/api/tags/create_tag.py | 156 +++++ .../immich_client/api/tags/delete_tag.py | 92 +++ .../immich_client/api/tags/get_all_tags.py | 127 ++++ .../immich_client/api/tags/get_tag_by_id.py | 147 +++++ .../immich_client/api/tags/tag_assets.py | 175 ++++++ .../immich_client/api/tags/untag_assets.py | 175 ++++++ .../immich_client/api/tags/update_tag.py | 170 +++++ .../immich_client/api/tags/upsert_tags.py | 161 +++++ .../immich_client/api/timeline/__init__.py | 0 .../api/timeline/get_time_bucket.py | 359 +++++++++++ .../api/timeline/get_time_buckets.py | 344 ++++++++++ .../immich_client/api/trash/__init__.py | 0 .../immich_client/api/trash/empty_trash.py | 122 ++++ .../immich_client/api/trash/restore_assets.py | 156 +++++ .../immich_client/api/trash/restore_trash.py | 122 ++++ .../immich_client/api/users/__init__.py | 0 .../api/users/create_profile_image.py | 155 +++++ .../api/users/delete_profile_image.py | 77 +++ .../api/users/delete_user_license.py | 77 +++ .../api/users/get_my_preferences.py | 122 ++++ .../immich_client/api/users/get_my_user.py | 122 ++++ .../api/users/get_profile_image.py | 143 +++++ .../immich_client/api/users/get_user.py | 147 +++++ .../api/users/get_user_license.py | 122 ++++ .../immich_client/api/users/search_users.py | 127 ++++ .../api/users/set_user_license.py | 156 +++++ .../api/users/update_my_preferences.py | 156 +++++ .../immich_client/api/users/update_my_user.py | 156 +++++ .../immich_client/api/users_admin/__init__.py | 0 .../api/users_admin/create_user_admin.py | 156 +++++ .../api/users_admin/delete_user_admin.py | 170 +++++ .../api/users_admin/get_user_admin.py | 147 +++++ .../users_admin/get_user_preferences_admin.py | 147 +++++ .../api/users_admin/restore_user_admin.py | 147 +++++ .../api/users_admin/search_users_admin.py | 159 +++++ .../api/users_admin/update_user_admin.py | 170 +++++ .../update_user_preferences_admin.py | 170 +++++ .../immich_client/api/view/__init__.py | 0 .../api/view/get_assets_by_original_path.py | 159 +++++ .../api/view/get_unique_original_paths.py | 117 ++++ .../models/admin_onboarding_update_dto.py | 58 ++ .../models/album_statistics_response_dto.py | 74 +++ .../models/album_user_add_dto.py | 78 +++ .../models/album_user_create_dto.py | 69 +++ .../models/album_user_response_dto.py | 74 +++ .../immich_client/models/album_user_role.py | 9 + .../models/asset_delta_sync_dto.py | 77 +++ .../models/asset_delta_sync_response_dto.py | 88 +++ .../models/asset_full_sync_dto.py | 103 +++ .../models/asset_media_create_dto.py | 233 +++++++ .../models/asset_media_replace_dto.py | 137 ++++ .../models/asset_media_response_dto.py | 68 ++ .../immich_client/models/asset_media_size.py | 9 + .../models/asset_media_status.py | 10 + .../models/asset_stack_response_dto.py | 74 +++ .../immich_client/models/avatar_response.py | 60 ++ .../immich_client/models/avatar_update.py | 66 ++ .../immich_client/models/download_response.py | 66 ++ .../immich_client/models/download_update.py | 67 ++ .../models/duplicate_detection_config.py | 66 ++ .../models/duplicate_response_dto.py | 80 +++ .../models/email_notifications_response.py | 74 +++ .../models/email_notifications_update.py | 76 +++ .../models/facial_recognition_config.py | 90 +++ .../immich_client/models/folders_response.py | 66 ++ .../immich_client/models/folders_update.py | 67 ++ .../immich_client/models/image_format.py | 9 + .../immich_client/models/job_create_dto.py | 60 ++ .../immich_client/models/license_key_dto.py | 66 ++ .../models/license_response_dto.py | 76 +++ .../immich_client/models/manual_job_name.py | 10 + .../map_reverse_geocode_response_dto.py | 93 +++ .../immich_client/models/memories_response.py | 58 ++ .../immich_client/models/memories_update.py | 58 ++ .../immich_client/models/memory_create_dto.py | 130 ++++ .../models/memory_response_dto.py | 175 ++++++ .../immich_client/models/memory_type.py | 8 + .../immich_client/models/memory_update_dto.py | 92 +++ .../models/metadata_search_dto.py | 586 ++++++++++++++++++ .../immich_client/models/on_this_day_dto.py | 58 ++ .../immich_client/models/partner_direction.py | 9 + .../immich_client/models/people_response.py | 66 ++ .../immich_client/models/people_update.py | 67 ++ .../immich_client/models/permission.py | 85 +++ .../immich_client/models/person_create_dto.py | 101 +++ .../models/places_response_dto.py | 94 +++ .../immich_client/models/purchase_response.py | 66 ++ .../immich_client/models/purchase_update.py | 67 ++ .../immich_client/models/random_search_dto.py | 482 ++++++++++++++ .../immich_client/models/ratings_response.py | 58 ++ .../immich_client/models/ratings_update.py | 58 ++ .../reverse_geocoding_state_response_dto.py | 79 +++ .../models/search_suggestion_type.py | 12 + .../models/server_about_response_dto.py | 238 +++++++ .../models/server_storage_response_dto.py | 106 ++++ .../server_version_history_response_dto.py | 76 +++ .../models/session_response_dto.py | 98 +++ .../immich_client/models/smart_search_dto.py | 483 +++++++++++++++ .../immich_client/models/source_type.py | 9 + .../immich_client/models/stack_create_dto.py | 67 ++ .../models/stack_response_dto.py | 88 +++ .../immich_client/models/stack_update_dto.py | 66 ++ .../models/system_config_faces_dto.py | 58 ++ .../system_config_generated_image_dto.py | 76 +++ .../models/system_config_image_dto.py | 90 +++ .../models/system_config_library_watch_dto.py | 58 ++ .../models/system_config_metadata_dto.py | 64 ++ .../models/system_config_notifications_dto.py | 64 ++ .../models/system_config_server_dto.py | 66 ++ .../models/system_config_smtp_dto.py | 88 +++ .../system_config_smtp_transport_dto.py | 90 +++ .../models/system_config_user_dto.py | 58 ++ .../models/tag_bulk_assets_dto.py | 83 +++ .../models/tag_bulk_assets_response_dto.py | 58 ++ .../immich_client/models/tag_create_dto.py | 100 +++ .../immich_client/models/tag_update_dto.py | 70 +++ .../immich_client/models/tag_upsert_dto.py | 58 ++ .../immich_client/models/tags_response.py | 66 ++ .../immich_client/models/tags_update.py | 67 ++ .../models/test_email_response_dto.py | 58 ++ .../models/trash_response_dto.py | 58 ++ .../models/update_album_user_dto.py | 60 ++ .../models/user_admin_create_dto.py | 134 ++++ .../models/user_admin_delete_dto.py | 58 ++ .../models/user_admin_response_dto.py | 251 ++++++++ .../models/user_admin_update_dto.py | 125 ++++ .../immich_client/models/user_license.py | 76 +++ .../models/user_preferences_response_dto.py | 144 +++++ .../models/user_preferences_update_dto.py | 215 +++++++ .../immich_client/models/user_status.py | 10 + .../models/user_update_me_dto.py | 76 +++ .../models/validate_library_dto.py | 71 +++ ...lidate_library_import_path_response_dto.py | 77 +++ .../models/validate_library_response_dto.py | 74 +++ .../immich_client/models/video_container.py | 11 + 277 files changed, 31632 insertions(+) create mode 100644 immich_carddav_sync/immich_client/api/activities/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/activities/create_activity.py create mode 100644 immich_carddav_sync/immich_client/api/activities/delete_activity.py create mode 100644 immich_carddav_sync/immich_client/api/activities/get_activities.py create mode 100644 immich_carddav_sync/immich_client/api/activities/get_activity_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/albums/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/albums/add_assets_to_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/add_users_to_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/create_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/delete_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/get_album_info.py create mode 100644 immich_carddav_sync/immich_client/api/albums/get_album_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/albums/get_all_albums.py create mode 100644 immich_carddav_sync/immich_client/api/albums/remove_asset_from_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/remove_user_from_album.py create mode 100644 immich_carddav_sync/immich_client/api/albums/update_album_info.py create mode 100644 immich_carddav_sync/immich_client/api/albums/update_album_user.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/create_api_key.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/delete_api_key.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/get_api_key.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/get_api_keys.py create mode 100644 immich_carddav_sync/immich_client/api/api_keys/update_api_key.py create mode 100644 immich_carddav_sync/immich_client/api/assets/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/assets/check_bulk_upload.py create mode 100644 immich_carddav_sync/immich_client/api/assets/check_existing_assets.py create mode 100644 immich_carddav_sync/immich_client/api/assets/delete_assets.py create mode 100644 immich_carddav_sync/immich_client/api/assets/download_asset.py create mode 100644 immich_carddav_sync/immich_client/api/assets/get_all_user_assets_by_device_id.py create mode 100644 immich_carddav_sync/immich_client/api/assets/get_asset_info.py create mode 100644 immich_carddav_sync/immich_client/api/assets/get_asset_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/assets/get_memory_lane.py create mode 100644 immich_carddav_sync/immich_client/api/assets/get_random.py create mode 100644 immich_carddav_sync/immich_client/api/assets/play_asset_video.py create mode 100644 immich_carddav_sync/immich_client/api/assets/replace_asset.py create mode 100644 immich_carddav_sync/immich_client/api/assets/run_asset_jobs.py create mode 100644 immich_carddav_sync/immich_client/api/assets/update_asset.py create mode 100644 immich_carddav_sync/immich_client/api/assets/update_assets.py create mode 100644 immich_carddav_sync/immich_client/api/assets/upload_asset.py create mode 100644 immich_carddav_sync/immich_client/api/assets/view_asset.py create mode 100644 immich_carddav_sync/immich_client/api/download/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/download/download_archive.py create mode 100644 immich_carddav_sync/immich_client/api/download/get_download_info.py create mode 100644 immich_carddav_sync/immich_client/api/duplicates/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/duplicates/get_asset_duplicates.py create mode 100644 immich_carddav_sync/immich_client/api/faces/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/faces/get_faces.py create mode 100644 immich_carddav_sync/immich_client/api/faces/reassign_faces_by_id.py create mode 100644 immich_carddav_sync/immich_client/api/file_reports/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/file_reports/fix_audit_files.py create mode 100644 immich_carddav_sync/immich_client/api/file_reports/get_audit_files.py create mode 100644 immich_carddav_sync/immich_client/api/file_reports/get_file_checksums.py create mode 100644 immich_carddav_sync/immich_client/api/jobs/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/jobs/create_job.py create mode 100644 immich_carddav_sync/immich_client/api/jobs/get_all_jobs_status.py create mode 100644 immich_carddav_sync/immich_client/api/jobs/send_job_command.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/create_library.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/delete_library.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/get_all_libraries.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/get_library.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/get_library_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/scan_library.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/update_library.py create mode 100644 immich_carddav_sync/immich_client/api/libraries/validate.py create mode 100644 immich_carddav_sync/immich_client/api/map_/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/map_/get_map_markers.py create mode 100644 immich_carddav_sync/immich_client/api/map_/reverse_geocode.py create mode 100644 immich_carddav_sync/immich_client/api/memories/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/memories/add_memory_assets.py create mode 100644 immich_carddav_sync/immich_client/api/memories/create_memory.py create mode 100644 immich_carddav_sync/immich_client/api/memories/delete_memory.py create mode 100644 immich_carddav_sync/immich_client/api/memories/get_memory.py create mode 100644 immich_carddav_sync/immich_client/api/memories/remove_memory_assets.py create mode 100644 immich_carddav_sync/immich_client/api/memories/search_memories.py create mode 100644 immich_carddav_sync/immich_client/api/memories/update_memory.py create mode 100644 immich_carddav_sync/immich_client/api/notifications/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/notifications/send_test_email.py create mode 100644 immich_carddav_sync/immich_client/api/partners/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/partners/create_partner.py create mode 100644 immich_carddav_sync/immich_client/api/partners/get_partners.py create mode 100644 immich_carddav_sync/immich_client/api/partners/remove_partner.py create mode 100644 immich_carddav_sync/immich_client/api/partners/update_partner.py create mode 100644 immich_carddav_sync/immich_client/api/people/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/people/create_person.py create mode 100644 immich_carddav_sync/immich_client/api/people/get_all_people.py create mode 100644 immich_carddav_sync/immich_client/api/people/get_person.py create mode 100644 immich_carddav_sync/immich_client/api/people/get_person_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/people/get_person_thumbnail.py create mode 100644 immich_carddav_sync/immich_client/api/people/merge_person.py create mode 100644 immich_carddav_sync/immich_client/api/people/reassign_faces.py create mode 100644 immich_carddav_sync/immich_client/api/people/update_people.py create mode 100644 immich_carddav_sync/immich_client/api/people/update_person.py create mode 100644 immich_carddav_sync/immich_client/api/search/get_assets_by_city.py create mode 100644 immich_carddav_sync/immich_client/api/search/get_search_suggestions.py create mode 100644 immich_carddav_sync/immich_client/api/search/search_metadata.py create mode 100644 immich_carddav_sync/immich_client/api/search/search_places.py create mode 100644 immich_carddav_sync/immich_client/api/search/search_random.py create mode 100644 immich_carddav_sync/immich_client/api/search/search_smart.py create mode 100644 immich_carddav_sync/immich_client/api/server/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/server/delete_server_license.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_about_info.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_server_config.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_server_features.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_server_license.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_server_statistics.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_server_version.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_storage.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_supported_media_types.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_theme.py create mode 100644 immich_carddav_sync/immich_client/api/server/get_version_history.py create mode 100644 immich_carddav_sync/immich_client/api/server/ping_server.py create mode 100644 immich_carddav_sync/immich_client/api/server/set_server_license.py create mode 100644 immich_carddav_sync/immich_client/api/sessions/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/sessions/delete_all_sessions.py create mode 100644 immich_carddav_sync/immich_client/api/sessions/delete_session.py create mode 100644 immich_carddav_sync/immich_client/api/sessions/get_sessions.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/add_shared_link_assets.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/create_shared_link.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/get_all_shared_links.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/get_my_shared_link.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/get_shared_link_by_id.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/remove_shared_link.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/remove_shared_link_assets.py create mode 100644 immich_carddav_sync/immich_client/api/shared_links/update_shared_link.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/create_stack.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/delete_stack.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/delete_stacks.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/get_stack.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/search_stacks.py create mode 100644 immich_carddav_sync/immich_client/api/stacks/update_stack.py create mode 100644 immich_carddav_sync/immich_client/api/sync/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/sync/get_delta_sync.py create mode 100644 immich_carddav_sync/immich_client/api/sync/get_full_sync_for_user.py create mode 100644 immich_carddav_sync/immich_client/api/system_metadata/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/system_metadata/get_admin_onboarding.py create mode 100644 immich_carddav_sync/immich_client/api/system_metadata/get_reverse_geocoding_state.py create mode 100644 immich_carddav_sync/immich_client/api/system_metadata/update_admin_onboarding.py create mode 100644 immich_carddav_sync/immich_client/api/tags/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/tags/bulk_tag_assets.py create mode 100644 immich_carddav_sync/immich_client/api/tags/create_tag.py create mode 100644 immich_carddav_sync/immich_client/api/tags/delete_tag.py create mode 100644 immich_carddav_sync/immich_client/api/tags/get_all_tags.py create mode 100644 immich_carddav_sync/immich_client/api/tags/get_tag_by_id.py create mode 100644 immich_carddav_sync/immich_client/api/tags/tag_assets.py create mode 100644 immich_carddav_sync/immich_client/api/tags/untag_assets.py create mode 100644 immich_carddav_sync/immich_client/api/tags/update_tag.py create mode 100644 immich_carddav_sync/immich_client/api/tags/upsert_tags.py create mode 100644 immich_carddav_sync/immich_client/api/timeline/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/timeline/get_time_bucket.py create mode 100644 immich_carddav_sync/immich_client/api/timeline/get_time_buckets.py create mode 100644 immich_carddav_sync/immich_client/api/trash/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/trash/empty_trash.py create mode 100644 immich_carddav_sync/immich_client/api/trash/restore_assets.py create mode 100644 immich_carddav_sync/immich_client/api/trash/restore_trash.py create mode 100644 immich_carddav_sync/immich_client/api/users/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/users/create_profile_image.py create mode 100644 immich_carddav_sync/immich_client/api/users/delete_profile_image.py create mode 100644 immich_carddav_sync/immich_client/api/users/delete_user_license.py create mode 100644 immich_carddav_sync/immich_client/api/users/get_my_preferences.py create mode 100644 immich_carddav_sync/immich_client/api/users/get_my_user.py create mode 100644 immich_carddav_sync/immich_client/api/users/get_profile_image.py create mode 100644 immich_carddav_sync/immich_client/api/users/get_user.py create mode 100644 immich_carddav_sync/immich_client/api/users/get_user_license.py create mode 100644 immich_carddav_sync/immich_client/api/users/search_users.py create mode 100644 immich_carddav_sync/immich_client/api/users/set_user_license.py create mode 100644 immich_carddav_sync/immich_client/api/users/update_my_preferences.py create mode 100644 immich_carddav_sync/immich_client/api/users/update_my_user.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/create_user_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/delete_user_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/get_user_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/get_user_preferences_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/restore_user_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/search_users_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/update_user_admin.py create mode 100644 immich_carddav_sync/immich_client/api/users_admin/update_user_preferences_admin.py create mode 100644 immich_carddav_sync/immich_client/api/view/__init__.py create mode 100644 immich_carddav_sync/immich_client/api/view/get_assets_by_original_path.py create mode 100644 immich_carddav_sync/immich_client/api/view/get_unique_original_paths.py create mode 100644 immich_carddav_sync/immich_client/models/admin_onboarding_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/album_statistics_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/album_user_add_dto.py create mode 100644 immich_carddav_sync/immich_client/models/album_user_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/album_user_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/album_user_role.py create mode 100644 immich_carddav_sync/immich_client/models/asset_delta_sync_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_delta_sync_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_full_sync_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_media_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_media_replace_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_media_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/asset_media_size.py create mode 100644 immich_carddav_sync/immich_client/models/asset_media_status.py create mode 100644 immich_carddav_sync/immich_client/models/asset_stack_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/avatar_response.py create mode 100644 immich_carddav_sync/immich_client/models/avatar_update.py create mode 100644 immich_carddav_sync/immich_client/models/download_response.py create mode 100644 immich_carddav_sync/immich_client/models/download_update.py create mode 100644 immich_carddav_sync/immich_client/models/duplicate_detection_config.py create mode 100644 immich_carddav_sync/immich_client/models/duplicate_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/email_notifications_response.py create mode 100644 immich_carddav_sync/immich_client/models/email_notifications_update.py create mode 100644 immich_carddav_sync/immich_client/models/facial_recognition_config.py create mode 100644 immich_carddav_sync/immich_client/models/folders_response.py create mode 100644 immich_carddav_sync/immich_client/models/folders_update.py create mode 100644 immich_carddav_sync/immich_client/models/image_format.py create mode 100644 immich_carddav_sync/immich_client/models/job_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/license_key_dto.py create mode 100644 immich_carddav_sync/immich_client/models/license_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/manual_job_name.py create mode 100644 immich_carddav_sync/immich_client/models/map_reverse_geocode_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/memories_response.py create mode 100644 immich_carddav_sync/immich_client/models/memories_update.py create mode 100644 immich_carddav_sync/immich_client/models/memory_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/memory_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/memory_type.py create mode 100644 immich_carddav_sync/immich_client/models/memory_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/metadata_search_dto.py create mode 100644 immich_carddav_sync/immich_client/models/on_this_day_dto.py create mode 100644 immich_carddav_sync/immich_client/models/partner_direction.py create mode 100644 immich_carddav_sync/immich_client/models/people_response.py create mode 100644 immich_carddav_sync/immich_client/models/people_update.py create mode 100644 immich_carddav_sync/immich_client/models/permission.py create mode 100644 immich_carddav_sync/immich_client/models/person_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/places_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/purchase_response.py create mode 100644 immich_carddav_sync/immich_client/models/purchase_update.py create mode 100644 immich_carddav_sync/immich_client/models/random_search_dto.py create mode 100644 immich_carddav_sync/immich_client/models/ratings_response.py create mode 100644 immich_carddav_sync/immich_client/models/ratings_update.py create mode 100644 immich_carddav_sync/immich_client/models/reverse_geocoding_state_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/search_suggestion_type.py create mode 100644 immich_carddav_sync/immich_client/models/server_about_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/server_storage_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/server_version_history_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/session_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/smart_search_dto.py create mode 100644 immich_carddav_sync/immich_client/models/source_type.py create mode 100644 immich_carddav_sync/immich_client/models/stack_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/stack_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/stack_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_faces_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_generated_image_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_image_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_library_watch_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_metadata_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_notifications_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_server_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_smtp_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_smtp_transport_dto.py create mode 100644 immich_carddav_sync/immich_client/models/system_config_user_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tag_bulk_assets_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tag_bulk_assets_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tag_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tag_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tag_upsert_dto.py create mode 100644 immich_carddav_sync/immich_client/models/tags_response.py create mode 100644 immich_carddav_sync/immich_client/models/tags_update.py create mode 100644 immich_carddav_sync/immich_client/models/test_email_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/trash_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/update_album_user_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_admin_create_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_admin_delete_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_admin_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_admin_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_license.py create mode 100644 immich_carddav_sync/immich_client/models/user_preferences_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_preferences_update_dto.py create mode 100644 immich_carddav_sync/immich_client/models/user_status.py create mode 100644 immich_carddav_sync/immich_client/models/user_update_me_dto.py create mode 100644 immich_carddav_sync/immich_client/models/validate_library_dto.py create mode 100644 immich_carddav_sync/immich_client/models/validate_library_import_path_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/validate_library_response_dto.py create mode 100644 immich_carddav_sync/immich_client/models/video_container.py diff --git a/immich_carddav_sync/immich_client/api/activities/__init__.py b/immich_carddav_sync/immich_client/api/activities/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/activities/create_activity.py b/immich_carddav_sync/immich_client/api/activities/create_activity.py new file mode 100644 index 0000000..19777ee --- /dev/null +++ b/immich_carddav_sync/immich_client/api/activities/create_activity.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.activity_create_dto import ActivityCreateDto +from ...models.activity_response_dto import ActivityResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: ActivityCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/activities", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ActivityResponseDto]: + if response.status_code == 201: + response_201 = ActivityResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ActivityResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ActivityCreateDto, +) -> Response[ActivityResponseDto]: + """ + Args: + body (ActivityCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivityResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ActivityCreateDto, +) -> Optional[ActivityResponseDto]: + """ + Args: + body (ActivityCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivityResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ActivityCreateDto, +) -> Response[ActivityResponseDto]: + """ + Args: + body (ActivityCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivityResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ActivityCreateDto, +) -> Optional[ActivityResponseDto]: + """ + Args: + body (ActivityCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivityResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/activities/delete_activity.py b/immich_carddav_sync/immich_client/api/activities/delete_activity.py new file mode 100644 index 0000000..f544ce9 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/activities/delete_activity.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/activities/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/activities/get_activities.py b/immich_carddav_sync/immich_client/api/activities/get_activities.py new file mode 100644 index 0000000..99c2a2e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/activities/get_activities.py @@ -0,0 +1,237 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.activity_response_dto import ActivityResponseDto +from ...models.reaction_level import ReactionLevel +from ...models.reaction_type import ReactionType +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, + level: Union[Unset, ReactionLevel] = UNSET, + type: Union[Unset, ReactionType] = UNSET, + user_id: Union[Unset, UUID] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_album_id = str(album_id) + params["albumId"] = json_album_id + + json_asset_id: Union[Unset, str] = UNSET + if not isinstance(asset_id, Unset): + json_asset_id = str(asset_id) + params["assetId"] = json_asset_id + + json_level: Union[Unset, str] = UNSET + if not isinstance(level, Unset): + json_level = level.value + + params["level"] = json_level + + json_type: Union[Unset, str] = UNSET + if not isinstance(type, Unset): + json_type = type.value + + params["type"] = json_type + + json_user_id: Union[Unset, str] = UNSET + if not isinstance(user_id, Unset): + json_user_id = str(user_id) + params["userId"] = json_user_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/activities", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["ActivityResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ActivityResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["ActivityResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, + level: Union[Unset, ReactionLevel] = UNSET, + type: Union[Unset, ReactionType] = UNSET, + user_id: Union[Unset, UUID] = UNSET, +) -> Response[List["ActivityResponseDto"]]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + level (Union[Unset, ReactionLevel]): + type (Union[Unset, ReactionType]): + user_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['ActivityResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + asset_id=asset_id, + level=level, + type=type, + user_id=user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, + level: Union[Unset, ReactionLevel] = UNSET, + type: Union[Unset, ReactionType] = UNSET, + user_id: Union[Unset, UUID] = UNSET, +) -> Optional[List["ActivityResponseDto"]]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + level (Union[Unset, ReactionLevel]): + type (Union[Unset, ReactionType]): + user_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['ActivityResponseDto'] + """ + + return sync_detailed( + client=client, + album_id=album_id, + asset_id=asset_id, + level=level, + type=type, + user_id=user_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, + level: Union[Unset, ReactionLevel] = UNSET, + type: Union[Unset, ReactionType] = UNSET, + user_id: Union[Unset, UUID] = UNSET, +) -> Response[List["ActivityResponseDto"]]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + level (Union[Unset, ReactionLevel]): + type (Union[Unset, ReactionType]): + user_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['ActivityResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + asset_id=asset_id, + level=level, + type=type, + user_id=user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, + level: Union[Unset, ReactionLevel] = UNSET, + type: Union[Unset, ReactionType] = UNSET, + user_id: Union[Unset, UUID] = UNSET, +) -> Optional[List["ActivityResponseDto"]]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + level (Union[Unset, ReactionLevel]): + type (Union[Unset, ReactionType]): + user_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['ActivityResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + album_id=album_id, + asset_id=asset_id, + level=level, + type=type, + user_id=user_id, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/activities/get_activity_statistics.py b/immich_carddav_sync/immich_client/api/activities/get_activity_statistics.py new file mode 100644 index 0000000..c3d5dd6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/activities/get_activity_statistics.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.activity_statistics_response_dto import ActivityStatisticsResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_album_id = str(album_id) + params["albumId"] = json_album_id + + json_asset_id: Union[Unset, str] = UNSET + if not isinstance(asset_id, Unset): + json_asset_id = str(asset_id) + params["assetId"] = json_asset_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/activities/statistics", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ActivityStatisticsResponseDto]: + if response.status_code == 200: + response_200 = ActivityStatisticsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ActivityStatisticsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, +) -> Response[ActivityStatisticsResponseDto]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivityStatisticsResponseDto] + """ + + kwargs = _get_kwargs( + album_id=album_id, + asset_id=asset_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, +) -> Optional[ActivityStatisticsResponseDto]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivityStatisticsResponseDto + """ + + return sync_detailed( + client=client, + album_id=album_id, + asset_id=asset_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, +) -> Response[ActivityStatisticsResponseDto]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivityStatisticsResponseDto] + """ + + kwargs = _get_kwargs( + album_id=album_id, + asset_id=asset_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + album_id: UUID, + asset_id: Union[Unset, UUID] = UNSET, +) -> Optional[ActivityStatisticsResponseDto]: + """ + Args: + album_id (UUID): + asset_id (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivityStatisticsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + album_id=album_id, + asset_id=asset_id, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/__init__.py b/immich_carddav_sync/immich_client/api/albums/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/albums/add_assets_to_album.py b/immich_carddav_sync/immich_client/api/albums/add_assets_to_album.py new file mode 100644 index 0000000..1d23888 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/add_assets_to_album.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/albums/{id}/assets", + "params": params, + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/add_users_to_album.py b/immich_carddav_sync/immich_client/api/albums/add_users_to_album.py new file mode 100644 index 0000000..77d3b09 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/add_users_to_album.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.add_users_dto import AddUsersDto +from ...models.album_response_dto import AlbumResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: AddUsersDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/albums/{id}/users", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlbumResponseDto]: + if response.status_code == 200: + response_200 = AlbumResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlbumResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AddUsersDto, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + body (AddUsersDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: AddUsersDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + body (AddUsersDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AddUsersDto, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + body (AddUsersDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: AddUsersDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + body (AddUsersDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/create_album.py b/immich_carddav_sync/immich_client/api/albums/create_album.py new file mode 100644 index 0000000..278e920 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/create_album.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.album_response_dto import AlbumResponseDto +from ...models.create_album_dto import CreateAlbumDto +from ...types import Response + + +def _get_kwargs( + *, + body: CreateAlbumDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/albums", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlbumResponseDto]: + if response.status_code == 201: + response_201 = AlbumResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlbumResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateAlbumDto, +) -> Response[AlbumResponseDto]: + """ + Args: + body (CreateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateAlbumDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + body (CreateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateAlbumDto, +) -> Response[AlbumResponseDto]: + """ + Args: + body (CreateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateAlbumDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + body (CreateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/delete_album.py b/immich_carddav_sync/immich_client/api/albums/delete_album.py new file mode 100644 index 0000000..6c7ebf6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/delete_album.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/albums/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/albums/get_album_info.py b/immich_carddav_sync/immich_client/api/albums/get_album_info.py new file mode 100644 index 0000000..a88b8c4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/get_album_info.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.album_response_dto import AlbumResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + key: Union[Unset, str] = UNSET, + without_assets: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + params["withoutAssets"] = without_assets + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/albums/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlbumResponseDto]: + if response.status_code == 200: + response_200 = AlbumResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlbumResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + without_assets: Union[Unset, bool] = UNSET, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + without_assets (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + without_assets=without_assets, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + without_assets: Union[Unset, bool] = UNSET, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + without_assets (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return sync_detailed( + id=id, + client=client, + key=key, + without_assets=without_assets, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + without_assets: Union[Unset, bool] = UNSET, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + without_assets (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + without_assets=without_assets, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + without_assets: Union[Unset, bool] = UNSET, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + without_assets (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + key=key, + without_assets=without_assets, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/get_album_statistics.py b/immich_carddav_sync/immich_client/api/albums/get_album_statistics.py new file mode 100644 index 0000000..a97841f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/get_album_statistics.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.album_statistics_response_dto import AlbumStatisticsResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/albums/statistics", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlbumStatisticsResponseDto]: + if response.status_code == 200: + response_200 = AlbumStatisticsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlbumStatisticsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[AlbumStatisticsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumStatisticsResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[AlbumStatisticsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumStatisticsResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AlbumStatisticsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumStatisticsResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[AlbumStatisticsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumStatisticsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/get_all_albums.py b/immich_carddav_sync/immich_client/api/albums/get_all_albums.py new file mode 100644 index 0000000..927b2d3 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/get_all_albums.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.album_response_dto import AlbumResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + asset_id: Union[Unset, UUID] = UNSET, + shared: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_asset_id: Union[Unset, str] = UNSET + if not isinstance(asset_id, Unset): + json_asset_id = str(asset_id) + params["assetId"] = json_asset_id + + params["shared"] = shared + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/albums", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AlbumResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AlbumResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AlbumResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + asset_id: Union[Unset, UUID] = UNSET, + shared: Union[Unset, bool] = UNSET, +) -> Response[List["AlbumResponseDto"]]: + """ + Args: + asset_id (Union[Unset, UUID]): + shared (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AlbumResponseDto']] + """ + + kwargs = _get_kwargs( + asset_id=asset_id, + shared=shared, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + asset_id: Union[Unset, UUID] = UNSET, + shared: Union[Unset, bool] = UNSET, +) -> Optional[List["AlbumResponseDto"]]: + """ + Args: + asset_id (Union[Unset, UUID]): + shared (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AlbumResponseDto'] + """ + + return sync_detailed( + client=client, + asset_id=asset_id, + shared=shared, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + asset_id: Union[Unset, UUID] = UNSET, + shared: Union[Unset, bool] = UNSET, +) -> Response[List["AlbumResponseDto"]]: + """ + Args: + asset_id (Union[Unset, UUID]): + shared (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AlbumResponseDto']] + """ + + kwargs = _get_kwargs( + asset_id=asset_id, + shared=shared, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + asset_id: Union[Unset, UUID] = UNSET, + shared: Union[Unset, bool] = UNSET, +) -> Optional[List["AlbumResponseDto"]]: + """ + Args: + asset_id (Union[Unset, UUID]): + shared (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AlbumResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + asset_id=asset_id, + shared=shared, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/remove_asset_from_album.py b/immich_carddav_sync/immich_client/api/albums/remove_asset_from_album.py new file mode 100644 index 0000000..a36aa8f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/remove_asset_from_album.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/albums/{id}/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/remove_user_from_album.py b/immich_carddav_sync/immich_client/api/albums/remove_user_from_album.py new file mode 100644 index 0000000..0d5e050 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/remove_user_from_album.py @@ -0,0 +1,99 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, + user_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/albums/{id}/user/{user_id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + user_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + user_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + user_id=user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + user_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + user_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + user_id=user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/albums/update_album_info.py b/immich_carddav_sync/immich_client/api/albums/update_album_info.py new file mode 100644 index 0000000..f86fc6e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/update_album_info.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.album_response_dto import AlbumResponseDto +from ...models.update_album_dto import UpdateAlbumDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UpdateAlbumDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "patch", + "url": f"/albums/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AlbumResponseDto]: + if response.status_code == 200: + response_200 = AlbumResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AlbumResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAlbumDto, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + body (UpdateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAlbumDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + body (UpdateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAlbumDto, +) -> Response[AlbumResponseDto]: + """ + Args: + id (UUID): + body (UpdateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlbumResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAlbumDto, +) -> Optional[AlbumResponseDto]: + """ + Args: + id (UUID): + body (UpdateAlbumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlbumResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/albums/update_album_user.py b/immich_carddav_sync/immich_client/api/albums/update_album_user.py new file mode 100644 index 0000000..8ffeee3 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/albums/update_album_user.py @@ -0,0 +1,116 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.update_album_user_dto import UpdateAlbumUserDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + user_id: str, + *, + body: UpdateAlbumUserDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/albums/{id}/user/{user_id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + user_id: str, + *, + client: AuthenticatedClient, + body: UpdateAlbumUserDto, +) -> Response[Any]: + """ + Args: + id (UUID): + user_id (str): + body (UpdateAlbumUserDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + user_id=user_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + user_id: str, + *, + client: AuthenticatedClient, + body: UpdateAlbumUserDto, +) -> Response[Any]: + """ + Args: + id (UUID): + user_id (str): + body (UpdateAlbumUserDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + user_id=user_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/api_keys/__init__.py b/immich_carddav_sync/immich_client/api/api_keys/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/api_keys/create_api_key.py b/immich_carddav_sync/immich_client/api/api_keys/create_api_key.py new file mode 100644 index 0000000..96bab72 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/api_keys/create_api_key.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_key_create_dto import APIKeyCreateDto +from ...models.api_key_create_response_dto import APIKeyCreateResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: APIKeyCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/api-keys", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[APIKeyCreateResponseDto]: + if response.status_code == 201: + response_201 = APIKeyCreateResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[APIKeyCreateResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: APIKeyCreateDto, +) -> Response[APIKeyCreateResponseDto]: + """ + Args: + body (APIKeyCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyCreateResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: APIKeyCreateDto, +) -> Optional[APIKeyCreateResponseDto]: + """ + Args: + body (APIKeyCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyCreateResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: APIKeyCreateDto, +) -> Response[APIKeyCreateResponseDto]: + """ + Args: + body (APIKeyCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyCreateResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: APIKeyCreateDto, +) -> Optional[APIKeyCreateResponseDto]: + """ + Args: + body (APIKeyCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyCreateResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_keys/delete_api_key.py b/immich_carddav_sync/immich_client/api/api_keys/delete_api_key.py new file mode 100644 index 0000000..82a0944 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/api_keys/delete_api_key.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/api-keys/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/api_keys/get_api_key.py b/immich_carddav_sync/immich_client/api/api_keys/get_api_key.py new file mode 100644 index 0000000..d4f4cc0 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/api_keys/get_api_key.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_key_response_dto import APIKeyResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/api-keys/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[APIKeyResponseDto]: + if response.status_code == 200: + response_200 = APIKeyResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[APIKeyResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[APIKeyResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[APIKeyResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[APIKeyResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[APIKeyResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_keys/get_api_keys.py b/immich_carddav_sync/immich_client/api/api_keys/get_api_keys.py new file mode 100644 index 0000000..e5b76d6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/api_keys/get_api_keys.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_key_response_dto import APIKeyResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/api-keys", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["APIKeyResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = APIKeyResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["APIKeyResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["APIKeyResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['APIKeyResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["APIKeyResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['APIKeyResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["APIKeyResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['APIKeyResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["APIKeyResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['APIKeyResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_keys/update_api_key.py b/immich_carddav_sync/immich_client/api/api_keys/update_api_key.py new file mode 100644 index 0000000..900fc17 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/api_keys/update_api_key.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.api_key_response_dto import APIKeyResponseDto +from ...models.api_key_update_dto import APIKeyUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: APIKeyUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/api-keys/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[APIKeyResponseDto]: + if response.status_code == 200: + response_200 = APIKeyResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[APIKeyResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: APIKeyUpdateDto, +) -> Response[APIKeyResponseDto]: + """ + Args: + id (UUID): + body (APIKeyUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: APIKeyUpdateDto, +) -> Optional[APIKeyResponseDto]: + """ + Args: + id (UUID): + body (APIKeyUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: APIKeyUpdateDto, +) -> Response[APIKeyResponseDto]: + """ + Args: + id (UUID): + body (APIKeyUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[APIKeyResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: APIKeyUpdateDto, +) -> Optional[APIKeyResponseDto]: + """ + Args: + id (UUID): + body (APIKeyUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + APIKeyResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/__init__.py b/immich_carddav_sync/immich_client/api/assets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/assets/check_bulk_upload.py b/immich_carddav_sync/immich_client/api/assets/check_bulk_upload.py new file mode 100644 index 0000000..3902c46 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/check_bulk_upload.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_bulk_upload_check_dto import AssetBulkUploadCheckDto +from ...models.asset_bulk_upload_check_response_dto import AssetBulkUploadCheckResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetBulkUploadCheckDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/assets/bulk-upload-check", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetBulkUploadCheckResponseDto]: + if response.status_code == 200: + response_200 = AssetBulkUploadCheckResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetBulkUploadCheckResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkUploadCheckDto, +) -> Response[AssetBulkUploadCheckResponseDto]: + """Checks if assets exist by checksums + + Args: + body (AssetBulkUploadCheckDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetBulkUploadCheckResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: AssetBulkUploadCheckDto, +) -> Optional[AssetBulkUploadCheckResponseDto]: + """Checks if assets exist by checksums + + Args: + body (AssetBulkUploadCheckDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetBulkUploadCheckResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkUploadCheckDto, +) -> Response[AssetBulkUploadCheckResponseDto]: + """Checks if assets exist by checksums + + Args: + body (AssetBulkUploadCheckDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetBulkUploadCheckResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: AssetBulkUploadCheckDto, +) -> Optional[AssetBulkUploadCheckResponseDto]: + """Checks if assets exist by checksums + + Args: + body (AssetBulkUploadCheckDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetBulkUploadCheckResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/check_existing_assets.py b/immich_carddav_sync/immich_client/api/assets/check_existing_assets.py new file mode 100644 index 0000000..da1f053 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/check_existing_assets.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.check_existing_assets_dto import CheckExistingAssetsDto +from ...models.check_existing_assets_response_dto import CheckExistingAssetsResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: CheckExistingAssetsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/assets/exist", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CheckExistingAssetsResponseDto]: + if response.status_code == 200: + response_200 = CheckExistingAssetsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CheckExistingAssetsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CheckExistingAssetsDto, +) -> Response[CheckExistingAssetsResponseDto]: + """Checks if multiple assets exist on the server and returns all existing - used by background backup + + Args: + body (CheckExistingAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CheckExistingAssetsResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CheckExistingAssetsDto, +) -> Optional[CheckExistingAssetsResponseDto]: + """Checks if multiple assets exist on the server and returns all existing - used by background backup + + Args: + body (CheckExistingAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CheckExistingAssetsResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CheckExistingAssetsDto, +) -> Response[CheckExistingAssetsResponseDto]: + """Checks if multiple assets exist on the server and returns all existing - used by background backup + + Args: + body (CheckExistingAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CheckExistingAssetsResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CheckExistingAssetsDto, +) -> Optional[CheckExistingAssetsResponseDto]: + """Checks if multiple assets exist on the server and returns all existing - used by background backup + + Args: + body (CheckExistingAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CheckExistingAssetsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/delete_assets.py b/immich_carddav_sync/immich_client/api/assets/delete_assets.py new file mode 100644 index 0000000..58ccd94 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/delete_assets.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_bulk_delete_dto import AssetBulkDeleteDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetBulkDeleteDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkDeleteDto, +) -> Response[Any]: + """ + Args: + body (AssetBulkDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkDeleteDto, +) -> Response[Any]: + """ + Args: + body (AssetBulkDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/assets/download_asset.py b/immich_carddav_sync/immich_client/api/assets/download_asset.py new file mode 100644 index 0000000..9107e21 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/download_asset.py @@ -0,0 +1,164 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/assets/{id}/original", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + id=id, + client=client, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/get_all_user_assets_by_device_id.py b/immich_carddav_sync/immich_client/api/assets/get_all_user_assets_by_device_id.py new file mode 100644 index 0000000..28f564a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/get_all_user_assets_by_device_id.py @@ -0,0 +1,145 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + device_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/assets/device/{device_id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]: + if response.status_code == 200: + response_200 = cast(List[str], response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + device_id: str, + *, + client: AuthenticatedClient, +) -> Response[List[str]]: + """Get all asset of a device that are in the database, ID only. + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs( + device_id=device_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + device_id: str, + *, + client: AuthenticatedClient, +) -> Optional[List[str]]: + """Get all asset of a device that are in the database, ID only. + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return sync_detailed( + device_id=device_id, + client=client, + ).parsed + + +async def asyncio_detailed( + device_id: str, + *, + client: AuthenticatedClient, +) -> Response[List[str]]: + """Get all asset of a device that are in the database, ID only. + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs( + device_id=device_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + device_id: str, + *, + client: AuthenticatedClient, +) -> Optional[List[str]]: + """Get all asset of a device that are in the database, ID only. + + Args: + device_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return ( + await asyncio_detailed( + device_id=device_id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/get_asset_info.py b/immich_carddav_sync/immich_client/api/assets/get_asset_info.py new file mode 100644 index 0000000..86d41f2 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/get_asset_info.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/assets/{id}", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetResponseDto]: + if response.status_code == 200: + response_200 = AssetResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[AssetResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[AssetResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetResponseDto + """ + + return sync_detailed( + id=id, + client=client, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[AssetResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[AssetResponseDto]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/get_asset_statistics.py b/immich_carddav_sync/immich_client/api/assets/get_asset_statistics.py new file mode 100644 index 0000000..4e881ab --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/get_asset_statistics.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_stats_response_dto import AssetStatsResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["isArchived"] = is_archived + + params["isFavorite"] = is_favorite + + params["isTrashed"] = is_trashed + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/assets/statistics", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetStatsResponseDto]: + if response.status_code == 200: + response_200 = AssetStatsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetStatsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, +) -> Response[AssetStatsResponseDto]: + """ + Args: + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetStatsResponseDto] + """ + + kwargs = _get_kwargs( + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, +) -> Optional[AssetStatsResponseDto]: + """ + Args: + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetStatsResponseDto + """ + + return sync_detailed( + client=client, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, +) -> Response[AssetStatsResponseDto]: + """ + Args: + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetStatsResponseDto] + """ + + kwargs = _get_kwargs( + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, +) -> Optional[AssetStatsResponseDto]: + """ + Args: + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetStatsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/get_memory_lane.py b/immich_carddav_sync/immich_client/api/assets/get_memory_lane.py new file mode 100644 index 0000000..04fd4bb --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/get_memory_lane.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.memory_lane_response_dto import MemoryLaneResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + day: int, + month: int, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["day"] = day + + params["month"] = month + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/assets/memory-lane", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["MemoryLaneResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = MemoryLaneResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["MemoryLaneResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + day: int, + month: int, +) -> Response[List["MemoryLaneResponseDto"]]: + """ + Args: + day (int): + month (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MemoryLaneResponseDto']] + """ + + kwargs = _get_kwargs( + day=day, + month=month, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + day: int, + month: int, +) -> Optional[List["MemoryLaneResponseDto"]]: + """ + Args: + day (int): + month (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MemoryLaneResponseDto'] + """ + + return sync_detailed( + client=client, + day=day, + month=month, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + day: int, + month: int, +) -> Response[List["MemoryLaneResponseDto"]]: + """ + Args: + day (int): + month (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MemoryLaneResponseDto']] + """ + + kwargs = _get_kwargs( + day=day, + month=month, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + day: int, + month: int, +) -> Optional[List["MemoryLaneResponseDto"]]: + """ + Args: + day (int): + month (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MemoryLaneResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + day=day, + month=month, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/get_random.py b/immich_carddav_sync/immich_client/api/assets/get_random.py new file mode 100644 index 0000000..6186343 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/get_random.py @@ -0,0 +1,163 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + count: Union[Unset, float] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["count"] = count + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/assets/random", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + count: Union[Unset, float] = UNSET, +) -> Response[List["AssetResponseDto"]]: + """This property was deprecated in v1.116.0 + + Args: + count (Union[Unset, float]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + count=count, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + count: Union[Unset, float] = UNSET, +) -> Optional[List["AssetResponseDto"]]: + """This property was deprecated in v1.116.0 + + Args: + count (Union[Unset, float]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + count=count, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + count: Union[Unset, float] = UNSET, +) -> Response[List["AssetResponseDto"]]: + """This property was deprecated in v1.116.0 + + Args: + count (Union[Unset, float]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + count=count, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + count: Union[Unset, float] = UNSET, +) -> Optional[List["AssetResponseDto"]]: + """This property was deprecated in v1.116.0 + + Args: + count (Union[Unset, float]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + count=count, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/play_asset_video.py b/immich_carddav_sync/immich_client/api/assets/play_asset_video.py new file mode 100644 index 0000000..b1772e0 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/play_asset_video.py @@ -0,0 +1,164 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/assets/{id}/video/playback", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + id=id, + client=client, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/replace_asset.py b/immich_carddav_sync/immich_client/api/assets/replace_asset.py new file mode 100644 index 0000000..bde5e82 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/replace_asset.py @@ -0,0 +1,193 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_media_replace_dto import AssetMediaReplaceDto +from ...models.asset_media_response_dto import AssetMediaResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + body: AssetMediaReplaceDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/assets/{id}/original", + "params": params, + } + + _body = body.to_multipart() + + _kwargs["files"] = _body + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetMediaResponseDto]: + if response.status_code == 200: + response_200 = AssetMediaResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetMediaResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetMediaReplaceDto, + key: Union[Unset, str] = UNSET, +) -> Response[AssetMediaResponseDto]: + """Replace the asset with new file, without changing its id + + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetMediaReplaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetMediaResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetMediaReplaceDto, + key: Union[Unset, str] = UNSET, +) -> Optional[AssetMediaResponseDto]: + """Replace the asset with new file, without changing its id + + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetMediaReplaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetMediaResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetMediaReplaceDto, + key: Union[Unset, str] = UNSET, +) -> Response[AssetMediaResponseDto]: + """Replace the asset with new file, without changing its id + + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetMediaReplaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetMediaResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetMediaReplaceDto, + key: Union[Unset, str] = UNSET, +) -> Optional[AssetMediaResponseDto]: + """Replace the asset with new file, without changing its id + + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetMediaReplaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetMediaResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/run_asset_jobs.py b/immich_carddav_sync/immich_client/api/assets/run_asset_jobs.py new file mode 100644 index 0000000..3edce8b --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/run_asset_jobs.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_jobs_dto import AssetJobsDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetJobsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/assets/jobs", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetJobsDto, +) -> Response[Any]: + """ + Args: + body (AssetJobsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetJobsDto, +) -> Response[Any]: + """ + Args: + body (AssetJobsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/assets/update_asset.py b/immich_carddav_sync/immich_client/api/assets/update_asset.py new file mode 100644 index 0000000..90ec9ba --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/update_asset.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...models.update_asset_dto import UpdateAssetDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UpdateAssetDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/assets/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetResponseDto]: + if response.status_code == 200: + response_200 = AssetResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAssetDto, +) -> Response[AssetResponseDto]: + """ + Args: + id (UUID): + body (UpdateAssetDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAssetDto, +) -> Optional[AssetResponseDto]: + """ + Args: + id (UUID): + body (UpdateAssetDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAssetDto, +) -> Response[AssetResponseDto]: + """ + Args: + id (UUID): + body (UpdateAssetDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateAssetDto, +) -> Optional[AssetResponseDto]: + """ + Args: + id (UUID): + body (UpdateAssetDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/update_assets.py b/immich_carddav_sync/immich_client/api/assets/update_assets.py new file mode 100644 index 0000000..856402b --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/update_assets.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_bulk_update_dto import AssetBulkUpdateDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetBulkUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkUpdateDto, +) -> Response[Any]: + """ + Args: + body (AssetBulkUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetBulkUpdateDto, +) -> Response[Any]: + """ + Args: + body (AssetBulkUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/assets/upload_asset.py b/immich_carddav_sync/immich_client/api/assets/upload_asset.py new file mode 100644 index 0000000..0d0152a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/upload_asset.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_media_create_dto import AssetMediaCreateDto +from ...models.asset_media_response_dto import AssetMediaResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: AssetMediaCreateDto, + key: Union[Unset, str] = UNSET, + x_immich_checksum: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + if not isinstance(x_immich_checksum, Unset): + headers["x-immich-checksum"] = x_immich_checksum + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/assets", + "params": params, + } + + _body = body.to_multipart() + + _kwargs["files"] = _body + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetMediaResponseDto]: + if response.status_code == 201: + response_201 = AssetMediaResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetMediaResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetMediaCreateDto, + key: Union[Unset, str] = UNSET, + x_immich_checksum: Union[Unset, str] = UNSET, +) -> Response[AssetMediaResponseDto]: + """ + Args: + key (Union[Unset, str]): + x_immich_checksum (Union[Unset, str]): + body (AssetMediaCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetMediaResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + x_immich_checksum=x_immich_checksum, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: AssetMediaCreateDto, + key: Union[Unset, str] = UNSET, + x_immich_checksum: Union[Unset, str] = UNSET, +) -> Optional[AssetMediaResponseDto]: + """ + Args: + key (Union[Unset, str]): + x_immich_checksum (Union[Unset, str]): + body (AssetMediaCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetMediaResponseDto + """ + + return sync_detailed( + client=client, + body=body, + key=key, + x_immich_checksum=x_immich_checksum, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetMediaCreateDto, + key: Union[Unset, str] = UNSET, + x_immich_checksum: Union[Unset, str] = UNSET, +) -> Response[AssetMediaResponseDto]: + """ + Args: + key (Union[Unset, str]): + x_immich_checksum (Union[Unset, str]): + body (AssetMediaCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetMediaResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + x_immich_checksum=x_immich_checksum, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: AssetMediaCreateDto, + key: Union[Unset, str] = UNSET, + x_immich_checksum: Union[Unset, str] = UNSET, +) -> Optional[AssetMediaResponseDto]: + """ + Args: + key (Union[Unset, str]): + x_immich_checksum (Union[Unset, str]): + body (AssetMediaCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetMediaResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + key=key, + x_immich_checksum=x_immich_checksum, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/assets/view_asset.py b/immich_carddav_sync/immich_client/api/assets/view_asset.py new file mode 100644 index 0000000..81347f8 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/assets/view_asset.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_media_size import AssetMediaSize +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + key: Union[Unset, str] = UNSET, + size: Union[Unset, AssetMediaSize] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + json_size: Union[Unset, str] = UNSET + if not isinstance(size, Unset): + json_size = size.value + + params["size"] = json_size + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/assets/{id}/thumbnail", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + size: Union[Unset, AssetMediaSize] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + size (Union[Unset, AssetMediaSize]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + size=size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + size: Union[Unset, AssetMediaSize] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + size (Union[Unset, AssetMediaSize]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + id=id, + client=client, + key=key, + size=size, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + size: Union[Unset, AssetMediaSize] = UNSET, +) -> Response[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + size (Union[Unset, AssetMediaSize]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + size=size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + size: Union[Unset, AssetMediaSize] = UNSET, +) -> Optional[File]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + size (Union[Unset, AssetMediaSize]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + key=key, + size=size, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/download/__init__.py b/immich_carddav_sync/immich_client/api/download/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/download/download_archive.py b/immich_carddav_sync/immich_client/api/download/download_archive.py new file mode 100644 index 0000000..d63dfd2 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/download/download_archive.py @@ -0,0 +1,172 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_ids_dto import AssetIdsDto +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + *, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/download/archive", + "params": params, + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[File]: + """ + Args: + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[File]: + """ + Args: + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/download/get_download_info.py b/immich_carddav_sync/immich_client/api/download/get_download_info.py new file mode 100644 index 0000000..740b1e3 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/download/get_download_info.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.download_info_dto import DownloadInfoDto +from ...models.download_response_dto import DownloadResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: DownloadInfoDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/download/info", + "params": params, + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DownloadResponseDto]: + if response.status_code == 201: + response_201 = DownloadResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[DownloadResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: DownloadInfoDto, + key: Union[Unset, str] = UNSET, +) -> Response[DownloadResponseDto]: + """ + Args: + key (Union[Unset, str]): + body (DownloadInfoDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DownloadResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DownloadInfoDto, + key: Union[Unset, str] = UNSET, +) -> Optional[DownloadResponseDto]: + """ + Args: + key (Union[Unset, str]): + body (DownloadInfoDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DownloadResponseDto + """ + + return sync_detailed( + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DownloadInfoDto, + key: Union[Unset, str] = UNSET, +) -> Response[DownloadResponseDto]: + """ + Args: + key (Union[Unset, str]): + body (DownloadInfoDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DownloadResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: DownloadInfoDto, + key: Union[Unset, str] = UNSET, +) -> Optional[DownloadResponseDto]: + """ + Args: + key (Union[Unset, str]): + body (DownloadInfoDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DownloadResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/duplicates/__init__.py b/immich_carddav_sync/immich_client/api/duplicates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/duplicates/get_asset_duplicates.py b/immich_carddav_sync/immich_client/api/duplicates/get_asset_duplicates.py new file mode 100644 index 0000000..23c0988 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/duplicates/get_asset_duplicates.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.duplicate_response_dto import DuplicateResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/duplicates", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["DuplicateResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = DuplicateResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["DuplicateResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["DuplicateResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['DuplicateResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["DuplicateResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['DuplicateResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["DuplicateResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['DuplicateResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["DuplicateResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['DuplicateResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/faces/__init__.py b/immich_carddav_sync/immich_client/api/faces/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/faces/get_faces.py b/immich_carddav_sync/immich_client/api/faces/get_faces.py new file mode 100644 index 0000000..bf1ffde --- /dev/null +++ b/immich_carddav_sync/immich_client/api/faces/get_faces.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_face_response_dto import AssetFaceResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + id: UUID, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_id = str(id) + params["id"] = json_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/faces", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetFaceResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetFaceResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetFaceResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + id: UUID, +) -> Response[List["AssetFaceResponseDto"]]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetFaceResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + id: UUID, +) -> Optional[List["AssetFaceResponseDto"]]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetFaceResponseDto'] + """ + + return sync_detailed( + client=client, + id=id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + id: UUID, +) -> Response[List["AssetFaceResponseDto"]]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetFaceResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + id: UUID, +) -> Optional[List["AssetFaceResponseDto"]]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetFaceResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + id=id, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/faces/reassign_faces_by_id.py b/immich_carddav_sync/immich_client/api/faces/reassign_faces_by_id.py new file mode 100644 index 0000000..8325f7a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/faces/reassign_faces_by_id.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.face_dto import FaceDto +from ...models.person_response_dto import PersonResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: FaceDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/faces/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PersonResponseDto]: + if response.status_code == 200: + response_200 = PersonResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PersonResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: FaceDto, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + body (FaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: FaceDto, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + body (FaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: FaceDto, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + body (FaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: FaceDto, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + body (FaceDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/file_reports/__init__.py b/immich_carddav_sync/immich_client/api/file_reports/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/file_reports/fix_audit_files.py b/immich_carddav_sync/immich_client/api/file_reports/fix_audit_files.py new file mode 100644 index 0000000..e9b6531 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/file_reports/fix_audit_files.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_report_fix_dto import FileReportFixDto +from ...types import Response + + +def _get_kwargs( + *, + body: FileReportFixDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/reports/fix", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 201: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: FileReportFixDto, +) -> Response[Any]: + """ + Args: + body (FileReportFixDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: FileReportFixDto, +) -> Response[Any]: + """ + Args: + body (FileReportFixDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/file_reports/get_audit_files.py b/immich_carddav_sync/immich_client/api/file_reports/get_audit_files.py new file mode 100644 index 0000000..0cbe0a5 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/file_reports/get_audit_files.py @@ -0,0 +1,118 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_report_dto import FileReportDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/reports", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[FileReportDto]: + if response.status_code == 200: + response_200 = FileReportDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[FileReportDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[FileReportDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FileReportDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[FileReportDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FileReportDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[FileReportDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[FileReportDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[FileReportDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + FileReportDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/file_reports/get_file_checksums.py b/immich_carddav_sync/immich_client/api/file_reports/get_file_checksums.py new file mode 100644 index 0000000..20fbe2a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/file_reports/get_file_checksums.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.file_checksum_dto import FileChecksumDto +from ...models.file_checksum_response_dto import FileChecksumResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: FileChecksumDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/reports/checksum", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["FileChecksumResponseDto"]]: + if response.status_code == 201: + response_201 = [] + _response_201 = response.json() + for response_201_item_data in _response_201: + response_201_item = FileChecksumResponseDto.from_dict(response_201_item_data) + + response_201.append(response_201_item) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["FileChecksumResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: FileChecksumDto, +) -> Response[List["FileChecksumResponseDto"]]: + """ + Args: + body (FileChecksumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['FileChecksumResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: FileChecksumDto, +) -> Optional[List["FileChecksumResponseDto"]]: + """ + Args: + body (FileChecksumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['FileChecksumResponseDto'] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: FileChecksumDto, +) -> Response[List["FileChecksumResponseDto"]]: + """ + Args: + body (FileChecksumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['FileChecksumResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: FileChecksumDto, +) -> Optional[List["FileChecksumResponseDto"]]: + """ + Args: + body (FileChecksumDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['FileChecksumResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/jobs/__init__.py b/immich_carddav_sync/immich_client/api/jobs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/jobs/create_job.py b/immich_carddav_sync/immich_client/api/jobs/create_job.py new file mode 100644 index 0000000..7a28323 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/jobs/create_job.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.job_create_dto import JobCreateDto +from ...types import Response + + +def _get_kwargs( + *, + body: JobCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/jobs", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 201: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: JobCreateDto, +) -> Response[Any]: + """ + Args: + body (JobCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: JobCreateDto, +) -> Response[Any]: + """ + Args: + body (JobCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/jobs/get_all_jobs_status.py b/immich_carddav_sync/immich_client/api/jobs/get_all_jobs_status.py new file mode 100644 index 0000000..93c3923 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/jobs/get_all_jobs_status.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.all_job_status_response_dto import AllJobStatusResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/jobs", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AllJobStatusResponseDto]: + if response.status_code == 200: + response_200 = AllJobStatusResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AllJobStatusResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[AllJobStatusResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AllJobStatusResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[AllJobStatusResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AllJobStatusResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AllJobStatusResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AllJobStatusResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[AllJobStatusResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AllJobStatusResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/jobs/send_job_command.py b/immich_carddav_sync/immich_client/api/jobs/send_job_command.py new file mode 100644 index 0000000..8d2b905 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/jobs/send_job_command.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.job_command_dto import JobCommandDto +from ...models.job_name import JobName +from ...models.job_status_dto import JobStatusDto +from ...types import Response + + +def _get_kwargs( + id: JobName, + *, + body: JobCommandDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/jobs/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[JobStatusDto]: + if response.status_code == 200: + response_200 = JobStatusDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[JobStatusDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: JobName, + *, + client: AuthenticatedClient, + body: JobCommandDto, +) -> Response[JobStatusDto]: + """ + Args: + id (JobName): + body (JobCommandDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[JobStatusDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: JobName, + *, + client: AuthenticatedClient, + body: JobCommandDto, +) -> Optional[JobStatusDto]: + """ + Args: + id (JobName): + body (JobCommandDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + JobStatusDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: JobName, + *, + client: AuthenticatedClient, + body: JobCommandDto, +) -> Response[JobStatusDto]: + """ + Args: + id (JobName): + body (JobCommandDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[JobStatusDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: JobName, + *, + client: AuthenticatedClient, + body: JobCommandDto, +) -> Optional[JobStatusDto]: + """ + Args: + id (JobName): + body (JobCommandDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + JobStatusDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/__init__.py b/immich_carddav_sync/immich_client/api/libraries/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/libraries/create_library.py b/immich_carddav_sync/immich_client/api/libraries/create_library.py new file mode 100644 index 0000000..cb21172 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/create_library.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_library_dto import CreateLibraryDto +from ...models.library_response_dto import LibraryResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: CreateLibraryDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/libraries", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LibraryResponseDto]: + if response.status_code == 201: + response_201 = LibraryResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LibraryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateLibraryDto, +) -> Response[LibraryResponseDto]: + """ + Args: + body (CreateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateLibraryDto, +) -> Optional[LibraryResponseDto]: + """ + Args: + body (CreateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateLibraryDto, +) -> Response[LibraryResponseDto]: + """ + Args: + body (CreateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateLibraryDto, +) -> Optional[LibraryResponseDto]: + """ + Args: + body (CreateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/delete_library.py b/immich_carddav_sync/immich_client/api/libraries/delete_library.py new file mode 100644 index 0000000..bf92791 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/delete_library.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/libraries/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/libraries/get_all_libraries.py b/immich_carddav_sync/immich_client/api/libraries/get_all_libraries.py new file mode 100644 index 0000000..7cd103c --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/get_all_libraries.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.library_response_dto import LibraryResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/libraries", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["LibraryResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = LibraryResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["LibraryResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["LibraryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['LibraryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["LibraryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['LibraryResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["LibraryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['LibraryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["LibraryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['LibraryResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/get_library.py b/immich_carddav_sync/immich_client/api/libraries/get_library.py new file mode 100644 index 0000000..928e576 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/get_library.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.library_response_dto import LibraryResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/libraries/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LibraryResponseDto]: + if response.status_code == 200: + response_200 = LibraryResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LibraryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[LibraryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[LibraryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[LibraryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[LibraryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/get_library_statistics.py b/immich_carddav_sync/immich_client/api/libraries/get_library_statistics.py new file mode 100644 index 0000000..b61ae72 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/get_library_statistics.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.library_stats_response_dto import LibraryStatsResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/libraries/{id}/statistics", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LibraryStatsResponseDto]: + if response.status_code == 200: + response_200 = LibraryStatsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LibraryStatsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[LibraryStatsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryStatsResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[LibraryStatsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryStatsResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[LibraryStatsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryStatsResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[LibraryStatsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryStatsResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/scan_library.py b/immich_carddav_sync/immich_client/api/libraries/scan_library.py new file mode 100644 index 0000000..e8d4abb --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/scan_library.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/libraries/{id}/scan", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/libraries/update_library.py b/immich_carddav_sync/immich_client/api/libraries/update_library.py new file mode 100644 index 0000000..f2e057d --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/update_library.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.library_response_dto import LibraryResponseDto +from ...models.update_library_dto import UpdateLibraryDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UpdateLibraryDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/libraries/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LibraryResponseDto]: + if response.status_code == 200: + response_200 = LibraryResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LibraryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateLibraryDto, +) -> Response[LibraryResponseDto]: + """ + Args: + id (UUID): + body (UpdateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateLibraryDto, +) -> Optional[LibraryResponseDto]: + """ + Args: + id (UUID): + body (UpdateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateLibraryDto, +) -> Response[LibraryResponseDto]: + """ + Args: + id (UUID): + body (UpdateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdateLibraryDto, +) -> Optional[LibraryResponseDto]: + """ + Args: + id (UUID): + body (UpdateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LibraryResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/libraries/validate.py b/immich_carddav_sync/immich_client/api/libraries/validate.py new file mode 100644 index 0000000..954313b --- /dev/null +++ b/immich_carddav_sync/immich_client/api/libraries/validate.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.validate_library_dto import ValidateLibraryDto +from ...models.validate_library_response_dto import ValidateLibraryResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: ValidateLibraryDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/libraries/{id}/validate", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ValidateLibraryResponseDto]: + if response.status_code == 200: + response_200 = ValidateLibraryResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ValidateLibraryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: ValidateLibraryDto, +) -> Response[ValidateLibraryResponseDto]: + """ + Args: + id (UUID): + body (ValidateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateLibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: ValidateLibraryDto, +) -> Optional[ValidateLibraryResponseDto]: + """ + Args: + id (UUID): + body (ValidateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateLibraryResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: ValidateLibraryDto, +) -> Response[ValidateLibraryResponseDto]: + """ + Args: + id (UUID): + body (ValidateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ValidateLibraryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: ValidateLibraryDto, +) -> Optional[ValidateLibraryResponseDto]: + """ + Args: + id (UUID): + body (ValidateLibraryDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ValidateLibraryResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/map_/__init__.py b/immich_carddav_sync/immich_client/api/map_/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/map_/get_map_markers.py b/immich_carddav_sync/immich_client/api/map_/get_map_markers.py new file mode 100644 index 0000000..306a75e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/map_/get_map_markers.py @@ -0,0 +1,241 @@ +import datetime +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.map_marker_response_dto import MapMarkerResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + file_created_after: Union[Unset, datetime.datetime] = UNSET, + file_created_before: Union[Unset, datetime.datetime] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_shared_albums: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_file_created_after: Union[Unset, str] = UNSET + if not isinstance(file_created_after, Unset): + json_file_created_after = file_created_after.isoformat() + params["fileCreatedAfter"] = json_file_created_after + + json_file_created_before: Union[Unset, str] = UNSET + if not isinstance(file_created_before, Unset): + json_file_created_before = file_created_before.isoformat() + params["fileCreatedBefore"] = json_file_created_before + + params["isArchived"] = is_archived + + params["isFavorite"] = is_favorite + + params["withPartners"] = with_partners + + params["withSharedAlbums"] = with_shared_albums + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/map/markers", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["MapMarkerResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = MapMarkerResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["MapMarkerResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + file_created_after: Union[Unset, datetime.datetime] = UNSET, + file_created_before: Union[Unset, datetime.datetime] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_shared_albums: Union[Unset, bool] = UNSET, +) -> Response[List["MapMarkerResponseDto"]]: + """ + Args: + file_created_after (Union[Unset, datetime.datetime]): + file_created_before (Union[Unset, datetime.datetime]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + with_partners (Union[Unset, bool]): + with_shared_albums (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MapMarkerResponseDto']] + """ + + kwargs = _get_kwargs( + file_created_after=file_created_after, + file_created_before=file_created_before, + is_archived=is_archived, + is_favorite=is_favorite, + with_partners=with_partners, + with_shared_albums=with_shared_albums, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + file_created_after: Union[Unset, datetime.datetime] = UNSET, + file_created_before: Union[Unset, datetime.datetime] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_shared_albums: Union[Unset, bool] = UNSET, +) -> Optional[List["MapMarkerResponseDto"]]: + """ + Args: + file_created_after (Union[Unset, datetime.datetime]): + file_created_before (Union[Unset, datetime.datetime]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + with_partners (Union[Unset, bool]): + with_shared_albums (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MapMarkerResponseDto'] + """ + + return sync_detailed( + client=client, + file_created_after=file_created_after, + file_created_before=file_created_before, + is_archived=is_archived, + is_favorite=is_favorite, + with_partners=with_partners, + with_shared_albums=with_shared_albums, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + file_created_after: Union[Unset, datetime.datetime] = UNSET, + file_created_before: Union[Unset, datetime.datetime] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_shared_albums: Union[Unset, bool] = UNSET, +) -> Response[List["MapMarkerResponseDto"]]: + """ + Args: + file_created_after (Union[Unset, datetime.datetime]): + file_created_before (Union[Unset, datetime.datetime]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + with_partners (Union[Unset, bool]): + with_shared_albums (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MapMarkerResponseDto']] + """ + + kwargs = _get_kwargs( + file_created_after=file_created_after, + file_created_before=file_created_before, + is_archived=is_archived, + is_favorite=is_favorite, + with_partners=with_partners, + with_shared_albums=with_shared_albums, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + file_created_after: Union[Unset, datetime.datetime] = UNSET, + file_created_before: Union[Unset, datetime.datetime] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_shared_albums: Union[Unset, bool] = UNSET, +) -> Optional[List["MapMarkerResponseDto"]]: + """ + Args: + file_created_after (Union[Unset, datetime.datetime]): + file_created_before (Union[Unset, datetime.datetime]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + with_partners (Union[Unset, bool]): + with_shared_albums (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MapMarkerResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + file_created_after=file_created_after, + file_created_before=file_created_before, + is_archived=is_archived, + is_favorite=is_favorite, + with_partners=with_partners, + with_shared_albums=with_shared_albums, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/map_/reverse_geocode.py b/immich_carddav_sync/immich_client/api/map_/reverse_geocode.py new file mode 100644 index 0000000..5a20589 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/map_/reverse_geocode.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.map_reverse_geocode_response_dto import MapReverseGeocodeResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + lat: float, + lon: float, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["lat"] = lat + + params["lon"] = lon + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/map/reverse-geocode", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["MapReverseGeocodeResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = MapReverseGeocodeResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["MapReverseGeocodeResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + lat: float, + lon: float, +) -> Response[List["MapReverseGeocodeResponseDto"]]: + """ + Args: + lat (float): + lon (float): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MapReverseGeocodeResponseDto']] + """ + + kwargs = _get_kwargs( + lat=lat, + lon=lon, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + lat: float, + lon: float, +) -> Optional[List["MapReverseGeocodeResponseDto"]]: + """ + Args: + lat (float): + lon (float): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MapReverseGeocodeResponseDto'] + """ + + return sync_detailed( + client=client, + lat=lat, + lon=lon, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + lat: float, + lon: float, +) -> Response[List["MapReverseGeocodeResponseDto"]]: + """ + Args: + lat (float): + lon (float): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MapReverseGeocodeResponseDto']] + """ + + kwargs = _get_kwargs( + lat=lat, + lon=lon, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + lat: float, + lon: float, +) -> Optional[List["MapReverseGeocodeResponseDto"]]: + """ + Args: + lat (float): + lon (float): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MapReverseGeocodeResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + lat=lat, + lon=lon, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/__init__.py b/immich_carddav_sync/immich_client/api/memories/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/memories/add_memory_assets.py b/immich_carddav_sync/immich_client/api/memories/add_memory_assets.py new file mode 100644 index 0000000..5a3af7c --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/add_memory_assets.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/memories/{id}/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/create_memory.py b/immich_carddav_sync/immich_client/api/memories/create_memory.py new file mode 100644 index 0000000..b1a7cb9 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/create_memory.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.memory_create_dto import MemoryCreateDto +from ...models.memory_response_dto import MemoryResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: MemoryCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/memories", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[MemoryResponseDto]: + if response.status_code == 201: + response_201 = MemoryResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[MemoryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: MemoryCreateDto, +) -> Response[MemoryResponseDto]: + """ + Args: + body (MemoryCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: MemoryCreateDto, +) -> Optional[MemoryResponseDto]: + """ + Args: + body (MemoryCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: MemoryCreateDto, +) -> Response[MemoryResponseDto]: + """ + Args: + body (MemoryCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: MemoryCreateDto, +) -> Optional[MemoryResponseDto]: + """ + Args: + body (MemoryCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/delete_memory.py b/immich_carddav_sync/immich_client/api/memories/delete_memory.py new file mode 100644 index 0000000..46fc432 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/delete_memory.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/memories/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/memories/get_memory.py b/immich_carddav_sync/immich_client/api/memories/get_memory.py new file mode 100644 index 0000000..95ff477 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/get_memory.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.memory_response_dto import MemoryResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/memories/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[MemoryResponseDto]: + if response.status_code == 200: + response_200 = MemoryResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[MemoryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[MemoryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[MemoryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[MemoryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[MemoryResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/remove_memory_assets.py b/immich_carddav_sync/immich_client/api/memories/remove_memory_assets.py new file mode 100644 index 0000000..c99f3a6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/remove_memory_assets.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/memories/{id}/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/search_memories.py b/immich_carddav_sync/immich_client/api/memories/search_memories.py new file mode 100644 index 0000000..104974e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/search_memories.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.memory_response_dto import MemoryResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/memories", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["MemoryResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = MemoryResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["MemoryResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["MemoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MemoryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["MemoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MemoryResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["MemoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['MemoryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["MemoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['MemoryResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/memories/update_memory.py b/immich_carddav_sync/immich_client/api/memories/update_memory.py new file mode 100644 index 0000000..47ea8e6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/memories/update_memory.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.memory_response_dto import MemoryResponseDto +from ...models.memory_update_dto import MemoryUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: MemoryUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/memories/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[MemoryResponseDto]: + if response.status_code == 200: + response_200 = MemoryResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[MemoryResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: MemoryUpdateDto, +) -> Response[MemoryResponseDto]: + """ + Args: + id (UUID): + body (MemoryUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: MemoryUpdateDto, +) -> Optional[MemoryResponseDto]: + """ + Args: + id (UUID): + body (MemoryUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: MemoryUpdateDto, +) -> Response[MemoryResponseDto]: + """ + Args: + id (UUID): + body (MemoryUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[MemoryResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: MemoryUpdateDto, +) -> Optional[MemoryResponseDto]: + """ + Args: + id (UUID): + body (MemoryUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + MemoryResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/notifications/__init__.py b/immich_carddav_sync/immich_client/api/notifications/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/notifications/send_test_email.py b/immich_carddav_sync/immich_client/api/notifications/send_test_email.py new file mode 100644 index 0000000..9ae5c7a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/notifications/send_test_email.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.system_config_smtp_dto import SystemConfigSmtpDto +from ...models.test_email_response_dto import TestEmailResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: SystemConfigSmtpDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/notifications/test-email", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TestEmailResponseDto]: + if response.status_code == 200: + response_200 = TestEmailResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TestEmailResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: SystemConfigSmtpDto, +) -> Response[TestEmailResponseDto]: + """ + Args: + body (SystemConfigSmtpDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestEmailResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SystemConfigSmtpDto, +) -> Optional[TestEmailResponseDto]: + """ + Args: + body (SystemConfigSmtpDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestEmailResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SystemConfigSmtpDto, +) -> Response[TestEmailResponseDto]: + """ + Args: + body (SystemConfigSmtpDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestEmailResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: SystemConfigSmtpDto, +) -> Optional[TestEmailResponseDto]: + """ + Args: + body (SystemConfigSmtpDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestEmailResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/partners/__init__.py b/immich_carddav_sync/immich_client/api/partners/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/partners/create_partner.py b/immich_carddav_sync/immich_client/api/partners/create_partner.py new file mode 100644 index 0000000..6f97c01 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/partners/create_partner.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.partner_response_dto import PartnerResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/partners/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PartnerResponseDto]: + if response.status_code == 201: + response_201 = PartnerResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PartnerResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PartnerResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PartnerResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PartnerResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PartnerResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PartnerResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PartnerResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PartnerResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PartnerResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/partners/get_partners.py b/immich_carddav_sync/immich_client/api/partners/get_partners.py new file mode 100644 index 0000000..0bc4e25 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/partners/get_partners.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.partner_direction import PartnerDirection +from ...models.partner_response_dto import PartnerResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + direction: PartnerDirection, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_direction = direction.value + params["direction"] = json_direction + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/partners", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["PartnerResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = PartnerResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["PartnerResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + direction: PartnerDirection, +) -> Response[List["PartnerResponseDto"]]: + """ + Args: + direction (PartnerDirection): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PartnerResponseDto']] + """ + + kwargs = _get_kwargs( + direction=direction, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + direction: PartnerDirection, +) -> Optional[List["PartnerResponseDto"]]: + """ + Args: + direction (PartnerDirection): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PartnerResponseDto'] + """ + + return sync_detailed( + client=client, + direction=direction, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + direction: PartnerDirection, +) -> Response[List["PartnerResponseDto"]]: + """ + Args: + direction (PartnerDirection): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PartnerResponseDto']] + """ + + kwargs = _get_kwargs( + direction=direction, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + direction: PartnerDirection, +) -> Optional[List["PartnerResponseDto"]]: + """ + Args: + direction (PartnerDirection): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PartnerResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + direction=direction, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/partners/remove_partner.py b/immich_carddav_sync/immich_client/api/partners/remove_partner.py new file mode 100644 index 0000000..d8531eb --- /dev/null +++ b/immich_carddav_sync/immich_client/api/partners/remove_partner.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/partners/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/partners/update_partner.py b/immich_carddav_sync/immich_client/api/partners/update_partner.py new file mode 100644 index 0000000..48178a0 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/partners/update_partner.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.partner_response_dto import PartnerResponseDto +from ...models.update_partner_dto import UpdatePartnerDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UpdatePartnerDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/partners/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PartnerResponseDto]: + if response.status_code == 200: + response_200 = PartnerResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PartnerResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdatePartnerDto, +) -> Response[PartnerResponseDto]: + """ + Args: + id (UUID): + body (UpdatePartnerDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PartnerResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdatePartnerDto, +) -> Optional[PartnerResponseDto]: + """ + Args: + id (UUID): + body (UpdatePartnerDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PartnerResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdatePartnerDto, +) -> Response[PartnerResponseDto]: + """ + Args: + id (UUID): + body (UpdatePartnerDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PartnerResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UpdatePartnerDto, +) -> Optional[PartnerResponseDto]: + """ + Args: + id (UUID): + body (UpdatePartnerDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PartnerResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/__init__.py b/immich_carddav_sync/immich_client/api/people/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/people/create_person.py b/immich_carddav_sync/immich_client/api/people/create_person.py new file mode 100644 index 0000000..412929f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/create_person.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.person_create_dto import PersonCreateDto +from ...models.person_response_dto import PersonResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: PersonCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/people", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PersonResponseDto]: + if response.status_code == 201: + response_201 = PersonResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PersonResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PersonCreateDto, +) -> Response[PersonResponseDto]: + """ + Args: + body (PersonCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: PersonCreateDto, +) -> Optional[PersonResponseDto]: + """ + Args: + body (PersonCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PersonCreateDto, +) -> Response[PersonResponseDto]: + """ + Args: + body (PersonCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: PersonCreateDto, +) -> Optional[PersonResponseDto]: + """ + Args: + body (PersonCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/get_all_people.py b/immich_carddav_sync/immich_client/api/people/get_all_people.py new file mode 100644 index 0000000..99ab746 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/get_all_people.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.people_response_dto import PeopleResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: Union[Unset, float] = 1.0, + size: Union[Unset, float] = 500.0, + with_hidden: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["page"] = page + + params["size"] = size + + params["withHidden"] = with_hidden + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/people", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PeopleResponseDto]: + if response.status_code == 200: + response_200 = PeopleResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PeopleResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: Union[Unset, float] = 1.0, + size: Union[Unset, float] = 500.0, + with_hidden: Union[Unset, bool] = UNSET, +) -> Response[PeopleResponseDto]: + """ + Args: + page (Union[Unset, float]): Default: 1.0. + size (Union[Unset, float]): Default: 500.0. + with_hidden (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PeopleResponseDto] + """ + + kwargs = _get_kwargs( + page=page, + size=size, + with_hidden=with_hidden, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: Union[Unset, float] = 1.0, + size: Union[Unset, float] = 500.0, + with_hidden: Union[Unset, bool] = UNSET, +) -> Optional[PeopleResponseDto]: + """ + Args: + page (Union[Unset, float]): Default: 1.0. + size (Union[Unset, float]): Default: 500.0. + with_hidden (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PeopleResponseDto + """ + + return sync_detailed( + client=client, + page=page, + size=size, + with_hidden=with_hidden, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: Union[Unset, float] = 1.0, + size: Union[Unset, float] = 500.0, + with_hidden: Union[Unset, bool] = UNSET, +) -> Response[PeopleResponseDto]: + """ + Args: + page (Union[Unset, float]): Default: 1.0. + size (Union[Unset, float]): Default: 500.0. + with_hidden (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PeopleResponseDto] + """ + + kwargs = _get_kwargs( + page=page, + size=size, + with_hidden=with_hidden, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: Union[Unset, float] = 1.0, + size: Union[Unset, float] = 500.0, + with_hidden: Union[Unset, bool] = UNSET, +) -> Optional[PeopleResponseDto]: + """ + Args: + page (Union[Unset, float]): Default: 1.0. + size (Union[Unset, float]): Default: 500.0. + with_hidden (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PeopleResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + size=size, + with_hidden=with_hidden, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/get_person.py b/immich_carddav_sync/immich_client/api/people/get_person.py new file mode 100644 index 0000000..e95bdc2 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/get_person.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.person_response_dto import PersonResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/people/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PersonResponseDto]: + if response.status_code == 200: + response_200 = PersonResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PersonResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/get_person_statistics.py b/immich_carddav_sync/immich_client/api/people/get_person_statistics.py new file mode 100644 index 0000000..449079e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/get_person_statistics.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.person_statistics_response_dto import PersonStatisticsResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/people/{id}/statistics", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PersonStatisticsResponseDto]: + if response.status_code == 200: + response_200 = PersonStatisticsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PersonStatisticsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PersonStatisticsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonStatisticsResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PersonStatisticsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonStatisticsResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[PersonStatisticsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonStatisticsResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[PersonStatisticsResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonStatisticsResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/get_person_thumbnail.py b/immich_carddav_sync/immich_client/api/people/get_person_thumbnail.py new file mode 100644 index 0000000..2afb26a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/get_person_thumbnail.py @@ -0,0 +1,143 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import File, Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/people/{id}/thumbnail", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/merge_person.py b/immich_carddav_sync/immich_client/api/people/merge_person.py new file mode 100644 index 0000000..4a66835 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/merge_person.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.merge_person_dto import MergePersonDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: MergePersonDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/people/{id}/merge", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 201: + response_201 = [] + _response_201 = response.json() + for response_201_item_data in _response_201: + response_201_item = BulkIdResponseDto.from_dict(response_201_item_data) + + response_201.append(response_201_item) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: MergePersonDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (MergePersonDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: MergePersonDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (MergePersonDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: MergePersonDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (MergePersonDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: MergePersonDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (MergePersonDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/reassign_faces.py b/immich_carddav_sync/immich_client/api/people/reassign_faces.py new file mode 100644 index 0000000..81071e1 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/reassign_faces.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_face_update_dto import AssetFaceUpdateDto +from ...models.person_response_dto import PersonResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: AssetFaceUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/people/{id}/reassign", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["PersonResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = PersonResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["PersonResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetFaceUpdateDto, +) -> Response[List["PersonResponseDto"]]: + """ + Args: + id (UUID): + body (AssetFaceUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PersonResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetFaceUpdateDto, +) -> Optional[List["PersonResponseDto"]]: + """ + Args: + id (UUID): + body (AssetFaceUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PersonResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetFaceUpdateDto, +) -> Response[List["PersonResponseDto"]]: + """ + Args: + id (UUID): + body (AssetFaceUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PersonResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetFaceUpdateDto, +) -> Optional[List["PersonResponseDto"]]: + """ + Args: + id (UUID): + body (AssetFaceUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PersonResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/update_people.py b/immich_carddav_sync/immich_client/api/people/update_people.py new file mode 100644 index 0000000..75867a3 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/update_people.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.people_update_dto import PeopleUpdateDto +from ...types import Response + + +def _get_kwargs( + *, + body: PeopleUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/people", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: PeopleUpdateDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + body (PeopleUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: PeopleUpdateDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + body (PeopleUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: PeopleUpdateDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + body (PeopleUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: PeopleUpdateDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + body (PeopleUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/people/update_person.py b/immich_carddav_sync/immich_client/api/people/update_person.py new file mode 100644 index 0000000..d56e488 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/people/update_person.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.person_response_dto import PersonResponseDto +from ...models.person_update_dto import PersonUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: PersonUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/people/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PersonResponseDto]: + if response.status_code == 200: + response_200 = PersonResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PersonResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: PersonUpdateDto, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + body (PersonUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: PersonUpdateDto, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + body (PersonUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: PersonUpdateDto, +) -> Response[PersonResponseDto]: + """ + Args: + id (UUID): + body (PersonUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PersonResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: PersonUpdateDto, +) -> Optional[PersonResponseDto]: + """ + Args: + id (UUID): + body (PersonUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PersonResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/get_assets_by_city.py b/immich_carddav_sync/immich_client/api/search/get_assets_by_city.py new file mode 100644 index 0000000..546b0ab --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/get_assets_by_city.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/search/cities", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["AssetResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["AssetResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["AssetResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["AssetResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/get_search_suggestions.py b/immich_carddav_sync/immich_client/api/search/get_search_suggestions.py new file mode 100644 index 0000000..09d4f7e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/get_search_suggestions.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.search_suggestion_type import SearchSuggestionType +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + country: Union[Unset, str] = UNSET, + include_null: Union[Unset, bool] = UNSET, + make: Union[Unset, str] = UNSET, + model: Union[Unset, str] = UNSET, + state: Union[Unset, str] = UNSET, + type: SearchSuggestionType, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["country"] = country + + params["includeNull"] = include_null + + params["make"] = make + + params["model"] = model + + params["state"] = state + + json_type = type.value + params["type"] = json_type + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/search/suggestions", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]: + if response.status_code == 200: + response_200 = cast(List[str], response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + country: Union[Unset, str] = UNSET, + include_null: Union[Unset, bool] = UNSET, + make: Union[Unset, str] = UNSET, + model: Union[Unset, str] = UNSET, + state: Union[Unset, str] = UNSET, + type: SearchSuggestionType, +) -> Response[List[str]]: + """ + Args: + country (Union[Unset, str]): + include_null (Union[Unset, bool]): + make (Union[Unset, str]): + model (Union[Unset, str]): + state (Union[Unset, str]): + type (SearchSuggestionType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs( + country=country, + include_null=include_null, + make=make, + model=model, + state=state, + type=type, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + country: Union[Unset, str] = UNSET, + include_null: Union[Unset, bool] = UNSET, + make: Union[Unset, str] = UNSET, + model: Union[Unset, str] = UNSET, + state: Union[Unset, str] = UNSET, + type: SearchSuggestionType, +) -> Optional[List[str]]: + """ + Args: + country (Union[Unset, str]): + include_null (Union[Unset, bool]): + make (Union[Unset, str]): + model (Union[Unset, str]): + state (Union[Unset, str]): + type (SearchSuggestionType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return sync_detailed( + client=client, + country=country, + include_null=include_null, + make=make, + model=model, + state=state, + type=type, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + country: Union[Unset, str] = UNSET, + include_null: Union[Unset, bool] = UNSET, + make: Union[Unset, str] = UNSET, + model: Union[Unset, str] = UNSET, + state: Union[Unset, str] = UNSET, + type: SearchSuggestionType, +) -> Response[List[str]]: + """ + Args: + country (Union[Unset, str]): + include_null (Union[Unset, bool]): + make (Union[Unset, str]): + model (Union[Unset, str]): + state (Union[Unset, str]): + type (SearchSuggestionType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs( + country=country, + include_null=include_null, + make=make, + model=model, + state=state, + type=type, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + country: Union[Unset, str] = UNSET, + include_null: Union[Unset, bool] = UNSET, + make: Union[Unset, str] = UNSET, + model: Union[Unset, str] = UNSET, + state: Union[Unset, str] = UNSET, + type: SearchSuggestionType, +) -> Optional[List[str]]: + """ + Args: + country (Union[Unset, str]): + include_null (Union[Unset, bool]): + make (Union[Unset, str]): + model (Union[Unset, str]): + state (Union[Unset, str]): + type (SearchSuggestionType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return ( + await asyncio_detailed( + client=client, + country=country, + include_null=include_null, + make=make, + model=model, + state=state, + type=type, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/search_metadata.py b/immich_carddav_sync/immich_client/api/search/search_metadata.py new file mode 100644 index 0000000..932b6ec --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/search_metadata.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.metadata_search_dto import MetadataSearchDto +from ...models.search_response_dto import SearchResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: MetadataSearchDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/search/metadata", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SearchResponseDto]: + if response.status_code == 200: + response_200 = SearchResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SearchResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: MetadataSearchDto, +) -> Response[SearchResponseDto]: + """ + Args: + body (MetadataSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: MetadataSearchDto, +) -> Optional[SearchResponseDto]: + """ + Args: + body (MetadataSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: MetadataSearchDto, +) -> Response[SearchResponseDto]: + """ + Args: + body (MetadataSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: MetadataSearchDto, +) -> Optional[SearchResponseDto]: + """ + Args: + body (MetadataSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/search_places.py b/immich_carddav_sync/immich_client/api/search/search_places.py new file mode 100644 index 0000000..5062084 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/search_places.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.places_response_dto import PlacesResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + name: str, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["name"] = name + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/search/places", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["PlacesResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = PlacesResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["PlacesResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + name: str, +) -> Response[List["PlacesResponseDto"]]: + """ + Args: + name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PlacesResponseDto']] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + name: str, +) -> Optional[List["PlacesResponseDto"]]: + """ + Args: + name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PlacesResponseDto'] + """ + + return sync_detailed( + client=client, + name=name, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + name: str, +) -> Response[List["PlacesResponseDto"]]: + """ + Args: + name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['PlacesResponseDto']] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + name: str, +) -> Optional[List["PlacesResponseDto"]]: + """ + Args: + name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['PlacesResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + name=name, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/search_random.py b/immich_carddav_sync/immich_client/api/search/search_random.py new file mode 100644 index 0000000..5e663c3 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/search_random.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...models.random_search_dto import RandomSearchDto +from ...types import Response + + +def _get_kwargs( + *, + body: RandomSearchDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/search/random", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: RandomSearchDto, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + body (RandomSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: RandomSearchDto, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + body (RandomSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: RandomSearchDto, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + body (RandomSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: RandomSearchDto, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + body (RandomSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/search_smart.py b/immich_carddav_sync/immich_client/api/search/search_smart.py new file mode 100644 index 0000000..f39e2cd --- /dev/null +++ b/immich_carddav_sync/immich_client/api/search/search_smart.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.search_response_dto import SearchResponseDto +from ...models.smart_search_dto import SmartSearchDto +from ...types import Response + + +def _get_kwargs( + *, + body: SmartSearchDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/search/smart", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SearchResponseDto]: + if response.status_code == 200: + response_200 = SearchResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SearchResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: SmartSearchDto, +) -> Response[SearchResponseDto]: + """ + Args: + body (SmartSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SmartSearchDto, +) -> Optional[SearchResponseDto]: + """ + Args: + body (SmartSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SmartSearchDto, +) -> Response[SearchResponseDto]: + """ + Args: + body (SmartSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SearchResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: SmartSearchDto, +) -> Optional[SearchResponseDto]: + """ + Args: + body (SmartSearchDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SearchResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/__init__.py b/immich_carddav_sync/immich_client/api/server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/server/delete_server_license.py b/immich_carddav_sync/immich_client/api/server/delete_server_license.py new file mode 100644 index 0000000..752f2fc --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/delete_server_license.py @@ -0,0 +1,77 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/server/license", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/server/get_about_info.py b/immich_carddav_sync/immich_client/api/server/get_about_info.py new file mode 100644 index 0000000..922f2e4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_about_info.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_about_response_dto import ServerAboutResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/about", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerAboutResponseDto]: + if response.status_code == 200: + response_200 = ServerAboutResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerAboutResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerAboutResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerAboutResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ServerAboutResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerAboutResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerAboutResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerAboutResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ServerAboutResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerAboutResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_server_config.py b/immich_carddav_sync/immich_client/api/server/get_server_config.py new file mode 100644 index 0000000..a919f73 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_server_config.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_config_dto import ServerConfigDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/config", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerConfigDto]: + if response.status_code == 200: + response_200 = ServerConfigDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerConfigDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerConfigDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerConfigDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerConfigDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerConfigDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerConfigDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerConfigDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerConfigDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerConfigDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_server_features.py b/immich_carddav_sync/immich_client/api/server/get_server_features.py new file mode 100644 index 0000000..5bbc77f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_server_features.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_features_dto import ServerFeaturesDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/features", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerFeaturesDto]: + if response.status_code == 200: + response_200 = ServerFeaturesDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerFeaturesDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerFeaturesDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerFeaturesDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerFeaturesDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerFeaturesDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerFeaturesDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerFeaturesDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerFeaturesDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerFeaturesDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_server_license.py b/immich_carddav_sync/immich_client/api/server/get_server_license.py new file mode 100644 index 0000000..d70048f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_server_license.py @@ -0,0 +1,125 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.license_response_dto import LicenseResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/license", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, LicenseResponseDto]]: + if response.status_code == 200: + response_200 = LicenseResponseDto.from_dict(response.json()) + + return response_200 + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, LicenseResponseDto]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Union[Any, LicenseResponseDto]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, LicenseResponseDto]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[Union[Any, LicenseResponseDto]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, LicenseResponseDto] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Union[Any, LicenseResponseDto]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, LicenseResponseDto]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[Union[Any, LicenseResponseDto]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, LicenseResponseDto] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_server_statistics.py b/immich_carddav_sync/immich_client/api/server/get_server_statistics.py new file mode 100644 index 0000000..2edec6b --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_server_statistics.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_stats_response_dto import ServerStatsResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/statistics", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerStatsResponseDto]: + if response.status_code == 200: + response_200 = ServerStatsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerStatsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerStatsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerStatsResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ServerStatsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerStatsResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerStatsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerStatsResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ServerStatsResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerStatsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_server_version.py b/immich_carddav_sync/immich_client/api/server/get_server_version.py new file mode 100644 index 0000000..627c50d --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_server_version.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_version_response_dto import ServerVersionResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/version", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerVersionResponseDto]: + if response.status_code == 200: + response_200 = ServerVersionResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerVersionResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerVersionResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerVersionResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerVersionResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerVersionResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerVersionResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerVersionResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerVersionResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerVersionResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_storage.py b/immich_carddav_sync/immich_client/api/server/get_storage.py new file mode 100644 index 0000000..d863bfd --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_storage.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_storage_response_dto import ServerStorageResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/storage", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerStorageResponseDto]: + if response.status_code == 200: + response_200 = ServerStorageResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerStorageResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerStorageResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerStorageResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ServerStorageResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerStorageResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ServerStorageResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerStorageResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ServerStorageResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerStorageResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_supported_media_types.py b/immich_carddav_sync/immich_client/api/server/get_supported_media_types.py new file mode 100644 index 0000000..18a10f8 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_supported_media_types.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_media_types_response_dto import ServerMediaTypesResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/media-types", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerMediaTypesResponseDto]: + if response.status_code == 200: + response_200 = ServerMediaTypesResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerMediaTypesResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerMediaTypesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerMediaTypesResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerMediaTypesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerMediaTypesResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerMediaTypesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerMediaTypesResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerMediaTypesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerMediaTypesResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_theme.py b/immich_carddav_sync/immich_client/api/server/get_theme.py new file mode 100644 index 0000000..4144e15 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_theme.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_theme_dto import ServerThemeDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/theme", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerThemeDto]: + if response.status_code == 200: + response_200 = ServerThemeDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerThemeDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerThemeDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerThemeDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerThemeDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerThemeDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerThemeDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerThemeDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerThemeDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerThemeDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/get_version_history.py b/immich_carddav_sync/immich_client/api/server/get_version_history.py new file mode 100644 index 0000000..34867dd --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/get_version_history.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_version_history_response_dto import ServerVersionHistoryResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/version-history", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["ServerVersionHistoryResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ServerVersionHistoryResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["ServerVersionHistoryResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[List["ServerVersionHistoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['ServerVersionHistoryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[List["ServerVersionHistoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['ServerVersionHistoryResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[List["ServerVersionHistoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['ServerVersionHistoryResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[List["ServerVersionHistoryResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['ServerVersionHistoryResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/ping_server.py b/immich_carddav_sync/immich_client/api/server/ping_server.py new file mode 100644 index 0000000..c08c012 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/ping_server.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.server_ping_response import ServerPingResponse +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/server/ping", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ServerPingResponse]: + if response.status_code == 200: + response_200 = ServerPingResponse.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ServerPingResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerPingResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerPingResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerPingResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerPingResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[ServerPingResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServerPingResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[ServerPingResponse]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServerPingResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/server/set_server_license.py b/immich_carddav_sync/immich_client/api/server/set_server_license.py new file mode 100644 index 0000000..6637daf --- /dev/null +++ b/immich_carddav_sync/immich_client/api/server/set_server_license.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.license_key_dto import LicenseKeyDto +from ...models.license_response_dto import LicenseResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: LicenseKeyDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/server/license", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LicenseResponseDto]: + if response.status_code == 200: + response_200 = LicenseResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LicenseResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Response[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Optional[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Response[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Optional[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/sessions/__init__.py b/immich_carddav_sync/immich_client/api/sessions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/sessions/delete_all_sessions.py b/immich_carddav_sync/immich_client/api/sessions/delete_all_sessions.py new file mode 100644 index 0000000..525a099 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/sessions/delete_all_sessions.py @@ -0,0 +1,77 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/sessions", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/sessions/delete_session.py b/immich_carddav_sync/immich_client/api/sessions/delete_session.py new file mode 100644 index 0000000..d8c5a77 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/sessions/delete_session.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/sessions/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/sessions/get_sessions.py b/immich_carddav_sync/immich_client/api/sessions/get_sessions.py new file mode 100644 index 0000000..7f107c1 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/sessions/get_sessions.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.session_response_dto import SessionResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/sessions", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["SessionResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = SessionResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["SessionResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["SessionResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['SessionResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["SessionResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['SessionResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["SessionResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['SessionResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["SessionResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['SessionResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/__init__.py b/immich_carddav_sync/immich_client/api/shared_links/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/shared_links/add_shared_link_assets.py b/immich_carddav_sync/immich_client/api/shared_links/add_shared_link_assets.py new file mode 100644 index 0000000..b43ceba --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/add_shared_link_assets.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_ids_dto import AssetIdsDto +from ...models.asset_ids_response_dto import AssetIdsResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/shared-links/{id}/assets", + "params": params, + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetIdsResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetIdsResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetIdsResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetIdsResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetIdsResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetIdsResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetIdsResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/create_shared_link.py b/immich_carddav_sync/immich_client/api/shared_links/create_shared_link.py new file mode 100644 index 0000000..98da41a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/create_shared_link.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.shared_link_create_dto import SharedLinkCreateDto +from ...models.shared_link_response_dto import SharedLinkResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: SharedLinkCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/shared-links", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SharedLinkResponseDto]: + if response.status_code == 201: + response_201 = SharedLinkResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SharedLinkResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: SharedLinkCreateDto, +) -> Response[SharedLinkResponseDto]: + """ + Args: + body (SharedLinkCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: SharedLinkCreateDto, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + body (SharedLinkCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SharedLinkCreateDto, +) -> Response[SharedLinkResponseDto]: + """ + Args: + body (SharedLinkCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: SharedLinkCreateDto, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + body (SharedLinkCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/get_all_shared_links.py b/immich_carddav_sync/immich_client/api/shared_links/get_all_shared_links.py new file mode 100644 index 0000000..0d8c742 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/get_all_shared_links.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.shared_link_response_dto import SharedLinkResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/shared-links", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["SharedLinkResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = SharedLinkResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["SharedLinkResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["SharedLinkResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['SharedLinkResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["SharedLinkResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['SharedLinkResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["SharedLinkResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['SharedLinkResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["SharedLinkResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['SharedLinkResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/get_my_shared_link.py b/immich_carddav_sync/immich_client/api/shared_links/get_my_shared_link.py new file mode 100644 index 0000000..4f412ff --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/get_my_shared_link.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.shared_link_response_dto import SharedLinkResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + key: Union[Unset, str] = UNSET, + password: Union[Unset, str] = UNSET, + token: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["key"] = key + + params["password"] = password + + params["token"] = token + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/shared-links/me", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SharedLinkResponseDto]: + if response.status_code == 200: + response_200 = SharedLinkResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SharedLinkResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + password: Union[Unset, str] = UNSET, + token: Union[Unset, str] = UNSET, +) -> Response[SharedLinkResponseDto]: + """ + Args: + key (Union[Unset, str]): + password (Union[Unset, str]): Example: password. + token (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + key=key, + password=password, + token=token, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + password: Union[Unset, str] = UNSET, + token: Union[Unset, str] = UNSET, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + key (Union[Unset, str]): + password (Union[Unset, str]): Example: password. + token (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return sync_detailed( + client=client, + key=key, + password=password, + token=token, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + password: Union[Unset, str] = UNSET, + token: Union[Unset, str] = UNSET, +) -> Response[SharedLinkResponseDto]: + """ + Args: + key (Union[Unset, str]): + password (Union[Unset, str]): Example: password. + token (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + key=key, + password=password, + token=token, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + key: Union[Unset, str] = UNSET, + password: Union[Unset, str] = UNSET, + token: Union[Unset, str] = UNSET, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + key (Union[Unset, str]): + password (Union[Unset, str]): Example: password. + token (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + key=key, + password=password, + token=token, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/get_shared_link_by_id.py b/immich_carddav_sync/immich_client/api/shared_links/get_shared_link_by_id.py new file mode 100644 index 0000000..f5ffa41 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/get_shared_link_by_id.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.shared_link_response_dto import SharedLinkResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/shared-links/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SharedLinkResponseDto]: + if response.status_code == 200: + response_200 = SharedLinkResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SharedLinkResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[SharedLinkResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[SharedLinkResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link.py b/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link.py new file mode 100644 index 0000000..98db831 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/shared-links/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link_assets.py b/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link_assets.py new file mode 100644 index 0000000..3eee9b6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/remove_shared_link_assets.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_ids_dto import AssetIdsDto +from ...models.asset_ids_response_dto import AssetIdsResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: UUID, + *, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + params: Dict[str, Any] = {} + + params["key"] = key + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/shared-links/{id}/assets", + "params": params, + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetIdsResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetIdsResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetIdsResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetIdsResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetIdsResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + key=key, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Response[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetIdsResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: AssetIdsDto, + key: Union[Unset, str] = UNSET, +) -> Optional[List["AssetIdsResponseDto"]]: + """ + Args: + id (UUID): + key (Union[Unset, str]): + body (AssetIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetIdsResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + key=key, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_links/update_shared_link.py b/immich_carddav_sync/immich_client/api/shared_links/update_shared_link.py new file mode 100644 index 0000000..235f225 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/shared_links/update_shared_link.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.shared_link_edit_dto import SharedLinkEditDto +from ...models.shared_link_response_dto import SharedLinkResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: SharedLinkEditDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "patch", + "url": f"/shared-links/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[SharedLinkResponseDto]: + if response.status_code == 200: + response_200 = SharedLinkResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[SharedLinkResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: SharedLinkEditDto, +) -> Response[SharedLinkResponseDto]: + """ + Args: + id (UUID): + body (SharedLinkEditDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: SharedLinkEditDto, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + id (UUID): + body (SharedLinkEditDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: SharedLinkEditDto, +) -> Response[SharedLinkResponseDto]: + """ + Args: + id (UUID): + body (SharedLinkEditDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SharedLinkResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: SharedLinkEditDto, +) -> Optional[SharedLinkResponseDto]: + """ + Args: + id (UUID): + body (SharedLinkEditDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SharedLinkResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/stacks/__init__.py b/immich_carddav_sync/immich_client/api/stacks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/stacks/create_stack.py b/immich_carddav_sync/immich_client/api/stacks/create_stack.py new file mode 100644 index 0000000..cc17b4f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/create_stack.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.stack_create_dto import StackCreateDto +from ...models.stack_response_dto import StackResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: StackCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/stacks", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StackResponseDto]: + if response.status_code == 201: + response_201 = StackResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StackResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: StackCreateDto, +) -> Response[StackResponseDto]: + """ + Args: + body (StackCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: StackCreateDto, +) -> Optional[StackResponseDto]: + """ + Args: + body (StackCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: StackCreateDto, +) -> Response[StackResponseDto]: + """ + Args: + body (StackCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: StackCreateDto, +) -> Optional[StackResponseDto]: + """ + Args: + body (StackCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/stacks/delete_stack.py b/immich_carddav_sync/immich_client/api/stacks/delete_stack.py new file mode 100644 index 0000000..d94b516 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/delete_stack.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/stacks/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/stacks/delete_stacks.py b/immich_carddav_sync/immich_client/api/stacks/delete_stacks.py new file mode 100644 index 0000000..67bb781 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/delete_stacks.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/stacks", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[Any]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[Any]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/stacks/get_stack.py b/immich_carddav_sync/immich_client/api/stacks/get_stack.py new file mode 100644 index 0000000..1274b2c --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/get_stack.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.stack_response_dto import StackResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/stacks/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StackResponseDto]: + if response.status_code == 200: + response_200 = StackResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StackResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[StackResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[StackResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[StackResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[StackResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/stacks/search_stacks.py b/immich_carddav_sync/immich_client/api/stacks/search_stacks.py new file mode 100644 index 0000000..50b671f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/search_stacks.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.stack_response_dto import StackResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + primary_asset_id: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["primaryAssetId"] = primary_asset_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/stacks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["StackResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = StackResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["StackResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + primary_asset_id: Union[Unset, str] = UNSET, +) -> Response[List["StackResponseDto"]]: + """ + Args: + primary_asset_id (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['StackResponseDto']] + """ + + kwargs = _get_kwargs( + primary_asset_id=primary_asset_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + primary_asset_id: Union[Unset, str] = UNSET, +) -> Optional[List["StackResponseDto"]]: + """ + Args: + primary_asset_id (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['StackResponseDto'] + """ + + return sync_detailed( + client=client, + primary_asset_id=primary_asset_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + primary_asset_id: Union[Unset, str] = UNSET, +) -> Response[List["StackResponseDto"]]: + """ + Args: + primary_asset_id (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['StackResponseDto']] + """ + + kwargs = _get_kwargs( + primary_asset_id=primary_asset_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + primary_asset_id: Union[Unset, str] = UNSET, +) -> Optional[List["StackResponseDto"]]: + """ + Args: + primary_asset_id (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['StackResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + primary_asset_id=primary_asset_id, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/stacks/update_stack.py b/immich_carddav_sync/immich_client/api/stacks/update_stack.py new file mode 100644 index 0000000..e80e618 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/stacks/update_stack.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.stack_response_dto import StackResponseDto +from ...models.stack_update_dto import StackUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: StackUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/stacks/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[StackResponseDto]: + if response.status_code == 200: + response_200 = StackResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[StackResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: StackUpdateDto, +) -> Response[StackResponseDto]: + """ + Args: + id (UUID): + body (StackUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: StackUpdateDto, +) -> Optional[StackResponseDto]: + """ + Args: + id (UUID): + body (StackUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: StackUpdateDto, +) -> Response[StackResponseDto]: + """ + Args: + id (UUID): + body (StackUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StackResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: StackUpdateDto, +) -> Optional[StackResponseDto]: + """ + Args: + id (UUID): + body (StackUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StackResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/sync/__init__.py b/immich_carddav_sync/immich_client/api/sync/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/sync/get_delta_sync.py b/immich_carddav_sync/immich_client/api/sync/get_delta_sync.py new file mode 100644 index 0000000..0bec723 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/sync/get_delta_sync.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_delta_sync_dto import AssetDeltaSyncDto +from ...models.asset_delta_sync_response_dto import AssetDeltaSyncResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetDeltaSyncDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/sync/delta-sync", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AssetDeltaSyncResponseDto]: + if response.status_code == 200: + response_200 = AssetDeltaSyncResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AssetDeltaSyncResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetDeltaSyncDto, +) -> Response[AssetDeltaSyncResponseDto]: + """ + Args: + body (AssetDeltaSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetDeltaSyncResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: AssetDeltaSyncDto, +) -> Optional[AssetDeltaSyncResponseDto]: + """ + Args: + body (AssetDeltaSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetDeltaSyncResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetDeltaSyncDto, +) -> Response[AssetDeltaSyncResponseDto]: + """ + Args: + body (AssetDeltaSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AssetDeltaSyncResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: AssetDeltaSyncDto, +) -> Optional[AssetDeltaSyncResponseDto]: + """ + Args: + body (AssetDeltaSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AssetDeltaSyncResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/sync/get_full_sync_for_user.py b/immich_carddav_sync/immich_client/api/sync/get_full_sync_for_user.py new file mode 100644 index 0000000..7c46dbb --- /dev/null +++ b/immich_carddav_sync/immich_client/api/sync/get_full_sync_for_user.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_full_sync_dto import AssetFullSyncDto +from ...models.asset_response_dto import AssetResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: AssetFullSyncDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/sync/full-sync", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AssetFullSyncDto, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + body (AssetFullSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: AssetFullSyncDto, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + body (AssetFullSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AssetFullSyncDto, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + body (AssetFullSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: AssetFullSyncDto, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + body (AssetFullSyncDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/system_metadata/__init__.py b/immich_carddav_sync/immich_client/api/system_metadata/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/system_metadata/get_admin_onboarding.py b/immich_carddav_sync/immich_client/api/system_metadata/get_admin_onboarding.py new file mode 100644 index 0000000..e3b88e4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/system_metadata/get_admin_onboarding.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.admin_onboarding_update_dto import AdminOnboardingUpdateDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/system-metadata/admin-onboarding", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AdminOnboardingUpdateDto]: + if response.status_code == 200: + response_200 = AdminOnboardingUpdateDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AdminOnboardingUpdateDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[AdminOnboardingUpdateDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AdminOnboardingUpdateDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[AdminOnboardingUpdateDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AdminOnboardingUpdateDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[AdminOnboardingUpdateDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AdminOnboardingUpdateDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[AdminOnboardingUpdateDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AdminOnboardingUpdateDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/system_metadata/get_reverse_geocoding_state.py b/immich_carddav_sync/immich_client/api/system_metadata/get_reverse_geocoding_state.py new file mode 100644 index 0000000..9ed3a08 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/system_metadata/get_reverse_geocoding_state.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.reverse_geocoding_state_response_dto import ReverseGeocodingStateResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/system-metadata/reverse-geocoding-state", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ReverseGeocodingStateResponseDto]: + if response.status_code == 200: + response_200 = ReverseGeocodingStateResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ReverseGeocodingStateResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[ReverseGeocodingStateResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ReverseGeocodingStateResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[ReverseGeocodingStateResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ReverseGeocodingStateResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ReverseGeocodingStateResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ReverseGeocodingStateResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[ReverseGeocodingStateResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ReverseGeocodingStateResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/system_metadata/update_admin_onboarding.py b/immich_carddav_sync/immich_client/api/system_metadata/update_admin_onboarding.py new file mode 100644 index 0000000..1fe60c4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/system_metadata/update_admin_onboarding.py @@ -0,0 +1,101 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.admin_onboarding_update_dto import AdminOnboardingUpdateDto +from ...types import Response + + +def _get_kwargs( + *, + body: AdminOnboardingUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/system-metadata/admin-onboarding", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: AdminOnboardingUpdateDto, +) -> Response[Any]: + """ + Args: + body (AdminOnboardingUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: AdminOnboardingUpdateDto, +) -> Response[Any]: + """ + Args: + body (AdminOnboardingUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/tags/__init__.py b/immich_carddav_sync/immich_client/api/tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/tags/bulk_tag_assets.py b/immich_carddav_sync/immich_client/api/tags/bulk_tag_assets.py new file mode 100644 index 0000000..6569f53 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/bulk_tag_assets.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_bulk_assets_dto import TagBulkAssetsDto +from ...models.tag_bulk_assets_response_dto import TagBulkAssetsResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: TagBulkAssetsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/tags/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TagBulkAssetsResponseDto]: + if response.status_code == 200: + response_200 = TagBulkAssetsResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TagBulkAssetsResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: TagBulkAssetsDto, +) -> Response[TagBulkAssetsResponseDto]: + """ + Args: + body (TagBulkAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagBulkAssetsResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: TagBulkAssetsDto, +) -> Optional[TagBulkAssetsResponseDto]: + """ + Args: + body (TagBulkAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagBulkAssetsResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: TagBulkAssetsDto, +) -> Response[TagBulkAssetsResponseDto]: + """ + Args: + body (TagBulkAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagBulkAssetsResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: TagBulkAssetsDto, +) -> Optional[TagBulkAssetsResponseDto]: + """ + Args: + body (TagBulkAssetsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagBulkAssetsResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/create_tag.py b/immich_carddav_sync/immich_client/api/tags/create_tag.py new file mode 100644 index 0000000..1122e65 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/create_tag.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_create_dto import TagCreateDto +from ...models.tag_response_dto import TagResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: TagCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/tags", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TagResponseDto]: + if response.status_code == 201: + response_201 = TagResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TagResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: TagCreateDto, +) -> Response[TagResponseDto]: + """ + Args: + body (TagCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: TagCreateDto, +) -> Optional[TagResponseDto]: + """ + Args: + body (TagCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: TagCreateDto, +) -> Response[TagResponseDto]: + """ + Args: + body (TagCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: TagCreateDto, +) -> Optional[TagResponseDto]: + """ + Args: + body (TagCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/delete_tag.py b/immich_carddav_sync/immich_client/api/tags/delete_tag.py new file mode 100644 index 0000000..6c65430 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/delete_tag.py @@ -0,0 +1,92 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/tags/{id}", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/tags/get_all_tags.py b/immich_carddav_sync/immich_client/api/tags/get_all_tags.py new file mode 100644 index 0000000..6c16626 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/get_all_tags.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_response_dto import TagResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/tags", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["TagResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TagResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["TagResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["TagResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TagResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["TagResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TagResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["TagResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TagResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["TagResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TagResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/get_tag_by_id.py b/immich_carddav_sync/immich_client/api/tags/get_tag_by_id.py new file mode 100644 index 0000000..67e465c --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/get_tag_by_id.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_response_dto import TagResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/tags/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TagResponseDto]: + if response.status_code == 200: + response_200 = TagResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TagResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[TagResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[TagResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[TagResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[TagResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/tag_assets.py b/immich_carddav_sync/immich_client/api/tags/tag_assets.py new file mode 100644 index 0000000..90ef31e --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/tag_assets.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/tags/{id}/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/untag_assets.py b/immich_carddav_sync/immich_client/api/tags/untag_assets.py new file mode 100644 index 0000000..c92ada5 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/untag_assets.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_id_response_dto import BulkIdResponseDto +from ...models.bulk_ids_dto import BulkIdsDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/tags/{id}/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["BulkIdResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = BulkIdResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["BulkIdResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['BulkIdResponseDto']] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[List["BulkIdResponseDto"]]: + """ + Args: + id (UUID): + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['BulkIdResponseDto'] + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/update_tag.py b/immich_carddav_sync/immich_client/api/tags/update_tag.py new file mode 100644 index 0000000..5d1dc08 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/update_tag.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_response_dto import TagResponseDto +from ...models.tag_update_dto import TagUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: TagUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/tags/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TagResponseDto]: + if response.status_code == 200: + response_200 = TagResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TagResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: TagUpdateDto, +) -> Response[TagResponseDto]: + """ + Args: + id (UUID): + body (TagUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: TagUpdateDto, +) -> Optional[TagResponseDto]: + """ + Args: + id (UUID): + body (TagUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: TagUpdateDto, +) -> Response[TagResponseDto]: + """ + Args: + id (UUID): + body (TagUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TagResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: TagUpdateDto, +) -> Optional[TagResponseDto]: + """ + Args: + id (UUID): + body (TagUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TagResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/tags/upsert_tags.py b/immich_carddav_sync/immich_client/api/tags/upsert_tags.py new file mode 100644 index 0000000..f28e39c --- /dev/null +++ b/immich_carddav_sync/immich_client/api/tags/upsert_tags.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.tag_response_dto import TagResponseDto +from ...models.tag_upsert_dto import TagUpsertDto +from ...types import Response + + +def _get_kwargs( + *, + body: TagUpsertDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/tags", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["TagResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TagResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["TagResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: TagUpsertDto, +) -> Response[List["TagResponseDto"]]: + """ + Args: + body (TagUpsertDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TagResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: TagUpsertDto, +) -> Optional[List["TagResponseDto"]]: + """ + Args: + body (TagUpsertDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TagResponseDto'] + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: TagUpsertDto, +) -> Response[List["TagResponseDto"]]: + """ + Args: + body (TagUpsertDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TagResponseDto']] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: TagUpsertDto, +) -> Optional[List["TagResponseDto"]]: + """ + Args: + body (TagUpsertDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TagResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/timeline/__init__.py b/immich_carddav_sync/immich_client/api/timeline/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/timeline/get_time_bucket.py b/immich_carddav_sync/immich_client/api/timeline/get_time_bucket.py new file mode 100644 index 0000000..a2211d8 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/timeline/get_time_bucket.py @@ -0,0 +1,359 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_order import AssetOrder +from ...models.asset_response_dto import AssetResponseDto +from ...models.time_bucket_size import TimeBucketSize +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + time_bucket: str, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_album_id: Union[Unset, str] = UNSET + if not isinstance(album_id, Unset): + json_album_id = str(album_id) + params["albumId"] = json_album_id + + params["isArchived"] = is_archived + + params["isFavorite"] = is_favorite + + params["isTrashed"] = is_trashed + + params["key"] = key + + json_order: Union[Unset, str] = UNSET + if not isinstance(order, Unset): + json_order = order.value + + params["order"] = json_order + + json_person_id: Union[Unset, str] = UNSET + if not isinstance(person_id, Unset): + json_person_id = str(person_id) + params["personId"] = json_person_id + + json_size = size.value + params["size"] = json_size + + json_tag_id: Union[Unset, str] = UNSET + if not isinstance(tag_id, Unset): + json_tag_id = str(tag_id) + params["tagId"] = json_tag_id + + params["timeBucket"] = time_bucket + + json_user_id: Union[Unset, str] = UNSET + if not isinstance(user_id, Unset): + json_user_id = str(user_id) + params["userId"] = json_user_id + + params["withPartners"] = with_partners + + params["withStacked"] = with_stacked + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/timeline/bucket", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + time_bucket: str, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + time_bucket (str): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + time_bucket=time_bucket, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + time_bucket: str, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + time_bucket (str): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + time_bucket=time_bucket, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + time_bucket: str, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + time_bucket (str): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + time_bucket=time_bucket, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + time_bucket: str, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + time_bucket (str): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + time_bucket=time_bucket, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/timeline/get_time_buckets.py b/immich_carddav_sync/immich_client/api/timeline/get_time_buckets.py new file mode 100644 index 0000000..2573893 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/timeline/get_time_buckets.py @@ -0,0 +1,344 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_order import AssetOrder +from ...models.time_bucket_response_dto import TimeBucketResponseDto +from ...models.time_bucket_size import TimeBucketSize +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_album_id: Union[Unset, str] = UNSET + if not isinstance(album_id, Unset): + json_album_id = str(album_id) + params["albumId"] = json_album_id + + params["isArchived"] = is_archived + + params["isFavorite"] = is_favorite + + params["isTrashed"] = is_trashed + + params["key"] = key + + json_order: Union[Unset, str] = UNSET + if not isinstance(order, Unset): + json_order = order.value + + params["order"] = json_order + + json_person_id: Union[Unset, str] = UNSET + if not isinstance(person_id, Unset): + json_person_id = str(person_id) + params["personId"] = json_person_id + + json_size = size.value + params["size"] = json_size + + json_tag_id: Union[Unset, str] = UNSET + if not isinstance(tag_id, Unset): + json_tag_id = str(tag_id) + params["tagId"] = json_tag_id + + json_user_id: Union[Unset, str] = UNSET + if not isinstance(user_id, Unset): + json_user_id = str(user_id) + params["userId"] = json_user_id + + params["withPartners"] = with_partners + + params["withStacked"] = with_stacked + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/timeline/buckets", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["TimeBucketResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TimeBucketResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["TimeBucketResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Response[List["TimeBucketResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TimeBucketResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Optional[List["TimeBucketResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TimeBucketResponseDto'] + """ + + return sync_detailed( + client=client, + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Response[List["TimeBucketResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['TimeBucketResponseDto']] + """ + + kwargs = _get_kwargs( + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + album_id: Union[Unset, UUID] = UNSET, + is_archived: Union[Unset, bool] = UNSET, + is_favorite: Union[Unset, bool] = UNSET, + is_trashed: Union[Unset, bool] = UNSET, + key: Union[Unset, str] = UNSET, + order: Union[Unset, AssetOrder] = UNSET, + person_id: Union[Unset, UUID] = UNSET, + size: TimeBucketSize, + tag_id: Union[Unset, UUID] = UNSET, + user_id: Union[Unset, UUID] = UNSET, + with_partners: Union[Unset, bool] = UNSET, + with_stacked: Union[Unset, bool] = UNSET, +) -> Optional[List["TimeBucketResponseDto"]]: + """ + Args: + album_id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_trashed (Union[Unset, bool]): + key (Union[Unset, str]): + order (Union[Unset, AssetOrder]): + person_id (Union[Unset, UUID]): + size (TimeBucketSize): + tag_id (Union[Unset, UUID]): + user_id (Union[Unset, UUID]): + with_partners (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['TimeBucketResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + album_id=album_id, + is_archived=is_archived, + is_favorite=is_favorite, + is_trashed=is_trashed, + key=key, + order=order, + person_id=person_id, + size=size, + tag_id=tag_id, + user_id=user_id, + with_partners=with_partners, + with_stacked=with_stacked, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/trash/__init__.py b/immich_carddav_sync/immich_client/api/trash/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/trash/empty_trash.py b/immich_carddav_sync/immich_client/api/trash/empty_trash.py new file mode 100644 index 0000000..7ced3f6 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/trash/empty_trash.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.trash_response_dto import TrashResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/trash/empty", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TrashResponseDto]: + if response.status_code == 200: + response_200 = TrashResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TrashResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/trash/restore_assets.py b/immich_carddav_sync/immich_client/api/trash/restore_assets.py new file mode 100644 index 0000000..8314c39 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/trash/restore_assets.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_ids_dto import BulkIdsDto +from ...models.trash_response_dto import TrashResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: BulkIdsDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/trash/restore/assets", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TrashResponseDto]: + if response.status_code == 200: + response_200 = TrashResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TrashResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[TrashResponseDto]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[TrashResponseDto]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Response[TrashResponseDto]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: BulkIdsDto, +) -> Optional[TrashResponseDto]: + """ + Args: + body (BulkIdsDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/trash/restore_trash.py b/immich_carddav_sync/immich_client/api/trash/restore_trash.py new file mode 100644 index 0000000..bd32237 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/trash/restore_trash.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.trash_response_dto import TrashResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/trash/restore", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[TrashResponseDto]: + if response.status_code == 200: + response_200 = TrashResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[TrashResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrashResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[TrashResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrashResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/__init__.py b/immich_carddav_sync/immich_client/api/users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/users/create_profile_image.py b/immich_carddav_sync/immich_client/api/users/create_profile_image.py new file mode 100644 index 0000000..ee390f7 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/create_profile_image.py @@ -0,0 +1,155 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_profile_image_dto import CreateProfileImageDto +from ...models.create_profile_image_response_dto import CreateProfileImageResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: CreateProfileImageDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/users/profile-image", + } + + _body = body.to_multipart() + + _kwargs["files"] = _body + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[CreateProfileImageResponseDto]: + if response.status_code == 201: + response_201 = CreateProfileImageResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[CreateProfileImageResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateProfileImageDto, +) -> Response[CreateProfileImageResponseDto]: + """ + Args: + body (CreateProfileImageDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateProfileImageResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateProfileImageDto, +) -> Optional[CreateProfileImageResponseDto]: + """ + Args: + body (CreateProfileImageDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateProfileImageResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateProfileImageDto, +) -> Response[CreateProfileImageResponseDto]: + """ + Args: + body (CreateProfileImageDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateProfileImageResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateProfileImageDto, +) -> Optional[CreateProfileImageResponseDto]: + """ + Args: + body (CreateProfileImageDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateProfileImageResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/delete_profile_image.py b/immich_carddav_sync/immich_client/api/users/delete_profile_image.py new file mode 100644 index 0000000..617f5c4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/delete_profile_image.py @@ -0,0 +1,77 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/users/profile-image", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 204: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/users/delete_user_license.py b/immich_carddav_sync/immich_client/api/users/delete_user_license.py new file mode 100644 index 0000000..deed439 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/delete_user_license.py @@ -0,0 +1,77 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": "/users/me/license", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: + if response.status_code == 200: + return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/immich_carddav_sync/immich_client/api/users/get_my_preferences.py b/immich_carddav_sync/immich_client/api/users/get_my_preferences.py new file mode 100644 index 0000000..106c84b --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/get_my_preferences.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_preferences_response_dto import UserPreferencesResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/users/me/preferences", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserPreferencesResponseDto]: + if response.status_code == 200: + response_200 = UserPreferencesResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserPreferencesResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[UserPreferencesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[UserPreferencesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[UserPreferencesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[UserPreferencesResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/get_my_user.py b/immich_carddav_sync/immich_client/api/users/get_my_user.py new file mode 100644 index 0000000..d7408c0 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/get_my_user.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/users/me", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/get_profile_image.py b/immich_carddav_sync/immich_client/api/users/get_profile_image.py new file mode 100644 index 0000000..e4361c9 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/get_profile_image.py @@ -0,0 +1,143 @@ +from http import HTTPStatus +from io import BytesIO +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import File, Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/users/{id}/profile-image", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: + if response.status_code == 200: + response_200 = File(payload=BytesIO(response.content)) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[File]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[File] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[File]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + File + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/get_user.py b/immich_carddav_sync/immich_client/api/users/get_user.py new file mode 100644 index 0000000..21306a7 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/get_user.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_response_dto import UserResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/users/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserResponseDto]: + if response.status_code == 200: + response_200 = UserResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/get_user_license.py b/immich_carddav_sync/immich_client/api/users/get_user_license.py new file mode 100644 index 0000000..0c10be4 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/get_user_license.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.license_response_dto import LicenseResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/users/me/license", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LicenseResponseDto]: + if response.status_code == 200: + response_200 = LicenseResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LicenseResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[LicenseResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[LicenseResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[LicenseResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[LicenseResponseDto]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/search_users.py b/immich_carddav_sync/immich_client/api/users/search_users.py new file mode 100644 index 0000000..9b9b09d --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/search_users.py @@ -0,0 +1,127 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_response_dto import UserResponseDto +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/users", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["UserResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = UserResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["UserResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["UserResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['UserResponseDto']] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List["UserResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['UserResponseDto'] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List["UserResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['UserResponseDto']] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List["UserResponseDto"]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['UserResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/set_user_license.py b/immich_carddav_sync/immich_client/api/users/set_user_license.py new file mode 100644 index 0000000..4013f5f --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/set_user_license.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.license_key_dto import LicenseKeyDto +from ...models.license_response_dto import LicenseResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: LicenseKeyDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/users/me/license", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[LicenseResponseDto]: + if response.status_code == 200: + response_200 = LicenseResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[LicenseResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Response[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Optional[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Response[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LicenseResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: LicenseKeyDto, +) -> Optional[LicenseResponseDto]: + """ + Args: + body (LicenseKeyDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LicenseResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/update_my_preferences.py b/immich_carddav_sync/immich_client/api/users/update_my_preferences.py new file mode 100644 index 0000000..d6bcf63 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/update_my_preferences.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_preferences_response_dto import UserPreferencesResponseDto +from ...models.user_preferences_update_dto import UserPreferencesUpdateDto +from ...types import Response + + +def _get_kwargs( + *, + body: UserPreferencesUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/users/me/preferences", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserPreferencesResponseDto]: + if response.status_code == 200: + response_200 = UserPreferencesResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserPreferencesResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users/update_my_user.py b/immich_carddav_sync/immich_client/api/users/update_my_user.py new file mode 100644 index 0000000..26dc142 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users/update_my_user.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...models.user_update_me_dto import UserUpdateMeDto +from ...types import Response + + +def _get_kwargs( + *, + body: UserUpdateMeDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": "/users/me", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UserUpdateMeDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + body (UserUpdateMeDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UserUpdateMeDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + body (UserUpdateMeDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UserUpdateMeDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + body (UserUpdateMeDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UserUpdateMeDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + body (UserUpdateMeDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/__init__.py b/immich_carddav_sync/immich_client/api/users_admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/users_admin/create_user_admin.py b/immich_carddav_sync/immich_client/api/users_admin/create_user_admin.py new file mode 100644 index 0000000..a34d256 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/create_user_admin.py @@ -0,0 +1,156 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_create_dto import UserAdminCreateDto +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import Response + + +def _get_kwargs( + *, + body: UserAdminCreateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/admin/users", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 201: + response_201 = UserAdminResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: UserAdminCreateDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + body (UserAdminCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: UserAdminCreateDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + body (UserAdminCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UserAdminCreateDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + body (UserAdminCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: UserAdminCreateDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + body (UserAdminCreateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/delete_user_admin.py b/immich_carddav_sync/immich_client/api/users_admin/delete_user_admin.py new file mode 100644 index 0000000..6361dfa --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/delete_user_admin.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_delete_dto import UserAdminDeleteDto +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UserAdminDeleteDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/admin/users/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminDeleteDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminDeleteDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminDeleteDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminDeleteDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminDeleteDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/get_user_admin.py b/immich_carddav_sync/immich_client/api/users_admin/get_user_admin.py new file mode 100644 index 0000000..bfafc76 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/get_user_admin.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/admin/users/{id}", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/get_user_preferences_admin.py b/immich_carddav_sync/immich_client/api/users_admin/get_user_preferences_admin.py new file mode 100644 index 0000000..7c417bf --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/get_user_preferences_admin.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_preferences_response_dto import UserPreferencesResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/admin/users/{id}/preferences", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserPreferencesResponseDto]: + if response.status_code == 200: + response_200 = UserPreferencesResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserPreferencesResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/restore_user_admin.py b/immich_carddav_sync/immich_client/api/users_admin/restore_user_admin.py new file mode 100644 index 0000000..8e65fc1 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/restore_user_admin.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/admin/users/{id}/restore", + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 201: + response_201 = UserAdminResponseDto.from_dict(response.json()) + + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/search_users_admin.py b/immich_carddav_sync/immich_client/api/users_admin/search_users_admin.py new file mode 100644 index 0000000..ad4bdc7 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/search_users_admin.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + with_deleted: Union[Unset, bool] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["withDeleted"] = with_deleted + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/admin/users", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["UserAdminResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = UserAdminResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["UserAdminResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + with_deleted: Union[Unset, bool] = UNSET, +) -> Response[List["UserAdminResponseDto"]]: + """ + Args: + with_deleted (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['UserAdminResponseDto']] + """ + + kwargs = _get_kwargs( + with_deleted=with_deleted, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + with_deleted: Union[Unset, bool] = UNSET, +) -> Optional[List["UserAdminResponseDto"]]: + """ + Args: + with_deleted (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['UserAdminResponseDto'] + """ + + return sync_detailed( + client=client, + with_deleted=with_deleted, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + with_deleted: Union[Unset, bool] = UNSET, +) -> Response[List["UserAdminResponseDto"]]: + """ + Args: + with_deleted (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['UserAdminResponseDto']] + """ + + kwargs = _get_kwargs( + with_deleted=with_deleted, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + with_deleted: Union[Unset, bool] = UNSET, +) -> Optional[List["UserAdminResponseDto"]]: + """ + Args: + with_deleted (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['UserAdminResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + with_deleted=with_deleted, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/update_user_admin.py b/immich_carddav_sync/immich_client/api/users_admin/update_user_admin.py new file mode 100644 index 0000000..61d2a14 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/update_user_admin.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_admin_response_dto import UserAdminResponseDto +from ...models.user_admin_update_dto import UserAdminUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UserAdminUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/admin/users/{id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserAdminResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminUpdateDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminUpdateDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminUpdateDto, +) -> Response[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserAdminResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UserAdminUpdateDto, +) -> Optional[UserAdminResponseDto]: + """ + Args: + id (UUID): + body (UserAdminUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserAdminResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/users_admin/update_user_preferences_admin.py b/immich_carddav_sync/immich_client/api/users_admin/update_user_preferences_admin.py new file mode 100644 index 0000000..d298bd2 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/users_admin/update_user_preferences_admin.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_preferences_response_dto import UserPreferencesResponseDto +from ...models.user_preferences_update_dto import UserPreferencesUpdateDto +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: UserPreferencesUpdateDto, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/admin/users/{id}/preferences", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UserPreferencesResponseDto]: + if response.status_code == 200: + response_200 = UserPreferencesResponseDto.from_dict(response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UserPreferencesResponseDto]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Response[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserPreferencesResponseDto] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: UUID, + *, + client: AuthenticatedClient, + body: UserPreferencesUpdateDto, +) -> Optional[UserPreferencesResponseDto]: + """ + Args: + id (UUID): + body (UserPreferencesUpdateDto): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserPreferencesResponseDto + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/view/__init__.py b/immich_carddav_sync/immich_client/api/view/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/immich_carddav_sync/immich_client/api/view/get_assets_by_original_path.py b/immich_carddav_sync/immich_client/api/view/get_assets_by_original_path.py new file mode 100644 index 0000000..3a267b2 --- /dev/null +++ b/immich_carddav_sync/immich_client/api/view/get_assets_by_original_path.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.asset_response_dto import AssetResponseDto +from ...types import UNSET, Response + + +def _get_kwargs( + *, + path: str, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["path"] = path + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/view/folder", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[List["AssetResponseDto"]]: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AssetResponseDto.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[List["AssetResponseDto"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + path: str, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + path (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + path=path, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + path: str, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + path (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return sync_detailed( + client=client, + path=path, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + path: str, +) -> Response[List["AssetResponseDto"]]: + """ + Args: + path (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['AssetResponseDto']] + """ + + kwargs = _get_kwargs( + path=path, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + path: str, +) -> Optional[List["AssetResponseDto"]]: + """ + Args: + path (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['AssetResponseDto'] + """ + + return ( + await asyncio_detailed( + client=client, + path=path, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/api/view/get_unique_original_paths.py b/immich_carddav_sync/immich_client/api/view/get_unique_original_paths.py new file mode 100644 index 0000000..8bcd56a --- /dev/null +++ b/immich_carddav_sync/immich_client/api/view/get_unique_original_paths.py @@ -0,0 +1,117 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/view/folder/unique-paths", + } + + return _kwargs + + +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]: + if response.status_code == 200: + response_200 = cast(List[str], response.json()) + + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[List[str]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Optional[List[str]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[List[str]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List[str]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Optional[List[str]]: + """ + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List[str] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/immich_carddav_sync/immich_client/models/admin_onboarding_update_dto.py b/immich_carddav_sync/immich_client/models/admin_onboarding_update_dto.py new file mode 100644 index 0000000..54e88b2 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/admin_onboarding_update_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AdminOnboardingUpdateDto") + + +@_attrs_define +class AdminOnboardingUpdateDto: + """ + Attributes: + is_onboarded (bool): + """ + + is_onboarded: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + is_onboarded = self.is_onboarded + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "isOnboarded": is_onboarded, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + is_onboarded = d.pop("isOnboarded") + + admin_onboarding_update_dto = cls( + is_onboarded=is_onboarded, + ) + + admin_onboarding_update_dto.additional_properties = d + return admin_onboarding_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/album_statistics_response_dto.py b/immich_carddav_sync/immich_client/models/album_statistics_response_dto.py new file mode 100644 index 0000000..ae2679a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/album_statistics_response_dto.py @@ -0,0 +1,74 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AlbumStatisticsResponseDto") + + +@_attrs_define +class AlbumStatisticsResponseDto: + """ + Attributes: + not_shared (int): + owned (int): + shared (int): + """ + + not_shared: int + owned: int + shared: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + not_shared = self.not_shared + + owned = self.owned + + shared = self.shared + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "notShared": not_shared, + "owned": owned, + "shared": shared, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + not_shared = d.pop("notShared") + + owned = d.pop("owned") + + shared = d.pop("shared") + + album_statistics_response_dto = cls( + not_shared=not_shared, + owned=owned, + shared=shared, + ) + + album_statistics_response_dto.additional_properties = d + return album_statistics_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/album_user_add_dto.py b/immich_carddav_sync/immich_client/models/album_user_add_dto.py new file mode 100644 index 0000000..97246f4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/album_user_add_dto.py @@ -0,0 +1,78 @@ +from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.album_user_role import AlbumUserRole +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AlbumUserAddDto") + + +@_attrs_define +class AlbumUserAddDto: + """ + Attributes: + user_id (UUID): + role (Union[Unset, AlbumUserRole]): + """ + + user_id: UUID + role: Union[Unset, AlbumUserRole] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + user_id = str(self.user_id) + + role: Union[Unset, str] = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "userId": user_id, + } + ) + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + user_id = UUID(d.pop("userId")) + + _role = d.pop("role", UNSET) + role: Union[Unset, AlbumUserRole] + if isinstance(_role, Unset): + role = UNSET + else: + role = AlbumUserRole(_role) + + album_user_add_dto = cls( + user_id=user_id, + role=role, + ) + + album_user_add_dto.additional_properties = d + return album_user_add_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/album_user_create_dto.py b/immich_carddav_sync/immich_client/models/album_user_create_dto.py new file mode 100644 index 0000000..9c28e7d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/album_user_create_dto.py @@ -0,0 +1,69 @@ +from typing import Any, Dict, List, Type, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.album_user_role import AlbumUserRole + +T = TypeVar("T", bound="AlbumUserCreateDto") + + +@_attrs_define +class AlbumUserCreateDto: + """ + Attributes: + role (AlbumUserRole): + user_id (UUID): + """ + + role: AlbumUserRole + user_id: UUID + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + role = self.role.value + + user_id = str(self.user_id) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "role": role, + "userId": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + role = AlbumUserRole(d.pop("role")) + + user_id = UUID(d.pop("userId")) + + album_user_create_dto = cls( + role=role, + user_id=user_id, + ) + + album_user_create_dto.additional_properties = d + return album_user_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/album_user_response_dto.py b/immich_carddav_sync/immich_client/models/album_user_response_dto.py new file mode 100644 index 0000000..d2162c5 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/album_user_response_dto.py @@ -0,0 +1,74 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.album_user_role import AlbumUserRole + +if TYPE_CHECKING: + from ..models.user_response_dto import UserResponseDto + + +T = TypeVar("T", bound="AlbumUserResponseDto") + + +@_attrs_define +class AlbumUserResponseDto: + """ + Attributes: + role (AlbumUserRole): + user (UserResponseDto): + """ + + role: AlbumUserRole + user: "UserResponseDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + role = self.role.value + + user = self.user.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "role": role, + "user": user, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.user_response_dto import UserResponseDto + + d = src_dict.copy() + role = AlbumUserRole(d.pop("role")) + + user = UserResponseDto.from_dict(d.pop("user")) + + album_user_response_dto = cls( + role=role, + user=user, + ) + + album_user_response_dto.additional_properties = d + return album_user_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/album_user_role.py b/immich_carddav_sync/immich_client/models/album_user_role.py new file mode 100644 index 0000000..a8fd175 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/album_user_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class AlbumUserRole(str, Enum): + EDITOR = "editor" + VIEWER = "viewer" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/asset_delta_sync_dto.py b/immich_carddav_sync/immich_client/models/asset_delta_sync_dto.py new file mode 100644 index 0000000..9fa5ff0 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_delta_sync_dto.py @@ -0,0 +1,77 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="AssetDeltaSyncDto") + + +@_attrs_define +class AssetDeltaSyncDto: + """ + Attributes: + updated_after (datetime.datetime): + user_ids (List[UUID]): + """ + + updated_after: datetime.datetime + user_ids: List[UUID] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + updated_after = self.updated_after.isoformat() + + user_ids = [] + for user_ids_item_data in self.user_ids: + user_ids_item = str(user_ids_item_data) + user_ids.append(user_ids_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "updatedAfter": updated_after, + "userIds": user_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + updated_after = isoparse(d.pop("updatedAfter")) + + user_ids = [] + _user_ids = d.pop("userIds") + for user_ids_item_data in _user_ids: + user_ids_item = UUID(user_ids_item_data) + + user_ids.append(user_ids_item) + + asset_delta_sync_dto = cls( + updated_after=updated_after, + user_ids=user_ids, + ) + + asset_delta_sync_dto.additional_properties = d + return asset_delta_sync_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_delta_sync_response_dto.py b/immich_carddav_sync/immich_client/models/asset_delta_sync_response_dto.py new file mode 100644 index 0000000..deadbd0 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_delta_sync_response_dto.py @@ -0,0 +1,88 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.asset_response_dto import AssetResponseDto + + +T = TypeVar("T", bound="AssetDeltaSyncResponseDto") + + +@_attrs_define +class AssetDeltaSyncResponseDto: + """ + Attributes: + deleted (List[str]): + needs_full_sync (bool): + upserted (List['AssetResponseDto']): + """ + + deleted: List[str] + needs_full_sync: bool + upserted: List["AssetResponseDto"] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + deleted = self.deleted + + needs_full_sync = self.needs_full_sync + + upserted = [] + for upserted_item_data in self.upserted: + upserted_item = upserted_item_data.to_dict() + upserted.append(upserted_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deleted": deleted, + "needsFullSync": needs_full_sync, + "upserted": upserted, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_response_dto import AssetResponseDto + + d = src_dict.copy() + deleted = cast(List[str], d.pop("deleted")) + + needs_full_sync = d.pop("needsFullSync") + + upserted = [] + _upserted = d.pop("upserted") + for upserted_item_data in _upserted: + upserted_item = AssetResponseDto.from_dict(upserted_item_data) + + upserted.append(upserted_item) + + asset_delta_sync_response_dto = cls( + deleted=deleted, + needs_full_sync=needs_full_sync, + upserted=upserted, + ) + + asset_delta_sync_response_dto.additional_properties = d + return asset_delta_sync_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_full_sync_dto.py b/immich_carddav_sync/immich_client/models/asset_full_sync_dto.py new file mode 100644 index 0000000..718e48b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_full_sync_dto.py @@ -0,0 +1,103 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AssetFullSyncDto") + + +@_attrs_define +class AssetFullSyncDto: + """ + Attributes: + limit (int): + updated_until (datetime.datetime): + last_id (Union[Unset, UUID]): + user_id (Union[Unset, UUID]): + """ + + limit: int + updated_until: datetime.datetime + last_id: Union[Unset, UUID] = UNSET + user_id: Union[Unset, UUID] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + limit = self.limit + + updated_until = self.updated_until.isoformat() + + last_id: Union[Unset, str] = UNSET + if not isinstance(self.last_id, Unset): + last_id = str(self.last_id) + + user_id: Union[Unset, str] = UNSET + if not isinstance(self.user_id, Unset): + user_id = str(self.user_id) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "limit": limit, + "updatedUntil": updated_until, + } + ) + if last_id is not UNSET: + field_dict["lastId"] = last_id + if user_id is not UNSET: + field_dict["userId"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + limit = d.pop("limit") + + updated_until = isoparse(d.pop("updatedUntil")) + + _last_id = d.pop("lastId", UNSET) + last_id: Union[Unset, UUID] + if isinstance(_last_id, Unset): + last_id = UNSET + else: + last_id = UUID(_last_id) + + _user_id = d.pop("userId", UNSET) + user_id: Union[Unset, UUID] + if isinstance(_user_id, Unset): + user_id = UNSET + else: + user_id = UUID(_user_id) + + asset_full_sync_dto = cls( + limit=limit, + updated_until=updated_until, + last_id=last_id, + user_id=user_id, + ) + + asset_full_sync_dto.additional_properties = d + return asset_full_sync_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_media_create_dto.py b/immich_carddav_sync/immich_client/models/asset_media_create_dto.py new file mode 100644 index 0000000..bdf0925 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_media_create_dto.py @@ -0,0 +1,233 @@ +import datetime +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, File, FileJsonType, Unset + +T = TypeVar("T", bound="AssetMediaCreateDto") + + +@_attrs_define +class AssetMediaCreateDto: + """ + Attributes: + asset_data (File): + device_asset_id (str): + device_id (str): + file_created_at (datetime.datetime): + file_modified_at (datetime.datetime): + duration (Union[Unset, str]): + is_archived (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_visible (Union[Unset, bool]): + live_photo_video_id (Union[Unset, UUID]): + sidecar_data (Union[Unset, File]): + """ + + asset_data: File + device_asset_id: str + device_id: str + file_created_at: datetime.datetime + file_modified_at: datetime.datetime + duration: Union[Unset, str] = UNSET + is_archived: Union[Unset, bool] = UNSET + is_favorite: Union[Unset, bool] = UNSET + is_visible: Union[Unset, bool] = UNSET + live_photo_video_id: Union[Unset, UUID] = UNSET + sidecar_data: Union[Unset, File] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_data = self.asset_data.to_tuple() + + device_asset_id = self.device_asset_id + + device_id = self.device_id + + file_created_at = self.file_created_at.isoformat() + + file_modified_at = self.file_modified_at.isoformat() + + duration = self.duration + + is_archived = self.is_archived + + is_favorite = self.is_favorite + + is_visible = self.is_visible + + live_photo_video_id: Union[Unset, str] = UNSET + if not isinstance(self.live_photo_video_id, Unset): + live_photo_video_id = str(self.live_photo_video_id) + + sidecar_data: Union[Unset, FileJsonType] = UNSET + if not isinstance(self.sidecar_data, Unset): + sidecar_data = self.sidecar_data.to_tuple() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetData": asset_data, + "deviceAssetId": device_asset_id, + "deviceId": device_id, + "fileCreatedAt": file_created_at, + "fileModifiedAt": file_modified_at, + } + ) + if duration is not UNSET: + field_dict["duration"] = duration + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if is_favorite is not UNSET: + field_dict["isFavorite"] = is_favorite + if is_visible is not UNSET: + field_dict["isVisible"] = is_visible + if live_photo_video_id is not UNSET: + field_dict["livePhotoVideoId"] = live_photo_video_id + if sidecar_data is not UNSET: + field_dict["sidecarData"] = sidecar_data + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + asset_data = self.asset_data.to_tuple() + + device_asset_id = (None, str(self.device_asset_id).encode(), "text/plain") + + device_id = (None, str(self.device_id).encode(), "text/plain") + + file_created_at = self.file_created_at.isoformat().encode() + + file_modified_at = self.file_modified_at.isoformat().encode() + + duration = ( + self.duration if isinstance(self.duration, Unset) else (None, str(self.duration).encode(), "text/plain") + ) + + is_archived = ( + self.is_archived + if isinstance(self.is_archived, Unset) + else (None, str(self.is_archived).encode(), "text/plain") + ) + + is_favorite = ( + self.is_favorite + if isinstance(self.is_favorite, Unset) + else (None, str(self.is_favorite).encode(), "text/plain") + ) + + is_visible = ( + self.is_visible + if isinstance(self.is_visible, Unset) + else (None, str(self.is_visible).encode(), "text/plain") + ) + + live_photo_video_id: Union[Unset, bytes] = UNSET + if not isinstance(self.live_photo_video_id, Unset): + live_photo_video_id = str(self.live_photo_video_id) + + sidecar_data: Union[Unset, FileJsonType] = UNSET + if not isinstance(self.sidecar_data, Unset): + sidecar_data = self.sidecar_data.to_tuple() + + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + field_dict.update( + { + "assetData": asset_data, + "deviceAssetId": device_asset_id, + "deviceId": device_id, + "fileCreatedAt": file_created_at, + "fileModifiedAt": file_modified_at, + } + ) + if duration is not UNSET: + field_dict["duration"] = duration + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if is_favorite is not UNSET: + field_dict["isFavorite"] = is_favorite + if is_visible is not UNSET: + field_dict["isVisible"] = is_visible + if live_photo_video_id is not UNSET: + field_dict["livePhotoVideoId"] = live_photo_video_id + if sidecar_data is not UNSET: + field_dict["sidecarData"] = sidecar_data + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + asset_data = File(payload=BytesIO(d.pop("assetData"))) + + device_asset_id = d.pop("deviceAssetId") + + device_id = d.pop("deviceId") + + file_created_at = isoparse(d.pop("fileCreatedAt")) + + file_modified_at = isoparse(d.pop("fileModifiedAt")) + + duration = d.pop("duration", UNSET) + + is_archived = d.pop("isArchived", UNSET) + + is_favorite = d.pop("isFavorite", UNSET) + + is_visible = d.pop("isVisible", UNSET) + + _live_photo_video_id = d.pop("livePhotoVideoId", UNSET) + live_photo_video_id: Union[Unset, UUID] + if isinstance(_live_photo_video_id, Unset): + live_photo_video_id = UNSET + else: + live_photo_video_id = UUID(_live_photo_video_id) + + _sidecar_data = d.pop("sidecarData", UNSET) + sidecar_data: Union[Unset, File] + if isinstance(_sidecar_data, Unset): + sidecar_data = UNSET + else: + sidecar_data = File(payload=BytesIO(_sidecar_data)) + + asset_media_create_dto = cls( + asset_data=asset_data, + device_asset_id=device_asset_id, + device_id=device_id, + file_created_at=file_created_at, + file_modified_at=file_modified_at, + duration=duration, + is_archived=is_archived, + is_favorite=is_favorite, + is_visible=is_visible, + live_photo_video_id=live_photo_video_id, + sidecar_data=sidecar_data, + ) + + asset_media_create_dto.additional_properties = d + return asset_media_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_media_replace_dto.py b/immich_carddav_sync/immich_client/models/asset_media_replace_dto.py new file mode 100644 index 0000000..2bb30b3 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_media_replace_dto.py @@ -0,0 +1,137 @@ +import datetime +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, File, Unset + +T = TypeVar("T", bound="AssetMediaReplaceDto") + + +@_attrs_define +class AssetMediaReplaceDto: + """ + Attributes: + asset_data (File): + device_asset_id (str): + device_id (str): + file_created_at (datetime.datetime): + file_modified_at (datetime.datetime): + duration (Union[Unset, str]): + """ + + asset_data: File + device_asset_id: str + device_id: str + file_created_at: datetime.datetime + file_modified_at: datetime.datetime + duration: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_data = self.asset_data.to_tuple() + + device_asset_id = self.device_asset_id + + device_id = self.device_id + + file_created_at = self.file_created_at.isoformat() + + file_modified_at = self.file_modified_at.isoformat() + + duration = self.duration + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetData": asset_data, + "deviceAssetId": device_asset_id, + "deviceId": device_id, + "fileCreatedAt": file_created_at, + "fileModifiedAt": file_modified_at, + } + ) + if duration is not UNSET: + field_dict["duration"] = duration + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + asset_data = self.asset_data.to_tuple() + + device_asset_id = (None, str(self.device_asset_id).encode(), "text/plain") + + device_id = (None, str(self.device_id).encode(), "text/plain") + + file_created_at = self.file_created_at.isoformat().encode() + + file_modified_at = self.file_modified_at.isoformat().encode() + + duration = ( + self.duration if isinstance(self.duration, Unset) else (None, str(self.duration).encode(), "text/plain") + ) + + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + field_dict.update( + { + "assetData": asset_data, + "deviceAssetId": device_asset_id, + "deviceId": device_id, + "fileCreatedAt": file_created_at, + "fileModifiedAt": file_modified_at, + } + ) + if duration is not UNSET: + field_dict["duration"] = duration + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + asset_data = File(payload=BytesIO(d.pop("assetData"))) + + device_asset_id = d.pop("deviceAssetId") + + device_id = d.pop("deviceId") + + file_created_at = isoparse(d.pop("fileCreatedAt")) + + file_modified_at = isoparse(d.pop("fileModifiedAt")) + + duration = d.pop("duration", UNSET) + + asset_media_replace_dto = cls( + asset_data=asset_data, + device_asset_id=device_asset_id, + device_id=device_id, + file_created_at=file_created_at, + file_modified_at=file_modified_at, + duration=duration, + ) + + asset_media_replace_dto.additional_properties = d + return asset_media_replace_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_media_response_dto.py b/immich_carddav_sync/immich_client/models/asset_media_response_dto.py new file mode 100644 index 0000000..5add594 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_media_response_dto.py @@ -0,0 +1,68 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.asset_media_status import AssetMediaStatus + +T = TypeVar("T", bound="AssetMediaResponseDto") + + +@_attrs_define +class AssetMediaResponseDto: + """ + Attributes: + id (str): + status (AssetMediaStatus): + """ + + id: str + status: AssetMediaStatus + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + id = self.id + + status = self.status.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "status": status, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id") + + status = AssetMediaStatus(d.pop("status")) + + asset_media_response_dto = cls( + id=id, + status=status, + ) + + asset_media_response_dto.additional_properties = d + return asset_media_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/asset_media_size.py b/immich_carddav_sync/immich_client/models/asset_media_size.py new file mode 100644 index 0000000..6a6dc95 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_media_size.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class AssetMediaSize(str, Enum): + PREVIEW = "preview" + THUMBNAIL = "thumbnail" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/asset_media_status.py b/immich_carddav_sync/immich_client/models/asset_media_status.py new file mode 100644 index 0000000..c9b212a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_media_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class AssetMediaStatus(str, Enum): + CREATED = "created" + DUPLICATE = "duplicate" + REPLACED = "replaced" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/asset_stack_response_dto.py b/immich_carddav_sync/immich_client/models/asset_stack_response_dto.py new file mode 100644 index 0000000..733fe80 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_stack_response_dto.py @@ -0,0 +1,74 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AssetStackResponseDto") + + +@_attrs_define +class AssetStackResponseDto: + """ + Attributes: + asset_count (int): + id (str): + primary_asset_id (str): + """ + + asset_count: int + id: str + primary_asset_id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_count = self.asset_count + + id = self.id + + primary_asset_id = self.primary_asset_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetCount": asset_count, + "id": id, + "primaryAssetId": primary_asset_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + asset_count = d.pop("assetCount") + + id = d.pop("id") + + primary_asset_id = d.pop("primaryAssetId") + + asset_stack_response_dto = cls( + asset_count=asset_count, + id=id, + primary_asset_id=primary_asset_id, + ) + + asset_stack_response_dto.additional_properties = d + return asset_stack_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/avatar_response.py b/immich_carddav_sync/immich_client/models/avatar_response.py new file mode 100644 index 0000000..a589992 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/avatar_response.py @@ -0,0 +1,60 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.user_avatar_color import UserAvatarColor + +T = TypeVar("T", bound="AvatarResponse") + + +@_attrs_define +class AvatarResponse: + """ + Attributes: + color (UserAvatarColor): + """ + + color: UserAvatarColor + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + color = self.color.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "color": color, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + color = UserAvatarColor(d.pop("color")) + + avatar_response = cls( + color=color, + ) + + avatar_response.additional_properties = d + return avatar_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/avatar_update.py b/immich_carddav_sync/immich_client/models/avatar_update.py new file mode 100644 index 0000000..95d3bed --- /dev/null +++ b/immich_carddav_sync/immich_client/models/avatar_update.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.user_avatar_color import UserAvatarColor +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AvatarUpdate") + + +@_attrs_define +class AvatarUpdate: + """ + Attributes: + color (Union[Unset, UserAvatarColor]): + """ + + color: Union[Unset, UserAvatarColor] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + color: Union[Unset, str] = UNSET + if not isinstance(self.color, Unset): + color = self.color.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if color is not UNSET: + field_dict["color"] = color + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _color = d.pop("color", UNSET) + color: Union[Unset, UserAvatarColor] + if isinstance(_color, Unset): + color = UNSET + else: + color = UserAvatarColor(_color) + + avatar_update = cls( + color=color, + ) + + avatar_update.additional_properties = d + return avatar_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/download_response.py b/immich_carddav_sync/immich_client/models/download_response.py new file mode 100644 index 0000000..0fa137e --- /dev/null +++ b/immich_carddav_sync/immich_client/models/download_response.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DownloadResponse") + + +@_attrs_define +class DownloadResponse: + """ + Attributes: + archive_size (int): + include_embedded_videos (bool): Default: False. + """ + + archive_size: int + include_embedded_videos: bool = False + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + archive_size = self.archive_size + + include_embedded_videos = self.include_embedded_videos + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "archiveSize": archive_size, + "includeEmbeddedVideos": include_embedded_videos, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + archive_size = d.pop("archiveSize") + + include_embedded_videos = d.pop("includeEmbeddedVideos") + + download_response = cls( + archive_size=archive_size, + include_embedded_videos=include_embedded_videos, + ) + + download_response.additional_properties = d + return download_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/download_update.py b/immich_carddav_sync/immich_client/models/download_update.py new file mode 100644 index 0000000..5c28cf4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/download_update.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DownloadUpdate") + + +@_attrs_define +class DownloadUpdate: + """ + Attributes: + archive_size (Union[Unset, int]): + include_embedded_videos (Union[Unset, bool]): + """ + + archive_size: Union[Unset, int] = UNSET + include_embedded_videos: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + archive_size = self.archive_size + + include_embedded_videos = self.include_embedded_videos + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if archive_size is not UNSET: + field_dict["archiveSize"] = archive_size + if include_embedded_videos is not UNSET: + field_dict["includeEmbeddedVideos"] = include_embedded_videos + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + archive_size = d.pop("archiveSize", UNSET) + + include_embedded_videos = d.pop("includeEmbeddedVideos", UNSET) + + download_update = cls( + archive_size=archive_size, + include_embedded_videos=include_embedded_videos, + ) + + download_update.additional_properties = d + return download_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/duplicate_detection_config.py b/immich_carddav_sync/immich_client/models/duplicate_detection_config.py new file mode 100644 index 0000000..15a4b6e --- /dev/null +++ b/immich_carddav_sync/immich_client/models/duplicate_detection_config.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DuplicateDetectionConfig") + + +@_attrs_define +class DuplicateDetectionConfig: + """ + Attributes: + enabled (bool): + max_distance (float): + """ + + enabled: bool + max_distance: float + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + max_distance = self.max_distance + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "maxDistance": max_distance, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + max_distance = d.pop("maxDistance") + + duplicate_detection_config = cls( + enabled=enabled, + max_distance=max_distance, + ) + + duplicate_detection_config.additional_properties = d + return duplicate_detection_config + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/duplicate_response_dto.py b/immich_carddav_sync/immich_client/models/duplicate_response_dto.py new file mode 100644 index 0000000..83c0bf9 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/duplicate_response_dto.py @@ -0,0 +1,80 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.asset_response_dto import AssetResponseDto + + +T = TypeVar("T", bound="DuplicateResponseDto") + + +@_attrs_define +class DuplicateResponseDto: + """ + Attributes: + assets (List['AssetResponseDto']): + duplicate_id (str): + """ + + assets: List["AssetResponseDto"] + duplicate_id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + assets = [] + for assets_item_data in self.assets: + assets_item = assets_item_data.to_dict() + assets.append(assets_item) + + duplicate_id = self.duplicate_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assets": assets, + "duplicateId": duplicate_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_response_dto import AssetResponseDto + + d = src_dict.copy() + assets = [] + _assets = d.pop("assets") + for assets_item_data in _assets: + assets_item = AssetResponseDto.from_dict(assets_item_data) + + assets.append(assets_item) + + duplicate_id = d.pop("duplicateId") + + duplicate_response_dto = cls( + assets=assets, + duplicate_id=duplicate_id, + ) + + duplicate_response_dto.additional_properties = d + return duplicate_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/email_notifications_response.py b/immich_carddav_sync/immich_client/models/email_notifications_response.py new file mode 100644 index 0000000..3d8b093 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/email_notifications_response.py @@ -0,0 +1,74 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EmailNotificationsResponse") + + +@_attrs_define +class EmailNotificationsResponse: + """ + Attributes: + album_invite (bool): + album_update (bool): + enabled (bool): + """ + + album_invite: bool + album_update: bool + enabled: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + album_invite = self.album_invite + + album_update = self.album_update + + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "albumInvite": album_invite, + "albumUpdate": album_update, + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + album_invite = d.pop("albumInvite") + + album_update = d.pop("albumUpdate") + + enabled = d.pop("enabled") + + email_notifications_response = cls( + album_invite=album_invite, + album_update=album_update, + enabled=enabled, + ) + + email_notifications_response.additional_properties = d + return email_notifications_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/email_notifications_update.py b/immich_carddav_sync/immich_client/models/email_notifications_update.py new file mode 100644 index 0000000..1dfe47a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/email_notifications_update.py @@ -0,0 +1,76 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EmailNotificationsUpdate") + + +@_attrs_define +class EmailNotificationsUpdate: + """ + Attributes: + album_invite (Union[Unset, bool]): + album_update (Union[Unset, bool]): + enabled (Union[Unset, bool]): + """ + + album_invite: Union[Unset, bool] = UNSET + album_update: Union[Unset, bool] = UNSET + enabled: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + album_invite = self.album_invite + + album_update = self.album_update + + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if album_invite is not UNSET: + field_dict["albumInvite"] = album_invite + if album_update is not UNSET: + field_dict["albumUpdate"] = album_update + if enabled is not UNSET: + field_dict["enabled"] = enabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + album_invite = d.pop("albumInvite", UNSET) + + album_update = d.pop("albumUpdate", UNSET) + + enabled = d.pop("enabled", UNSET) + + email_notifications_update = cls( + album_invite=album_invite, + album_update=album_update, + enabled=enabled, + ) + + email_notifications_update.additional_properties = d + return email_notifications_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/facial_recognition_config.py b/immich_carddav_sync/immich_client/models/facial_recognition_config.py new file mode 100644 index 0000000..65ca5a3 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/facial_recognition_config.py @@ -0,0 +1,90 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FacialRecognitionConfig") + + +@_attrs_define +class FacialRecognitionConfig: + """ + Attributes: + enabled (bool): + max_distance (float): + min_faces (int): + min_score (float): + model_name (str): + """ + + enabled: bool + max_distance: float + min_faces: int + min_score: float + model_name: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + max_distance = self.max_distance + + min_faces = self.min_faces + + min_score = self.min_score + + model_name = self.model_name + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "maxDistance": max_distance, + "minFaces": min_faces, + "minScore": min_score, + "modelName": model_name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + max_distance = d.pop("maxDistance") + + min_faces = d.pop("minFaces") + + min_score = d.pop("minScore") + + model_name = d.pop("modelName") + + facial_recognition_config = cls( + enabled=enabled, + max_distance=max_distance, + min_faces=min_faces, + min_score=min_score, + model_name=model_name, + ) + + facial_recognition_config.additional_properties = d + return facial_recognition_config + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/folders_response.py b/immich_carddav_sync/immich_client/models/folders_response.py new file mode 100644 index 0000000..98b1479 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/folders_response.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FoldersResponse") + + +@_attrs_define +class FoldersResponse: + """ + Attributes: + enabled (bool): Default: False. + sidebar_web (bool): Default: False. + """ + + enabled: bool = False + sidebar_web: bool = False + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "sidebarWeb": sidebar_web, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + sidebar_web = d.pop("sidebarWeb") + + folders_response = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + folders_response.additional_properties = d + return folders_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/folders_update.py b/immich_carddav_sync/immich_client/models/folders_update.py new file mode 100644 index 0000000..77671c2 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/folders_update.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FoldersUpdate") + + +@_attrs_define +class FoldersUpdate: + """ + Attributes: + enabled (Union[Unset, bool]): + sidebar_web (Union[Unset, bool]): + """ + + enabled: Union[Unset, bool] = UNSET + sidebar_web: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if sidebar_web is not UNSET: + field_dict["sidebarWeb"] = sidebar_web + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled", UNSET) + + sidebar_web = d.pop("sidebarWeb", UNSET) + + folders_update = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + folders_update.additional_properties = d + return folders_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/image_format.py b/immich_carddav_sync/immich_client/models/image_format.py new file mode 100644 index 0000000..3bd3698 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/image_format.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ImageFormat(str, Enum): + JPEG = "jpeg" + WEBP = "webp" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/job_create_dto.py b/immich_carddav_sync/immich_client/models/job_create_dto.py new file mode 100644 index 0000000..3a48c78 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/job_create_dto.py @@ -0,0 +1,60 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.manual_job_name import ManualJobName + +T = TypeVar("T", bound="JobCreateDto") + + +@_attrs_define +class JobCreateDto: + """ + Attributes: + name (ManualJobName): + """ + + name: ManualJobName + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = ManualJobName(d.pop("name")) + + job_create_dto = cls( + name=name, + ) + + job_create_dto.additional_properties = d + return job_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/license_key_dto.py b/immich_carddav_sync/immich_client/models/license_key_dto.py new file mode 100644 index 0000000..e5b868b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/license_key_dto.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LicenseKeyDto") + + +@_attrs_define +class LicenseKeyDto: + """ + Attributes: + activation_key (str): + license_key (str): + """ + + activation_key: str + license_key: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + activation_key = self.activation_key + + license_key = self.license_key + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "activationKey": activation_key, + "licenseKey": license_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + activation_key = d.pop("activationKey") + + license_key = d.pop("licenseKey") + + license_key_dto = cls( + activation_key=activation_key, + license_key=license_key, + ) + + license_key_dto.additional_properties = d + return license_key_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/license_response_dto.py b/immich_carddav_sync/immich_client/models/license_response_dto.py new file mode 100644 index 0000000..16d3e20 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/license_response_dto.py @@ -0,0 +1,76 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="LicenseResponseDto") + + +@_attrs_define +class LicenseResponseDto: + """ + Attributes: + activated_at (datetime.datetime): + activation_key (str): + license_key (str): + """ + + activated_at: datetime.datetime + activation_key: str + license_key: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + activated_at = self.activated_at.isoformat() + + activation_key = self.activation_key + + license_key = self.license_key + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "activatedAt": activated_at, + "activationKey": activation_key, + "licenseKey": license_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + activated_at = isoparse(d.pop("activatedAt")) + + activation_key = d.pop("activationKey") + + license_key = d.pop("licenseKey") + + license_response_dto = cls( + activated_at=activated_at, + activation_key=activation_key, + license_key=license_key, + ) + + license_response_dto.additional_properties = d + return license_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/manual_job_name.py b/immich_carddav_sync/immich_client/models/manual_job_name.py new file mode 100644 index 0000000..b4c88c8 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/manual_job_name.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class ManualJobName(str, Enum): + PERSON_CLEANUP = "person-cleanup" + TAG_CLEANUP = "tag-cleanup" + USER_CLEANUP = "user-cleanup" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/map_reverse_geocode_response_dto.py b/immich_carddav_sync/immich_client/models/map_reverse_geocode_response_dto.py new file mode 100644 index 0000000..a282c3b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/map_reverse_geocode_response_dto.py @@ -0,0 +1,93 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MapReverseGeocodeResponseDto") + + +@_attrs_define +class MapReverseGeocodeResponseDto: + """ + Attributes: + city (Union[None, str]): + country (Union[None, str]): + state (Union[None, str]): + """ + + city: Union[None, str] + country: Union[None, str] + state: Union[None, str] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + city: Union[None, str] + city = self.city + + country: Union[None, str] + country = self.country + + state: Union[None, str] + state = self.state + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "city": city, + "country": country, + "state": state, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_city(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + city = _parse_city(d.pop("city")) + + def _parse_country(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + country = _parse_country(d.pop("country")) + + def _parse_state(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + state = _parse_state(d.pop("state")) + + map_reverse_geocode_response_dto = cls( + city=city, + country=country, + state=state, + ) + + map_reverse_geocode_response_dto.additional_properties = d + return map_reverse_geocode_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/memories_response.py b/immich_carddav_sync/immich_client/models/memories_response.py new file mode 100644 index 0000000..d807309 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memories_response.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MemoriesResponse") + + +@_attrs_define +class MemoriesResponse: + """ + Attributes: + enabled (bool): Default: True. + """ + + enabled: bool = True + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + memories_response = cls( + enabled=enabled, + ) + + memories_response.additional_properties = d + return memories_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/memories_update.py b/immich_carddav_sync/immich_client/models/memories_update.py new file mode 100644 index 0000000..8cdec19 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memories_update.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MemoriesUpdate") + + +@_attrs_define +class MemoriesUpdate: + """ + Attributes: + enabled (Union[Unset, bool]): + """ + + enabled: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled", UNSET) + + memories_update = cls( + enabled=enabled, + ) + + memories_update.additional_properties = d + return memories_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/memory_create_dto.py b/immich_carddav_sync/immich_client/models/memory_create_dto.py new file mode 100644 index 0000000..0e00340 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memory_create_dto.py @@ -0,0 +1,130 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.memory_type import MemoryType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.on_this_day_dto import OnThisDayDto + + +T = TypeVar("T", bound="MemoryCreateDto") + + +@_attrs_define +class MemoryCreateDto: + """ + Attributes: + data (OnThisDayDto): + memory_at (datetime.datetime): + type (MemoryType): + asset_ids (Union[Unset, List[UUID]]): + is_saved (Union[Unset, bool]): + seen_at (Union[Unset, datetime.datetime]): + """ + + data: "OnThisDayDto" + memory_at: datetime.datetime + type: MemoryType + asset_ids: Union[Unset, List[UUID]] = UNSET + is_saved: Union[Unset, bool] = UNSET + seen_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = self.data.to_dict() + + memory_at = self.memory_at.isoformat() + + type = self.type.value + + asset_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.asset_ids, Unset): + asset_ids = [] + for asset_ids_item_data in self.asset_ids: + asset_ids_item = str(asset_ids_item_data) + asset_ids.append(asset_ids_item) + + is_saved = self.is_saved + + seen_at: Union[Unset, str] = UNSET + if not isinstance(self.seen_at, Unset): + seen_at = self.seen_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "memoryAt": memory_at, + "type": type, + } + ) + if asset_ids is not UNSET: + field_dict["assetIds"] = asset_ids + if is_saved is not UNSET: + field_dict["isSaved"] = is_saved + if seen_at is not UNSET: + field_dict["seenAt"] = seen_at + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.on_this_day_dto import OnThisDayDto + + d = src_dict.copy() + data = OnThisDayDto.from_dict(d.pop("data")) + + memory_at = isoparse(d.pop("memoryAt")) + + type = MemoryType(d.pop("type")) + + asset_ids = [] + _asset_ids = d.pop("assetIds", UNSET) + for asset_ids_item_data in _asset_ids or []: + asset_ids_item = UUID(asset_ids_item_data) + + asset_ids.append(asset_ids_item) + + is_saved = d.pop("isSaved", UNSET) + + _seen_at = d.pop("seenAt", UNSET) + seen_at: Union[Unset, datetime.datetime] + if isinstance(_seen_at, Unset): + seen_at = UNSET + else: + seen_at = isoparse(_seen_at) + + memory_create_dto = cls( + data=data, + memory_at=memory_at, + type=type, + asset_ids=asset_ids, + is_saved=is_saved, + seen_at=seen_at, + ) + + memory_create_dto.additional_properties = d + return memory_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/memory_response_dto.py b/immich_carddav_sync/immich_client/models/memory_response_dto.py new file mode 100644 index 0000000..4f15c83 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memory_response_dto.py @@ -0,0 +1,175 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.memory_type import MemoryType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.asset_response_dto import AssetResponseDto + from ..models.on_this_day_dto import OnThisDayDto + + +T = TypeVar("T", bound="MemoryResponseDto") + + +@_attrs_define +class MemoryResponseDto: + """ + Attributes: + assets (List['AssetResponseDto']): + created_at (datetime.datetime): + data (OnThisDayDto): + id (str): + is_saved (bool): + memory_at (datetime.datetime): + owner_id (str): + type (MemoryType): + updated_at (datetime.datetime): + deleted_at (Union[Unset, datetime.datetime]): + seen_at (Union[Unset, datetime.datetime]): + """ + + assets: List["AssetResponseDto"] + created_at: datetime.datetime + data: "OnThisDayDto" + id: str + is_saved: bool + memory_at: datetime.datetime + owner_id: str + type: MemoryType + updated_at: datetime.datetime + deleted_at: Union[Unset, datetime.datetime] = UNSET + seen_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + assets = [] + for assets_item_data in self.assets: + assets_item = assets_item_data.to_dict() + assets.append(assets_item) + + created_at = self.created_at.isoformat() + + data = self.data.to_dict() + + id = self.id + + is_saved = self.is_saved + + memory_at = self.memory_at.isoformat() + + owner_id = self.owner_id + + type = self.type.value + + updated_at = self.updated_at.isoformat() + + deleted_at: Union[Unset, str] = UNSET + if not isinstance(self.deleted_at, Unset): + deleted_at = self.deleted_at.isoformat() + + seen_at: Union[Unset, str] = UNSET + if not isinstance(self.seen_at, Unset): + seen_at = self.seen_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assets": assets, + "createdAt": created_at, + "data": data, + "id": id, + "isSaved": is_saved, + "memoryAt": memory_at, + "ownerId": owner_id, + "type": type, + "updatedAt": updated_at, + } + ) + if deleted_at is not UNSET: + field_dict["deletedAt"] = deleted_at + if seen_at is not UNSET: + field_dict["seenAt"] = seen_at + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_response_dto import AssetResponseDto + from ..models.on_this_day_dto import OnThisDayDto + + d = src_dict.copy() + assets = [] + _assets = d.pop("assets") + for assets_item_data in _assets: + assets_item = AssetResponseDto.from_dict(assets_item_data) + + assets.append(assets_item) + + created_at = isoparse(d.pop("createdAt")) + + data = OnThisDayDto.from_dict(d.pop("data")) + + id = d.pop("id") + + is_saved = d.pop("isSaved") + + memory_at = isoparse(d.pop("memoryAt")) + + owner_id = d.pop("ownerId") + + type = MemoryType(d.pop("type")) + + updated_at = isoparse(d.pop("updatedAt")) + + _deleted_at = d.pop("deletedAt", UNSET) + deleted_at: Union[Unset, datetime.datetime] + if isinstance(_deleted_at, Unset): + deleted_at = UNSET + else: + deleted_at = isoparse(_deleted_at) + + _seen_at = d.pop("seenAt", UNSET) + seen_at: Union[Unset, datetime.datetime] + if isinstance(_seen_at, Unset): + seen_at = UNSET + else: + seen_at = isoparse(_seen_at) + + memory_response_dto = cls( + assets=assets, + created_at=created_at, + data=data, + id=id, + is_saved=is_saved, + memory_at=memory_at, + owner_id=owner_id, + type=type, + updated_at=updated_at, + deleted_at=deleted_at, + seen_at=seen_at, + ) + + memory_response_dto.additional_properties = d + return memory_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/memory_type.py b/immich_carddav_sync/immich_client/models/memory_type.py new file mode 100644 index 0000000..52b1153 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memory_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class MemoryType(str, Enum): + ON_THIS_DAY = "on_this_day" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/memory_update_dto.py b/immich_carddav_sync/immich_client/models/memory_update_dto.py new file mode 100644 index 0000000..a617771 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/memory_update_dto.py @@ -0,0 +1,92 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MemoryUpdateDto") + + +@_attrs_define +class MemoryUpdateDto: + """ + Attributes: + is_saved (Union[Unset, bool]): + memory_at (Union[Unset, datetime.datetime]): + seen_at (Union[Unset, datetime.datetime]): + """ + + is_saved: Union[Unset, bool] = UNSET + memory_at: Union[Unset, datetime.datetime] = UNSET + seen_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + is_saved = self.is_saved + + memory_at: Union[Unset, str] = UNSET + if not isinstance(self.memory_at, Unset): + memory_at = self.memory_at.isoformat() + + seen_at: Union[Unset, str] = UNSET + if not isinstance(self.seen_at, Unset): + seen_at = self.seen_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if is_saved is not UNSET: + field_dict["isSaved"] = is_saved + if memory_at is not UNSET: + field_dict["memoryAt"] = memory_at + if seen_at is not UNSET: + field_dict["seenAt"] = seen_at + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + is_saved = d.pop("isSaved", UNSET) + + _memory_at = d.pop("memoryAt", UNSET) + memory_at: Union[Unset, datetime.datetime] + if isinstance(_memory_at, Unset): + memory_at = UNSET + else: + memory_at = isoparse(_memory_at) + + _seen_at = d.pop("seenAt", UNSET) + seen_at: Union[Unset, datetime.datetime] + if isinstance(_seen_at, Unset): + seen_at = UNSET + else: + seen_at = isoparse(_seen_at) + + memory_update_dto = cls( + is_saved=is_saved, + memory_at=memory_at, + seen_at=seen_at, + ) + + memory_update_dto.additional_properties = d + return memory_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/metadata_search_dto.py b/immich_carddav_sync/immich_client/models/metadata_search_dto.py new file mode 100644 index 0000000..958c5df --- /dev/null +++ b/immich_carddav_sync/immich_client/models/metadata_search_dto.py @@ -0,0 +1,586 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.asset_order import AssetOrder +from ..models.asset_type_enum import AssetTypeEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MetadataSearchDto") + + +@_attrs_define +class MetadataSearchDto: + """ + Attributes: + checksum (Union[Unset, str]): + city (Union[None, Unset, str]): + country (Union[None, Unset, str]): + created_after (Union[Unset, datetime.datetime]): + created_before (Union[Unset, datetime.datetime]): + device_asset_id (Union[Unset, str]): + device_id (Union[Unset, str]): + encoded_video_path (Union[Unset, str]): + id (Union[Unset, UUID]): + is_archived (Union[Unset, bool]): + is_encoded (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_motion (Union[Unset, bool]): + is_not_in_album (Union[Unset, bool]): + is_offline (Union[Unset, bool]): + is_visible (Union[Unset, bool]): + lens_model (Union[None, Unset, str]): + library_id (Union[None, UUID, Unset]): + make (Union[Unset, str]): + model (Union[None, Unset, str]): + order (Union[Unset, AssetOrder]): + original_file_name (Union[Unset, str]): + original_path (Union[Unset, str]): + page (Union[Unset, float]): + person_ids (Union[Unset, List[UUID]]): + preview_path (Union[Unset, str]): + size (Union[Unset, float]): + state (Union[None, Unset, str]): + taken_after (Union[Unset, datetime.datetime]): + taken_before (Union[Unset, datetime.datetime]): + thumbnail_path (Union[Unset, str]): + trashed_after (Union[Unset, datetime.datetime]): + trashed_before (Union[Unset, datetime.datetime]): + type (Union[Unset, AssetTypeEnum]): + updated_after (Union[Unset, datetime.datetime]): + updated_before (Union[Unset, datetime.datetime]): + with_archived (Union[Unset, bool]): Default: False. + with_deleted (Union[Unset, bool]): + with_exif (Union[Unset, bool]): + with_people (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + """ + + checksum: Union[Unset, str] = UNSET + city: Union[None, Unset, str] = UNSET + country: Union[None, Unset, str] = UNSET + created_after: Union[Unset, datetime.datetime] = UNSET + created_before: Union[Unset, datetime.datetime] = UNSET + device_asset_id: Union[Unset, str] = UNSET + device_id: Union[Unset, str] = UNSET + encoded_video_path: Union[Unset, str] = UNSET + id: Union[Unset, UUID] = UNSET + is_archived: Union[Unset, bool] = UNSET + is_encoded: Union[Unset, bool] = UNSET + is_favorite: Union[Unset, bool] = UNSET + is_motion: Union[Unset, bool] = UNSET + is_not_in_album: Union[Unset, bool] = UNSET + is_offline: Union[Unset, bool] = UNSET + is_visible: Union[Unset, bool] = UNSET + lens_model: Union[None, Unset, str] = UNSET + library_id: Union[None, UUID, Unset] = UNSET + make: Union[Unset, str] = UNSET + model: Union[None, Unset, str] = UNSET + order: Union[Unset, AssetOrder] = UNSET + original_file_name: Union[Unset, str] = UNSET + original_path: Union[Unset, str] = UNSET + page: Union[Unset, float] = UNSET + person_ids: Union[Unset, List[UUID]] = UNSET + preview_path: Union[Unset, str] = UNSET + size: Union[Unset, float] = UNSET + state: Union[None, Unset, str] = UNSET + taken_after: Union[Unset, datetime.datetime] = UNSET + taken_before: Union[Unset, datetime.datetime] = UNSET + thumbnail_path: Union[Unset, str] = UNSET + trashed_after: Union[Unset, datetime.datetime] = UNSET + trashed_before: Union[Unset, datetime.datetime] = UNSET + type: Union[Unset, AssetTypeEnum] = UNSET + updated_after: Union[Unset, datetime.datetime] = UNSET + updated_before: Union[Unset, datetime.datetime] = UNSET + with_archived: Union[Unset, bool] = False + with_deleted: Union[Unset, bool] = UNSET + with_exif: Union[Unset, bool] = UNSET + with_people: Union[Unset, bool] = UNSET + with_stacked: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + checksum = self.checksum + + city: Union[None, Unset, str] + if isinstance(self.city, Unset): + city = UNSET + else: + city = self.city + + country: Union[None, Unset, str] + if isinstance(self.country, Unset): + country = UNSET + else: + country = self.country + + created_after: Union[Unset, str] = UNSET + if not isinstance(self.created_after, Unset): + created_after = self.created_after.isoformat() + + created_before: Union[Unset, str] = UNSET + if not isinstance(self.created_before, Unset): + created_before = self.created_before.isoformat() + + device_asset_id = self.device_asset_id + + device_id = self.device_id + + encoded_video_path = self.encoded_video_path + + id: Union[Unset, str] = UNSET + if not isinstance(self.id, Unset): + id = str(self.id) + + is_archived = self.is_archived + + is_encoded = self.is_encoded + + is_favorite = self.is_favorite + + is_motion = self.is_motion + + is_not_in_album = self.is_not_in_album + + is_offline = self.is_offline + + is_visible = self.is_visible + + lens_model: Union[None, Unset, str] + if isinstance(self.lens_model, Unset): + lens_model = UNSET + else: + lens_model = self.lens_model + + library_id: Union[None, Unset, str] + if isinstance(self.library_id, Unset): + library_id = UNSET + elif isinstance(self.library_id, UUID): + library_id = str(self.library_id) + else: + library_id = self.library_id + + make = self.make + + model: Union[None, Unset, str] + if isinstance(self.model, Unset): + model = UNSET + else: + model = self.model + + order: Union[Unset, str] = UNSET + if not isinstance(self.order, Unset): + order = self.order.value + + original_file_name = self.original_file_name + + original_path = self.original_path + + page = self.page + + person_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.person_ids, Unset): + person_ids = [] + for person_ids_item_data in self.person_ids: + person_ids_item = str(person_ids_item_data) + person_ids.append(person_ids_item) + + preview_path = self.preview_path + + size = self.size + + state: Union[None, Unset, str] + if isinstance(self.state, Unset): + state = UNSET + else: + state = self.state + + taken_after: Union[Unset, str] = UNSET + if not isinstance(self.taken_after, Unset): + taken_after = self.taken_after.isoformat() + + taken_before: Union[Unset, str] = UNSET + if not isinstance(self.taken_before, Unset): + taken_before = self.taken_before.isoformat() + + thumbnail_path = self.thumbnail_path + + trashed_after: Union[Unset, str] = UNSET + if not isinstance(self.trashed_after, Unset): + trashed_after = self.trashed_after.isoformat() + + trashed_before: Union[Unset, str] = UNSET + if not isinstance(self.trashed_before, Unset): + trashed_before = self.trashed_before.isoformat() + + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + updated_after: Union[Unset, str] = UNSET + if not isinstance(self.updated_after, Unset): + updated_after = self.updated_after.isoformat() + + updated_before: Union[Unset, str] = UNSET + if not isinstance(self.updated_before, Unset): + updated_before = self.updated_before.isoformat() + + with_archived = self.with_archived + + with_deleted = self.with_deleted + + with_exif = self.with_exif + + with_people = self.with_people + + with_stacked = self.with_stacked + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if checksum is not UNSET: + field_dict["checksum"] = checksum + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if created_after is not UNSET: + field_dict["createdAfter"] = created_after + if created_before is not UNSET: + field_dict["createdBefore"] = created_before + if device_asset_id is not UNSET: + field_dict["deviceAssetId"] = device_asset_id + if device_id is not UNSET: + field_dict["deviceId"] = device_id + if encoded_video_path is not UNSET: + field_dict["encodedVideoPath"] = encoded_video_path + if id is not UNSET: + field_dict["id"] = id + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if is_encoded is not UNSET: + field_dict["isEncoded"] = is_encoded + if is_favorite is not UNSET: + field_dict["isFavorite"] = is_favorite + if is_motion is not UNSET: + field_dict["isMotion"] = is_motion + if is_not_in_album is not UNSET: + field_dict["isNotInAlbum"] = is_not_in_album + if is_offline is not UNSET: + field_dict["isOffline"] = is_offline + if is_visible is not UNSET: + field_dict["isVisible"] = is_visible + if lens_model is not UNSET: + field_dict["lensModel"] = lens_model + if library_id is not UNSET: + field_dict["libraryId"] = library_id + if make is not UNSET: + field_dict["make"] = make + if model is not UNSET: + field_dict["model"] = model + if order is not UNSET: + field_dict["order"] = order + if original_file_name is not UNSET: + field_dict["originalFileName"] = original_file_name + if original_path is not UNSET: + field_dict["originalPath"] = original_path + if page is not UNSET: + field_dict["page"] = page + if person_ids is not UNSET: + field_dict["personIds"] = person_ids + if preview_path is not UNSET: + field_dict["previewPath"] = preview_path + if size is not UNSET: + field_dict["size"] = size + if state is not UNSET: + field_dict["state"] = state + if taken_after is not UNSET: + field_dict["takenAfter"] = taken_after + if taken_before is not UNSET: + field_dict["takenBefore"] = taken_before + if thumbnail_path is not UNSET: + field_dict["thumbnailPath"] = thumbnail_path + if trashed_after is not UNSET: + field_dict["trashedAfter"] = trashed_after + if trashed_before is not UNSET: + field_dict["trashedBefore"] = trashed_before + if type is not UNSET: + field_dict["type"] = type + if updated_after is not UNSET: + field_dict["updatedAfter"] = updated_after + if updated_before is not UNSET: + field_dict["updatedBefore"] = updated_before + if with_archived is not UNSET: + field_dict["withArchived"] = with_archived + if with_deleted is not UNSET: + field_dict["withDeleted"] = with_deleted + if with_exif is not UNSET: + field_dict["withExif"] = with_exif + if with_people is not UNSET: + field_dict["withPeople"] = with_people + if with_stacked is not UNSET: + field_dict["withStacked"] = with_stacked + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + checksum = d.pop("checksum", UNSET) + + def _parse_city(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + city = _parse_city(d.pop("city", UNSET)) + + def _parse_country(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + country = _parse_country(d.pop("country", UNSET)) + + _created_after = d.pop("createdAfter", UNSET) + created_after: Union[Unset, datetime.datetime] + if isinstance(_created_after, Unset): + created_after = UNSET + else: + created_after = isoparse(_created_after) + + _created_before = d.pop("createdBefore", UNSET) + created_before: Union[Unset, datetime.datetime] + if isinstance(_created_before, Unset): + created_before = UNSET + else: + created_before = isoparse(_created_before) + + device_asset_id = d.pop("deviceAssetId", UNSET) + + device_id = d.pop("deviceId", UNSET) + + encoded_video_path = d.pop("encodedVideoPath", UNSET) + + _id = d.pop("id", UNSET) + id: Union[Unset, UUID] + if isinstance(_id, Unset): + id = UNSET + else: + id = UUID(_id) + + is_archived = d.pop("isArchived", UNSET) + + is_encoded = d.pop("isEncoded", UNSET) + + is_favorite = d.pop("isFavorite", UNSET) + + is_motion = d.pop("isMotion", UNSET) + + is_not_in_album = d.pop("isNotInAlbum", UNSET) + + is_offline = d.pop("isOffline", UNSET) + + is_visible = d.pop("isVisible", UNSET) + + def _parse_lens_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + lens_model = _parse_lens_model(d.pop("lensModel", UNSET)) + + def _parse_library_id(data: object) -> Union[None, UUID, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + library_id_type_0 = UUID(data) + + return library_id_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + library_id = _parse_library_id(d.pop("libraryId", UNSET)) + + make = d.pop("make", UNSET) + + def _parse_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + model = _parse_model(d.pop("model", UNSET)) + + _order = d.pop("order", UNSET) + order: Union[Unset, AssetOrder] + if isinstance(_order, Unset): + order = UNSET + else: + order = AssetOrder(_order) + + original_file_name = d.pop("originalFileName", UNSET) + + original_path = d.pop("originalPath", UNSET) + + page = d.pop("page", UNSET) + + person_ids = [] + _person_ids = d.pop("personIds", UNSET) + for person_ids_item_data in _person_ids or []: + person_ids_item = UUID(person_ids_item_data) + + person_ids.append(person_ids_item) + + preview_path = d.pop("previewPath", UNSET) + + size = d.pop("size", UNSET) + + def _parse_state(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + state = _parse_state(d.pop("state", UNSET)) + + _taken_after = d.pop("takenAfter", UNSET) + taken_after: Union[Unset, datetime.datetime] + if isinstance(_taken_after, Unset): + taken_after = UNSET + else: + taken_after = isoparse(_taken_after) + + _taken_before = d.pop("takenBefore", UNSET) + taken_before: Union[Unset, datetime.datetime] + if isinstance(_taken_before, Unset): + taken_before = UNSET + else: + taken_before = isoparse(_taken_before) + + thumbnail_path = d.pop("thumbnailPath", UNSET) + + _trashed_after = d.pop("trashedAfter", UNSET) + trashed_after: Union[Unset, datetime.datetime] + if isinstance(_trashed_after, Unset): + trashed_after = UNSET + else: + trashed_after = isoparse(_trashed_after) + + _trashed_before = d.pop("trashedBefore", UNSET) + trashed_before: Union[Unset, datetime.datetime] + if isinstance(_trashed_before, Unset): + trashed_before = UNSET + else: + trashed_before = isoparse(_trashed_before) + + _type = d.pop("type", UNSET) + type: Union[Unset, AssetTypeEnum] + if isinstance(_type, Unset): + type = UNSET + else: + type = AssetTypeEnum(_type) + + _updated_after = d.pop("updatedAfter", UNSET) + updated_after: Union[Unset, datetime.datetime] + if isinstance(_updated_after, Unset): + updated_after = UNSET + else: + updated_after = isoparse(_updated_after) + + _updated_before = d.pop("updatedBefore", UNSET) + updated_before: Union[Unset, datetime.datetime] + if isinstance(_updated_before, Unset): + updated_before = UNSET + else: + updated_before = isoparse(_updated_before) + + with_archived = d.pop("withArchived", UNSET) + + with_deleted = d.pop("withDeleted", UNSET) + + with_exif = d.pop("withExif", UNSET) + + with_people = d.pop("withPeople", UNSET) + + with_stacked = d.pop("withStacked", UNSET) + + metadata_search_dto = cls( + checksum=checksum, + city=city, + country=country, + created_after=created_after, + created_before=created_before, + device_asset_id=device_asset_id, + device_id=device_id, + encoded_video_path=encoded_video_path, + id=id, + is_archived=is_archived, + is_encoded=is_encoded, + is_favorite=is_favorite, + is_motion=is_motion, + is_not_in_album=is_not_in_album, + is_offline=is_offline, + is_visible=is_visible, + lens_model=lens_model, + library_id=library_id, + make=make, + model=model, + order=order, + original_file_name=original_file_name, + original_path=original_path, + page=page, + person_ids=person_ids, + preview_path=preview_path, + size=size, + state=state, + taken_after=taken_after, + taken_before=taken_before, + thumbnail_path=thumbnail_path, + trashed_after=trashed_after, + trashed_before=trashed_before, + type=type, + updated_after=updated_after, + updated_before=updated_before, + with_archived=with_archived, + with_deleted=with_deleted, + with_exif=with_exif, + with_people=with_people, + with_stacked=with_stacked, + ) + + metadata_search_dto.additional_properties = d + return metadata_search_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/on_this_day_dto.py b/immich_carddav_sync/immich_client/models/on_this_day_dto.py new file mode 100644 index 0000000..d9f857e --- /dev/null +++ b/immich_carddav_sync/immich_client/models/on_this_day_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OnThisDayDto") + + +@_attrs_define +class OnThisDayDto: + """ + Attributes: + year (float): + """ + + year: float + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + year = self.year + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "year": year, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + year = d.pop("year") + + on_this_day_dto = cls( + year=year, + ) + + on_this_day_dto.additional_properties = d + return on_this_day_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/partner_direction.py b/immich_carddav_sync/immich_client/models/partner_direction.py new file mode 100644 index 0000000..805ccbb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/partner_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class PartnerDirection(str, Enum): + SHARED_BY = "shared-by" + SHARED_WITH = "shared-with" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/people_response.py b/immich_carddav_sync/immich_client/models/people_response.py new file mode 100644 index 0000000..5d9408e --- /dev/null +++ b/immich_carddav_sync/immich_client/models/people_response.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PeopleResponse") + + +@_attrs_define +class PeopleResponse: + """ + Attributes: + enabled (bool): Default: True. + sidebar_web (bool): Default: False. + """ + + enabled: bool = True + sidebar_web: bool = False + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "sidebarWeb": sidebar_web, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + sidebar_web = d.pop("sidebarWeb") + + people_response = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + people_response.additional_properties = d + return people_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/people_update.py b/immich_carddav_sync/immich_client/models/people_update.py new file mode 100644 index 0000000..e084dc4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/people_update.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PeopleUpdate") + + +@_attrs_define +class PeopleUpdate: + """ + Attributes: + enabled (Union[Unset, bool]): + sidebar_web (Union[Unset, bool]): + """ + + enabled: Union[Unset, bool] = UNSET + sidebar_web: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if sidebar_web is not UNSET: + field_dict["sidebarWeb"] = sidebar_web + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled", UNSET) + + sidebar_web = d.pop("sidebarWeb", UNSET) + + people_update = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + people_update.additional_properties = d + return people_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/permission.py b/immich_carddav_sync/immich_client/models/permission.py new file mode 100644 index 0000000..a59a93d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/permission.py @@ -0,0 +1,85 @@ +from enum import Enum + + +class Permission(str, Enum): + ACTIVITY_CREATE = "activity.create" + ACTIVITY_DELETE = "activity.delete" + ACTIVITY_READ = "activity.read" + ACTIVITY_STATISTICS = "activity.statistics" + ACTIVITY_UPDATE = "activity.update" + ADMIN_USER_CREATE = "admin.user.create" + ADMIN_USER_DELETE = "admin.user.delete" + ADMIN_USER_READ = "admin.user.read" + ADMIN_USER_UPDATE = "admin.user.update" + ALBUM_ADDASSET = "album.addAsset" + ALBUM_CREATE = "album.create" + ALBUM_DELETE = "album.delete" + ALBUM_DOWNLOAD = "album.download" + ALBUM_READ = "album.read" + ALBUM_REMOVEASSET = "album.removeAsset" + ALBUM_SHARE = "album.share" + ALBUM_STATISTICS = "album.statistics" + ALBUM_UPDATE = "album.update" + ALL = "all" + APIKEY_CREATE = "apiKey.create" + APIKEY_DELETE = "apiKey.delete" + APIKEY_READ = "apiKey.read" + APIKEY_UPDATE = "apiKey.update" + ARCHIVE_READ = "archive.read" + ASSET_DELETE = "asset.delete" + ASSET_DOWNLOAD = "asset.download" + ASSET_READ = "asset.read" + ASSET_SHARE = "asset.share" + ASSET_UPDATE = "asset.update" + ASSET_UPLOAD = "asset.upload" + ASSET_VIEW = "asset.view" + AUTHDEVICE_DELETE = "authDevice.delete" + FACE_CREATE = "face.create" + FACE_DELETE = "face.delete" + FACE_READ = "face.read" + FACE_UPDATE = "face.update" + LIBRARY_CREATE = "library.create" + LIBRARY_DELETE = "library.delete" + LIBRARY_READ = "library.read" + LIBRARY_STATISTICS = "library.statistics" + LIBRARY_UPDATE = "library.update" + MEMORY_CREATE = "memory.create" + MEMORY_DELETE = "memory.delete" + MEMORY_READ = "memory.read" + MEMORY_UPDATE = "memory.update" + PARTNER_CREATE = "partner.create" + PARTNER_DELETE = "partner.delete" + PARTNER_READ = "partner.read" + PARTNER_UPDATE = "partner.update" + PERSON_CREATE = "person.create" + PERSON_DELETE = "person.delete" + PERSON_MERGE = "person.merge" + PERSON_READ = "person.read" + PERSON_REASSIGN = "person.reassign" + PERSON_STATISTICS = "person.statistics" + PERSON_UPDATE = "person.update" + SESSION_DELETE = "session.delete" + SESSION_READ = "session.read" + SESSION_UPDATE = "session.update" + SHAREDLINK_CREATE = "sharedLink.create" + SHAREDLINK_DELETE = "sharedLink.delete" + SHAREDLINK_READ = "sharedLink.read" + SHAREDLINK_UPDATE = "sharedLink.update" + STACK_CREATE = "stack.create" + STACK_DELETE = "stack.delete" + STACK_READ = "stack.read" + STACK_UPDATE = "stack.update" + SYSTEMCONFIG_READ = "systemConfig.read" + SYSTEMCONFIG_UPDATE = "systemConfig.update" + SYSTEMMETADATA_READ = "systemMetadata.read" + SYSTEMMETADATA_UPDATE = "systemMetadata.update" + TAG_ASSET = "tag.asset" + TAG_CREATE = "tag.create" + TAG_DELETE = "tag.delete" + TAG_READ = "tag.read" + TAG_UPDATE = "tag.update" + TIMELINE_DOWNLOAD = "timeline.download" + TIMELINE_READ = "timeline.read" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/person_create_dto.py b/immich_carddav_sync/immich_client/models/person_create_dto.py new file mode 100644 index 0000000..dfa3c51 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/person_create_dto.py @@ -0,0 +1,101 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PersonCreateDto") + + +@_attrs_define +class PersonCreateDto: + """ + Attributes: + birth_date (Union[None, Unset, datetime.date]): Person date of birth. + Note: the mobile app cannot currently set the birth date to null. + is_hidden (Union[Unset, bool]): Person visibility + name (Union[Unset, str]): Person name. + """ + + birth_date: Union[None, Unset, datetime.date] = UNSET + is_hidden: Union[Unset, bool] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + birth_date: Union[None, Unset, str] + if isinstance(self.birth_date, Unset): + birth_date = UNSET + elif isinstance(self.birth_date, datetime.date): + birth_date = self.birth_date.isoformat() + else: + birth_date = self.birth_date + + is_hidden = self.is_hidden + + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if birth_date is not UNSET: + field_dict["birthDate"] = birth_date + if is_hidden is not UNSET: + field_dict["isHidden"] = is_hidden + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_birth_date(data: object) -> Union[None, Unset, datetime.date]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + birth_date_type_0 = isoparse(data).date() + + return birth_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.date], data) + + birth_date = _parse_birth_date(d.pop("birthDate", UNSET)) + + is_hidden = d.pop("isHidden", UNSET) + + name = d.pop("name", UNSET) + + person_create_dto = cls( + birth_date=birth_date, + is_hidden=is_hidden, + name=name, + ) + + person_create_dto.additional_properties = d + return person_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/places_response_dto.py b/immich_carddav_sync/immich_client/models/places_response_dto.py new file mode 100644 index 0000000..d835785 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/places_response_dto.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PlacesResponseDto") + + +@_attrs_define +class PlacesResponseDto: + """ + Attributes: + latitude (float): + longitude (float): + name (str): + admin1name (Union[Unset, str]): + admin2name (Union[Unset, str]): + """ + + latitude: float + longitude: float + name: str + admin1name: Union[Unset, str] = UNSET + admin2name: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + latitude = self.latitude + + longitude = self.longitude + + name = self.name + + admin1name = self.admin1name + + admin2name = self.admin2name + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "latitude": latitude, + "longitude": longitude, + "name": name, + } + ) + if admin1name is not UNSET: + field_dict["admin1name"] = admin1name + if admin2name is not UNSET: + field_dict["admin2name"] = admin2name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + latitude = d.pop("latitude") + + longitude = d.pop("longitude") + + name = d.pop("name") + + admin1name = d.pop("admin1name", UNSET) + + admin2name = d.pop("admin2name", UNSET) + + places_response_dto = cls( + latitude=latitude, + longitude=longitude, + name=name, + admin1name=admin1name, + admin2name=admin2name, + ) + + places_response_dto.additional_properties = d + return places_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/purchase_response.py b/immich_carddav_sync/immich_client/models/purchase_response.py new file mode 100644 index 0000000..02364d2 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/purchase_response.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PurchaseResponse") + + +@_attrs_define +class PurchaseResponse: + """ + Attributes: + hide_buy_button_until (str): + show_support_badge (bool): + """ + + hide_buy_button_until: str + show_support_badge: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + hide_buy_button_until = self.hide_buy_button_until + + show_support_badge = self.show_support_badge + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "hideBuyButtonUntil": hide_buy_button_until, + "showSupportBadge": show_support_badge, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + hide_buy_button_until = d.pop("hideBuyButtonUntil") + + show_support_badge = d.pop("showSupportBadge") + + purchase_response = cls( + hide_buy_button_until=hide_buy_button_until, + show_support_badge=show_support_badge, + ) + + purchase_response.additional_properties = d + return purchase_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/purchase_update.py b/immich_carddav_sync/immich_client/models/purchase_update.py new file mode 100644 index 0000000..c18c9b8 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/purchase_update.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PurchaseUpdate") + + +@_attrs_define +class PurchaseUpdate: + """ + Attributes: + hide_buy_button_until (Union[Unset, str]): + show_support_badge (Union[Unset, bool]): + """ + + hide_buy_button_until: Union[Unset, str] = UNSET + show_support_badge: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + hide_buy_button_until = self.hide_buy_button_until + + show_support_badge = self.show_support_badge + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if hide_buy_button_until is not UNSET: + field_dict["hideBuyButtonUntil"] = hide_buy_button_until + if show_support_badge is not UNSET: + field_dict["showSupportBadge"] = show_support_badge + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + hide_buy_button_until = d.pop("hideBuyButtonUntil", UNSET) + + show_support_badge = d.pop("showSupportBadge", UNSET) + + purchase_update = cls( + hide_buy_button_until=hide_buy_button_until, + show_support_badge=show_support_badge, + ) + + purchase_update.additional_properties = d + return purchase_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/random_search_dto.py b/immich_carddav_sync/immich_client/models/random_search_dto.py new file mode 100644 index 0000000..9c95d26 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/random_search_dto.py @@ -0,0 +1,482 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.asset_type_enum import AssetTypeEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RandomSearchDto") + + +@_attrs_define +class RandomSearchDto: + """ + Attributes: + city (Union[None, Unset, str]): + country (Union[None, Unset, str]): + created_after (Union[Unset, datetime.datetime]): + created_before (Union[Unset, datetime.datetime]): + device_id (Union[Unset, str]): + is_archived (Union[Unset, bool]): + is_encoded (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_motion (Union[Unset, bool]): + is_not_in_album (Union[Unset, bool]): + is_offline (Union[Unset, bool]): + is_visible (Union[Unset, bool]): + lens_model (Union[None, Unset, str]): + library_id (Union[None, UUID, Unset]): + make (Union[Unset, str]): + model (Union[None, Unset, str]): + person_ids (Union[Unset, List[UUID]]): + size (Union[Unset, float]): + state (Union[None, Unset, str]): + taken_after (Union[Unset, datetime.datetime]): + taken_before (Union[Unset, datetime.datetime]): + trashed_after (Union[Unset, datetime.datetime]): + trashed_before (Union[Unset, datetime.datetime]): + type (Union[Unset, AssetTypeEnum]): + updated_after (Union[Unset, datetime.datetime]): + updated_before (Union[Unset, datetime.datetime]): + with_archived (Union[Unset, bool]): Default: False. + with_deleted (Union[Unset, bool]): + with_exif (Union[Unset, bool]): + with_people (Union[Unset, bool]): + with_stacked (Union[Unset, bool]): + """ + + city: Union[None, Unset, str] = UNSET + country: Union[None, Unset, str] = UNSET + created_after: Union[Unset, datetime.datetime] = UNSET + created_before: Union[Unset, datetime.datetime] = UNSET + device_id: Union[Unset, str] = UNSET + is_archived: Union[Unset, bool] = UNSET + is_encoded: Union[Unset, bool] = UNSET + is_favorite: Union[Unset, bool] = UNSET + is_motion: Union[Unset, bool] = UNSET + is_not_in_album: Union[Unset, bool] = UNSET + is_offline: Union[Unset, bool] = UNSET + is_visible: Union[Unset, bool] = UNSET + lens_model: Union[None, Unset, str] = UNSET + library_id: Union[None, UUID, Unset] = UNSET + make: Union[Unset, str] = UNSET + model: Union[None, Unset, str] = UNSET + person_ids: Union[Unset, List[UUID]] = UNSET + size: Union[Unset, float] = UNSET + state: Union[None, Unset, str] = UNSET + taken_after: Union[Unset, datetime.datetime] = UNSET + taken_before: Union[Unset, datetime.datetime] = UNSET + trashed_after: Union[Unset, datetime.datetime] = UNSET + trashed_before: Union[Unset, datetime.datetime] = UNSET + type: Union[Unset, AssetTypeEnum] = UNSET + updated_after: Union[Unset, datetime.datetime] = UNSET + updated_before: Union[Unset, datetime.datetime] = UNSET + with_archived: Union[Unset, bool] = False + with_deleted: Union[Unset, bool] = UNSET + with_exif: Union[Unset, bool] = UNSET + with_people: Union[Unset, bool] = UNSET + with_stacked: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + city: Union[None, Unset, str] + if isinstance(self.city, Unset): + city = UNSET + else: + city = self.city + + country: Union[None, Unset, str] + if isinstance(self.country, Unset): + country = UNSET + else: + country = self.country + + created_after: Union[Unset, str] = UNSET + if not isinstance(self.created_after, Unset): + created_after = self.created_after.isoformat() + + created_before: Union[Unset, str] = UNSET + if not isinstance(self.created_before, Unset): + created_before = self.created_before.isoformat() + + device_id = self.device_id + + is_archived = self.is_archived + + is_encoded = self.is_encoded + + is_favorite = self.is_favorite + + is_motion = self.is_motion + + is_not_in_album = self.is_not_in_album + + is_offline = self.is_offline + + is_visible = self.is_visible + + lens_model: Union[None, Unset, str] + if isinstance(self.lens_model, Unset): + lens_model = UNSET + else: + lens_model = self.lens_model + + library_id: Union[None, Unset, str] + if isinstance(self.library_id, Unset): + library_id = UNSET + elif isinstance(self.library_id, UUID): + library_id = str(self.library_id) + else: + library_id = self.library_id + + make = self.make + + model: Union[None, Unset, str] + if isinstance(self.model, Unset): + model = UNSET + else: + model = self.model + + person_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.person_ids, Unset): + person_ids = [] + for person_ids_item_data in self.person_ids: + person_ids_item = str(person_ids_item_data) + person_ids.append(person_ids_item) + + size = self.size + + state: Union[None, Unset, str] + if isinstance(self.state, Unset): + state = UNSET + else: + state = self.state + + taken_after: Union[Unset, str] = UNSET + if not isinstance(self.taken_after, Unset): + taken_after = self.taken_after.isoformat() + + taken_before: Union[Unset, str] = UNSET + if not isinstance(self.taken_before, Unset): + taken_before = self.taken_before.isoformat() + + trashed_after: Union[Unset, str] = UNSET + if not isinstance(self.trashed_after, Unset): + trashed_after = self.trashed_after.isoformat() + + trashed_before: Union[Unset, str] = UNSET + if not isinstance(self.trashed_before, Unset): + trashed_before = self.trashed_before.isoformat() + + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + updated_after: Union[Unset, str] = UNSET + if not isinstance(self.updated_after, Unset): + updated_after = self.updated_after.isoformat() + + updated_before: Union[Unset, str] = UNSET + if not isinstance(self.updated_before, Unset): + updated_before = self.updated_before.isoformat() + + with_archived = self.with_archived + + with_deleted = self.with_deleted + + with_exif = self.with_exif + + with_people = self.with_people + + with_stacked = self.with_stacked + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if created_after is not UNSET: + field_dict["createdAfter"] = created_after + if created_before is not UNSET: + field_dict["createdBefore"] = created_before + if device_id is not UNSET: + field_dict["deviceId"] = device_id + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if is_encoded is not UNSET: + field_dict["isEncoded"] = is_encoded + if is_favorite is not UNSET: + field_dict["isFavorite"] = is_favorite + if is_motion is not UNSET: + field_dict["isMotion"] = is_motion + if is_not_in_album is not UNSET: + field_dict["isNotInAlbum"] = is_not_in_album + if is_offline is not UNSET: + field_dict["isOffline"] = is_offline + if is_visible is not UNSET: + field_dict["isVisible"] = is_visible + if lens_model is not UNSET: + field_dict["lensModel"] = lens_model + if library_id is not UNSET: + field_dict["libraryId"] = library_id + if make is not UNSET: + field_dict["make"] = make + if model is not UNSET: + field_dict["model"] = model + if person_ids is not UNSET: + field_dict["personIds"] = person_ids + if size is not UNSET: + field_dict["size"] = size + if state is not UNSET: + field_dict["state"] = state + if taken_after is not UNSET: + field_dict["takenAfter"] = taken_after + if taken_before is not UNSET: + field_dict["takenBefore"] = taken_before + if trashed_after is not UNSET: + field_dict["trashedAfter"] = trashed_after + if trashed_before is not UNSET: + field_dict["trashedBefore"] = trashed_before + if type is not UNSET: + field_dict["type"] = type + if updated_after is not UNSET: + field_dict["updatedAfter"] = updated_after + if updated_before is not UNSET: + field_dict["updatedBefore"] = updated_before + if with_archived is not UNSET: + field_dict["withArchived"] = with_archived + if with_deleted is not UNSET: + field_dict["withDeleted"] = with_deleted + if with_exif is not UNSET: + field_dict["withExif"] = with_exif + if with_people is not UNSET: + field_dict["withPeople"] = with_people + if with_stacked is not UNSET: + field_dict["withStacked"] = with_stacked + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_city(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + city = _parse_city(d.pop("city", UNSET)) + + def _parse_country(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + country = _parse_country(d.pop("country", UNSET)) + + _created_after = d.pop("createdAfter", UNSET) + created_after: Union[Unset, datetime.datetime] + if isinstance(_created_after, Unset): + created_after = UNSET + else: + created_after = isoparse(_created_after) + + _created_before = d.pop("createdBefore", UNSET) + created_before: Union[Unset, datetime.datetime] + if isinstance(_created_before, Unset): + created_before = UNSET + else: + created_before = isoparse(_created_before) + + device_id = d.pop("deviceId", UNSET) + + is_archived = d.pop("isArchived", UNSET) + + is_encoded = d.pop("isEncoded", UNSET) + + is_favorite = d.pop("isFavorite", UNSET) + + is_motion = d.pop("isMotion", UNSET) + + is_not_in_album = d.pop("isNotInAlbum", UNSET) + + is_offline = d.pop("isOffline", UNSET) + + is_visible = d.pop("isVisible", UNSET) + + def _parse_lens_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + lens_model = _parse_lens_model(d.pop("lensModel", UNSET)) + + def _parse_library_id(data: object) -> Union[None, UUID, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + library_id_type_0 = UUID(data) + + return library_id_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + library_id = _parse_library_id(d.pop("libraryId", UNSET)) + + make = d.pop("make", UNSET) + + def _parse_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + model = _parse_model(d.pop("model", UNSET)) + + person_ids = [] + _person_ids = d.pop("personIds", UNSET) + for person_ids_item_data in _person_ids or []: + person_ids_item = UUID(person_ids_item_data) + + person_ids.append(person_ids_item) + + size = d.pop("size", UNSET) + + def _parse_state(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + state = _parse_state(d.pop("state", UNSET)) + + _taken_after = d.pop("takenAfter", UNSET) + taken_after: Union[Unset, datetime.datetime] + if isinstance(_taken_after, Unset): + taken_after = UNSET + else: + taken_after = isoparse(_taken_after) + + _taken_before = d.pop("takenBefore", UNSET) + taken_before: Union[Unset, datetime.datetime] + if isinstance(_taken_before, Unset): + taken_before = UNSET + else: + taken_before = isoparse(_taken_before) + + _trashed_after = d.pop("trashedAfter", UNSET) + trashed_after: Union[Unset, datetime.datetime] + if isinstance(_trashed_after, Unset): + trashed_after = UNSET + else: + trashed_after = isoparse(_trashed_after) + + _trashed_before = d.pop("trashedBefore", UNSET) + trashed_before: Union[Unset, datetime.datetime] + if isinstance(_trashed_before, Unset): + trashed_before = UNSET + else: + trashed_before = isoparse(_trashed_before) + + _type = d.pop("type", UNSET) + type: Union[Unset, AssetTypeEnum] + if isinstance(_type, Unset): + type = UNSET + else: + type = AssetTypeEnum(_type) + + _updated_after = d.pop("updatedAfter", UNSET) + updated_after: Union[Unset, datetime.datetime] + if isinstance(_updated_after, Unset): + updated_after = UNSET + else: + updated_after = isoparse(_updated_after) + + _updated_before = d.pop("updatedBefore", UNSET) + updated_before: Union[Unset, datetime.datetime] + if isinstance(_updated_before, Unset): + updated_before = UNSET + else: + updated_before = isoparse(_updated_before) + + with_archived = d.pop("withArchived", UNSET) + + with_deleted = d.pop("withDeleted", UNSET) + + with_exif = d.pop("withExif", UNSET) + + with_people = d.pop("withPeople", UNSET) + + with_stacked = d.pop("withStacked", UNSET) + + random_search_dto = cls( + city=city, + country=country, + created_after=created_after, + created_before=created_before, + device_id=device_id, + is_archived=is_archived, + is_encoded=is_encoded, + is_favorite=is_favorite, + is_motion=is_motion, + is_not_in_album=is_not_in_album, + is_offline=is_offline, + is_visible=is_visible, + lens_model=lens_model, + library_id=library_id, + make=make, + model=model, + person_ids=person_ids, + size=size, + state=state, + taken_after=taken_after, + taken_before=taken_before, + trashed_after=trashed_after, + trashed_before=trashed_before, + type=type, + updated_after=updated_after, + updated_before=updated_before, + with_archived=with_archived, + with_deleted=with_deleted, + with_exif=with_exif, + with_people=with_people, + with_stacked=with_stacked, + ) + + random_search_dto.additional_properties = d + return random_search_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/ratings_response.py b/immich_carddav_sync/immich_client/models/ratings_response.py new file mode 100644 index 0000000..3c0e448 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/ratings_response.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RatingsResponse") + + +@_attrs_define +class RatingsResponse: + """ + Attributes: + enabled (bool): Default: False. + """ + + enabled: bool = False + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + ratings_response = cls( + enabled=enabled, + ) + + ratings_response.additional_properties = d + return ratings_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/ratings_update.py b/immich_carddav_sync/immich_client/models/ratings_update.py new file mode 100644 index 0000000..7e3864b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/ratings_update.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RatingsUpdate") + + +@_attrs_define +class RatingsUpdate: + """ + Attributes: + enabled (Union[Unset, bool]): + """ + + enabled: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled", UNSET) + + ratings_update = cls( + enabled=enabled, + ) + + ratings_update.additional_properties = d + return ratings_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/reverse_geocoding_state_response_dto.py b/immich_carddav_sync/immich_client/models/reverse_geocoding_state_response_dto.py new file mode 100644 index 0000000..74cc69d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/reverse_geocoding_state_response_dto.py @@ -0,0 +1,79 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ReverseGeocodingStateResponseDto") + + +@_attrs_define +class ReverseGeocodingStateResponseDto: + """ + Attributes: + last_import_file_name (Union[None, str]): + last_update (Union[None, str]): + """ + + last_import_file_name: Union[None, str] + last_update: Union[None, str] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + last_import_file_name: Union[None, str] + last_import_file_name = self.last_import_file_name + + last_update: Union[None, str] + last_update = self.last_update + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "lastImportFileName": last_import_file_name, + "lastUpdate": last_update, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_last_import_file_name(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + last_import_file_name = _parse_last_import_file_name(d.pop("lastImportFileName")) + + def _parse_last_update(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + last_update = _parse_last_update(d.pop("lastUpdate")) + + reverse_geocoding_state_response_dto = cls( + last_import_file_name=last_import_file_name, + last_update=last_update, + ) + + reverse_geocoding_state_response_dto.additional_properties = d + return reverse_geocoding_state_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/search_suggestion_type.py b/immich_carddav_sync/immich_client/models/search_suggestion_type.py new file mode 100644 index 0000000..ed3b2fb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/search_suggestion_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class SearchSuggestionType(str, Enum): + CAMERA_MAKE = "camera-make" + CAMERA_MODEL = "camera-model" + CITY = "city" + COUNTRY = "country" + STATE = "state" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/server_about_response_dto.py b/immich_carddav_sync/immich_client/models/server_about_response_dto.py new file mode 100644 index 0000000..640429d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/server_about_response_dto.py @@ -0,0 +1,238 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServerAboutResponseDto") + + +@_attrs_define +class ServerAboutResponseDto: + """ + Attributes: + licensed (bool): + version (str): + version_url (str): + build (Union[Unset, str]): + build_image (Union[Unset, str]): + build_image_url (Union[Unset, str]): + build_url (Union[Unset, str]): + exiftool (Union[Unset, str]): + ffmpeg (Union[Unset, str]): + imagemagick (Union[Unset, str]): + libvips (Union[Unset, str]): + nodejs (Union[Unset, str]): + repository (Union[Unset, str]): + repository_url (Union[Unset, str]): + source_commit (Union[Unset, str]): + source_ref (Union[Unset, str]): + source_url (Union[Unset, str]): + third_party_bug_feature_url (Union[Unset, str]): + third_party_documentation_url (Union[Unset, str]): + third_party_source_url (Union[Unset, str]): + third_party_support_url (Union[Unset, str]): + """ + + licensed: bool + version: str + version_url: str + build: Union[Unset, str] = UNSET + build_image: Union[Unset, str] = UNSET + build_image_url: Union[Unset, str] = UNSET + build_url: Union[Unset, str] = UNSET + exiftool: Union[Unset, str] = UNSET + ffmpeg: Union[Unset, str] = UNSET + imagemagick: Union[Unset, str] = UNSET + libvips: Union[Unset, str] = UNSET + nodejs: Union[Unset, str] = UNSET + repository: Union[Unset, str] = UNSET + repository_url: Union[Unset, str] = UNSET + source_commit: Union[Unset, str] = UNSET + source_ref: Union[Unset, str] = UNSET + source_url: Union[Unset, str] = UNSET + third_party_bug_feature_url: Union[Unset, str] = UNSET + third_party_documentation_url: Union[Unset, str] = UNSET + third_party_source_url: Union[Unset, str] = UNSET + third_party_support_url: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + licensed = self.licensed + + version = self.version + + version_url = self.version_url + + build = self.build + + build_image = self.build_image + + build_image_url = self.build_image_url + + build_url = self.build_url + + exiftool = self.exiftool + + ffmpeg = self.ffmpeg + + imagemagick = self.imagemagick + + libvips = self.libvips + + nodejs = self.nodejs + + repository = self.repository + + repository_url = self.repository_url + + source_commit = self.source_commit + + source_ref = self.source_ref + + source_url = self.source_url + + third_party_bug_feature_url = self.third_party_bug_feature_url + + third_party_documentation_url = self.third_party_documentation_url + + third_party_source_url = self.third_party_source_url + + third_party_support_url = self.third_party_support_url + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "licensed": licensed, + "version": version, + "versionUrl": version_url, + } + ) + if build is not UNSET: + field_dict["build"] = build + if build_image is not UNSET: + field_dict["buildImage"] = build_image + if build_image_url is not UNSET: + field_dict["buildImageUrl"] = build_image_url + if build_url is not UNSET: + field_dict["buildUrl"] = build_url + if exiftool is not UNSET: + field_dict["exiftool"] = exiftool + if ffmpeg is not UNSET: + field_dict["ffmpeg"] = ffmpeg + if imagemagick is not UNSET: + field_dict["imagemagick"] = imagemagick + if libvips is not UNSET: + field_dict["libvips"] = libvips + if nodejs is not UNSET: + field_dict["nodejs"] = nodejs + if repository is not UNSET: + field_dict["repository"] = repository + if repository_url is not UNSET: + field_dict["repositoryUrl"] = repository_url + if source_commit is not UNSET: + field_dict["sourceCommit"] = source_commit + if source_ref is not UNSET: + field_dict["sourceRef"] = source_ref + if source_url is not UNSET: + field_dict["sourceUrl"] = source_url + if third_party_bug_feature_url is not UNSET: + field_dict["thirdPartyBugFeatureUrl"] = third_party_bug_feature_url + if third_party_documentation_url is not UNSET: + field_dict["thirdPartyDocumentationUrl"] = third_party_documentation_url + if third_party_source_url is not UNSET: + field_dict["thirdPartySourceUrl"] = third_party_source_url + if third_party_support_url is not UNSET: + field_dict["thirdPartySupportUrl"] = third_party_support_url + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + licensed = d.pop("licensed") + + version = d.pop("version") + + version_url = d.pop("versionUrl") + + build = d.pop("build", UNSET) + + build_image = d.pop("buildImage", UNSET) + + build_image_url = d.pop("buildImageUrl", UNSET) + + build_url = d.pop("buildUrl", UNSET) + + exiftool = d.pop("exiftool", UNSET) + + ffmpeg = d.pop("ffmpeg", UNSET) + + imagemagick = d.pop("imagemagick", UNSET) + + libvips = d.pop("libvips", UNSET) + + nodejs = d.pop("nodejs", UNSET) + + repository = d.pop("repository", UNSET) + + repository_url = d.pop("repositoryUrl", UNSET) + + source_commit = d.pop("sourceCommit", UNSET) + + source_ref = d.pop("sourceRef", UNSET) + + source_url = d.pop("sourceUrl", UNSET) + + third_party_bug_feature_url = d.pop("thirdPartyBugFeatureUrl", UNSET) + + third_party_documentation_url = d.pop("thirdPartyDocumentationUrl", UNSET) + + third_party_source_url = d.pop("thirdPartySourceUrl", UNSET) + + third_party_support_url = d.pop("thirdPartySupportUrl", UNSET) + + server_about_response_dto = cls( + licensed=licensed, + version=version, + version_url=version_url, + build=build, + build_image=build_image, + build_image_url=build_image_url, + build_url=build_url, + exiftool=exiftool, + ffmpeg=ffmpeg, + imagemagick=imagemagick, + libvips=libvips, + nodejs=nodejs, + repository=repository, + repository_url=repository_url, + source_commit=source_commit, + source_ref=source_ref, + source_url=source_url, + third_party_bug_feature_url=third_party_bug_feature_url, + third_party_documentation_url=third_party_documentation_url, + third_party_source_url=third_party_source_url, + third_party_support_url=third_party_support_url, + ) + + server_about_response_dto.additional_properties = d + return server_about_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/server_storage_response_dto.py b/immich_carddav_sync/immich_client/models/server_storage_response_dto.py new file mode 100644 index 0000000..668eaad --- /dev/null +++ b/immich_carddav_sync/immich_client/models/server_storage_response_dto.py @@ -0,0 +1,106 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ServerStorageResponseDto") + + +@_attrs_define +class ServerStorageResponseDto: + """ + Attributes: + disk_available (str): + disk_available_raw (int): + disk_size (str): + disk_size_raw (int): + disk_usage_percentage (float): + disk_use (str): + disk_use_raw (int): + """ + + disk_available: str + disk_available_raw: int + disk_size: str + disk_size_raw: int + disk_usage_percentage: float + disk_use: str + disk_use_raw: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + disk_available = self.disk_available + + disk_available_raw = self.disk_available_raw + + disk_size = self.disk_size + + disk_size_raw = self.disk_size_raw + + disk_usage_percentage = self.disk_usage_percentage + + disk_use = self.disk_use + + disk_use_raw = self.disk_use_raw + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "diskAvailable": disk_available, + "diskAvailableRaw": disk_available_raw, + "diskSize": disk_size, + "diskSizeRaw": disk_size_raw, + "diskUsagePercentage": disk_usage_percentage, + "diskUse": disk_use, + "diskUseRaw": disk_use_raw, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + disk_available = d.pop("diskAvailable") + + disk_available_raw = d.pop("diskAvailableRaw") + + disk_size = d.pop("diskSize") + + disk_size_raw = d.pop("diskSizeRaw") + + disk_usage_percentage = d.pop("diskUsagePercentage") + + disk_use = d.pop("diskUse") + + disk_use_raw = d.pop("diskUseRaw") + + server_storage_response_dto = cls( + disk_available=disk_available, + disk_available_raw=disk_available_raw, + disk_size=disk_size, + disk_size_raw=disk_size_raw, + disk_usage_percentage=disk_usage_percentage, + disk_use=disk_use, + disk_use_raw=disk_use_raw, + ) + + server_storage_response_dto.additional_properties = d + return server_storage_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/server_version_history_response_dto.py b/immich_carddav_sync/immich_client/models/server_version_history_response_dto.py new file mode 100644 index 0000000..4a85003 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/server_version_history_response_dto.py @@ -0,0 +1,76 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="ServerVersionHistoryResponseDto") + + +@_attrs_define +class ServerVersionHistoryResponseDto: + """ + Attributes: + created_at (datetime.datetime): + id (str): + version (str): + """ + + created_at: datetime.datetime + id: str + version: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + created_at = self.created_at.isoformat() + + id = self.id + + version = self.version + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "createdAt": created_at, + "id": id, + "version": version, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + created_at = isoparse(d.pop("createdAt")) + + id = d.pop("id") + + version = d.pop("version") + + server_version_history_response_dto = cls( + created_at=created_at, + id=id, + version=version, + ) + + server_version_history_response_dto.additional_properties = d + return server_version_history_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/session_response_dto.py b/immich_carddav_sync/immich_client/models/session_response_dto.py new file mode 100644 index 0000000..bdf6f99 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/session_response_dto.py @@ -0,0 +1,98 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SessionResponseDto") + + +@_attrs_define +class SessionResponseDto: + """ + Attributes: + created_at (str): + current (bool): + device_os (str): + device_type (str): + id (str): + updated_at (str): + """ + + created_at: str + current: bool + device_os: str + device_type: str + id: str + updated_at: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + created_at = self.created_at + + current = self.current + + device_os = self.device_os + + device_type = self.device_type + + id = self.id + + updated_at = self.updated_at + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "createdAt": created_at, + "current": current, + "deviceOS": device_os, + "deviceType": device_type, + "id": id, + "updatedAt": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + created_at = d.pop("createdAt") + + current = d.pop("current") + + device_os = d.pop("deviceOS") + + device_type = d.pop("deviceType") + + id = d.pop("id") + + updated_at = d.pop("updatedAt") + + session_response_dto = cls( + created_at=created_at, + current=current, + device_os=device_os, + device_type=device_type, + id=id, + updated_at=updated_at, + ) + + session_response_dto.additional_properties = d + return session_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/smart_search_dto.py b/immich_carddav_sync/immich_client/models/smart_search_dto.py new file mode 100644 index 0000000..c993b7a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/smart_search_dto.py @@ -0,0 +1,483 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.asset_type_enum import AssetTypeEnum +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SmartSearchDto") + + +@_attrs_define +class SmartSearchDto: + """ + Attributes: + query (str): + city (Union[None, Unset, str]): + country (Union[None, Unset, str]): + created_after (Union[Unset, datetime.datetime]): + created_before (Union[Unset, datetime.datetime]): + device_id (Union[Unset, str]): + is_archived (Union[Unset, bool]): + is_encoded (Union[Unset, bool]): + is_favorite (Union[Unset, bool]): + is_motion (Union[Unset, bool]): + is_not_in_album (Union[Unset, bool]): + is_offline (Union[Unset, bool]): + is_visible (Union[Unset, bool]): + lens_model (Union[None, Unset, str]): + library_id (Union[None, UUID, Unset]): + make (Union[Unset, str]): + model (Union[None, Unset, str]): + page (Union[Unset, float]): + person_ids (Union[Unset, List[UUID]]): + size (Union[Unset, float]): + state (Union[None, Unset, str]): + taken_after (Union[Unset, datetime.datetime]): + taken_before (Union[Unset, datetime.datetime]): + trashed_after (Union[Unset, datetime.datetime]): + trashed_before (Union[Unset, datetime.datetime]): + type (Union[Unset, AssetTypeEnum]): + updated_after (Union[Unset, datetime.datetime]): + updated_before (Union[Unset, datetime.datetime]): + with_archived (Union[Unset, bool]): Default: False. + with_deleted (Union[Unset, bool]): + with_exif (Union[Unset, bool]): + """ + + query: str + city: Union[None, Unset, str] = UNSET + country: Union[None, Unset, str] = UNSET + created_after: Union[Unset, datetime.datetime] = UNSET + created_before: Union[Unset, datetime.datetime] = UNSET + device_id: Union[Unset, str] = UNSET + is_archived: Union[Unset, bool] = UNSET + is_encoded: Union[Unset, bool] = UNSET + is_favorite: Union[Unset, bool] = UNSET + is_motion: Union[Unset, bool] = UNSET + is_not_in_album: Union[Unset, bool] = UNSET + is_offline: Union[Unset, bool] = UNSET + is_visible: Union[Unset, bool] = UNSET + lens_model: Union[None, Unset, str] = UNSET + library_id: Union[None, UUID, Unset] = UNSET + make: Union[Unset, str] = UNSET + model: Union[None, Unset, str] = UNSET + page: Union[Unset, float] = UNSET + person_ids: Union[Unset, List[UUID]] = UNSET + size: Union[Unset, float] = UNSET + state: Union[None, Unset, str] = UNSET + taken_after: Union[Unset, datetime.datetime] = UNSET + taken_before: Union[Unset, datetime.datetime] = UNSET + trashed_after: Union[Unset, datetime.datetime] = UNSET + trashed_before: Union[Unset, datetime.datetime] = UNSET + type: Union[Unset, AssetTypeEnum] = UNSET + updated_after: Union[Unset, datetime.datetime] = UNSET + updated_before: Union[Unset, datetime.datetime] = UNSET + with_archived: Union[Unset, bool] = False + with_deleted: Union[Unset, bool] = UNSET + with_exif: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + query = self.query + + city: Union[None, Unset, str] + if isinstance(self.city, Unset): + city = UNSET + else: + city = self.city + + country: Union[None, Unset, str] + if isinstance(self.country, Unset): + country = UNSET + else: + country = self.country + + created_after: Union[Unset, str] = UNSET + if not isinstance(self.created_after, Unset): + created_after = self.created_after.isoformat() + + created_before: Union[Unset, str] = UNSET + if not isinstance(self.created_before, Unset): + created_before = self.created_before.isoformat() + + device_id = self.device_id + + is_archived = self.is_archived + + is_encoded = self.is_encoded + + is_favorite = self.is_favorite + + is_motion = self.is_motion + + is_not_in_album = self.is_not_in_album + + is_offline = self.is_offline + + is_visible = self.is_visible + + lens_model: Union[None, Unset, str] + if isinstance(self.lens_model, Unset): + lens_model = UNSET + else: + lens_model = self.lens_model + + library_id: Union[None, Unset, str] + if isinstance(self.library_id, Unset): + library_id = UNSET + elif isinstance(self.library_id, UUID): + library_id = str(self.library_id) + else: + library_id = self.library_id + + make = self.make + + model: Union[None, Unset, str] + if isinstance(self.model, Unset): + model = UNSET + else: + model = self.model + + page = self.page + + person_ids: Union[Unset, List[str]] = UNSET + if not isinstance(self.person_ids, Unset): + person_ids = [] + for person_ids_item_data in self.person_ids: + person_ids_item = str(person_ids_item_data) + person_ids.append(person_ids_item) + + size = self.size + + state: Union[None, Unset, str] + if isinstance(self.state, Unset): + state = UNSET + else: + state = self.state + + taken_after: Union[Unset, str] = UNSET + if not isinstance(self.taken_after, Unset): + taken_after = self.taken_after.isoformat() + + taken_before: Union[Unset, str] = UNSET + if not isinstance(self.taken_before, Unset): + taken_before = self.taken_before.isoformat() + + trashed_after: Union[Unset, str] = UNSET + if not isinstance(self.trashed_after, Unset): + trashed_after = self.trashed_after.isoformat() + + trashed_before: Union[Unset, str] = UNSET + if not isinstance(self.trashed_before, Unset): + trashed_before = self.trashed_before.isoformat() + + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + updated_after: Union[Unset, str] = UNSET + if not isinstance(self.updated_after, Unset): + updated_after = self.updated_after.isoformat() + + updated_before: Union[Unset, str] = UNSET + if not isinstance(self.updated_before, Unset): + updated_before = self.updated_before.isoformat() + + with_archived = self.with_archived + + with_deleted = self.with_deleted + + with_exif = self.with_exif + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "query": query, + } + ) + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if created_after is not UNSET: + field_dict["createdAfter"] = created_after + if created_before is not UNSET: + field_dict["createdBefore"] = created_before + if device_id is not UNSET: + field_dict["deviceId"] = device_id + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if is_encoded is not UNSET: + field_dict["isEncoded"] = is_encoded + if is_favorite is not UNSET: + field_dict["isFavorite"] = is_favorite + if is_motion is not UNSET: + field_dict["isMotion"] = is_motion + if is_not_in_album is not UNSET: + field_dict["isNotInAlbum"] = is_not_in_album + if is_offline is not UNSET: + field_dict["isOffline"] = is_offline + if is_visible is not UNSET: + field_dict["isVisible"] = is_visible + if lens_model is not UNSET: + field_dict["lensModel"] = lens_model + if library_id is not UNSET: + field_dict["libraryId"] = library_id + if make is not UNSET: + field_dict["make"] = make + if model is not UNSET: + field_dict["model"] = model + if page is not UNSET: + field_dict["page"] = page + if person_ids is not UNSET: + field_dict["personIds"] = person_ids + if size is not UNSET: + field_dict["size"] = size + if state is not UNSET: + field_dict["state"] = state + if taken_after is not UNSET: + field_dict["takenAfter"] = taken_after + if taken_before is not UNSET: + field_dict["takenBefore"] = taken_before + if trashed_after is not UNSET: + field_dict["trashedAfter"] = trashed_after + if trashed_before is not UNSET: + field_dict["trashedBefore"] = trashed_before + if type is not UNSET: + field_dict["type"] = type + if updated_after is not UNSET: + field_dict["updatedAfter"] = updated_after + if updated_before is not UNSET: + field_dict["updatedBefore"] = updated_before + if with_archived is not UNSET: + field_dict["withArchived"] = with_archived + if with_deleted is not UNSET: + field_dict["withDeleted"] = with_deleted + if with_exif is not UNSET: + field_dict["withExif"] = with_exif + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + query = d.pop("query") + + def _parse_city(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + city = _parse_city(d.pop("city", UNSET)) + + def _parse_country(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + country = _parse_country(d.pop("country", UNSET)) + + _created_after = d.pop("createdAfter", UNSET) + created_after: Union[Unset, datetime.datetime] + if isinstance(_created_after, Unset): + created_after = UNSET + else: + created_after = isoparse(_created_after) + + _created_before = d.pop("createdBefore", UNSET) + created_before: Union[Unset, datetime.datetime] + if isinstance(_created_before, Unset): + created_before = UNSET + else: + created_before = isoparse(_created_before) + + device_id = d.pop("deviceId", UNSET) + + is_archived = d.pop("isArchived", UNSET) + + is_encoded = d.pop("isEncoded", UNSET) + + is_favorite = d.pop("isFavorite", UNSET) + + is_motion = d.pop("isMotion", UNSET) + + is_not_in_album = d.pop("isNotInAlbum", UNSET) + + is_offline = d.pop("isOffline", UNSET) + + is_visible = d.pop("isVisible", UNSET) + + def _parse_lens_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + lens_model = _parse_lens_model(d.pop("lensModel", UNSET)) + + def _parse_library_id(data: object) -> Union[None, UUID, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + library_id_type_0 = UUID(data) + + return library_id_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + library_id = _parse_library_id(d.pop("libraryId", UNSET)) + + make = d.pop("make", UNSET) + + def _parse_model(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + model = _parse_model(d.pop("model", UNSET)) + + page = d.pop("page", UNSET) + + person_ids = [] + _person_ids = d.pop("personIds", UNSET) + for person_ids_item_data in _person_ids or []: + person_ids_item = UUID(person_ids_item_data) + + person_ids.append(person_ids_item) + + size = d.pop("size", UNSET) + + def _parse_state(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + state = _parse_state(d.pop("state", UNSET)) + + _taken_after = d.pop("takenAfter", UNSET) + taken_after: Union[Unset, datetime.datetime] + if isinstance(_taken_after, Unset): + taken_after = UNSET + else: + taken_after = isoparse(_taken_after) + + _taken_before = d.pop("takenBefore", UNSET) + taken_before: Union[Unset, datetime.datetime] + if isinstance(_taken_before, Unset): + taken_before = UNSET + else: + taken_before = isoparse(_taken_before) + + _trashed_after = d.pop("trashedAfter", UNSET) + trashed_after: Union[Unset, datetime.datetime] + if isinstance(_trashed_after, Unset): + trashed_after = UNSET + else: + trashed_after = isoparse(_trashed_after) + + _trashed_before = d.pop("trashedBefore", UNSET) + trashed_before: Union[Unset, datetime.datetime] + if isinstance(_trashed_before, Unset): + trashed_before = UNSET + else: + trashed_before = isoparse(_trashed_before) + + _type = d.pop("type", UNSET) + type: Union[Unset, AssetTypeEnum] + if isinstance(_type, Unset): + type = UNSET + else: + type = AssetTypeEnum(_type) + + _updated_after = d.pop("updatedAfter", UNSET) + updated_after: Union[Unset, datetime.datetime] + if isinstance(_updated_after, Unset): + updated_after = UNSET + else: + updated_after = isoparse(_updated_after) + + _updated_before = d.pop("updatedBefore", UNSET) + updated_before: Union[Unset, datetime.datetime] + if isinstance(_updated_before, Unset): + updated_before = UNSET + else: + updated_before = isoparse(_updated_before) + + with_archived = d.pop("withArchived", UNSET) + + with_deleted = d.pop("withDeleted", UNSET) + + with_exif = d.pop("withExif", UNSET) + + smart_search_dto = cls( + query=query, + city=city, + country=country, + created_after=created_after, + created_before=created_before, + device_id=device_id, + is_archived=is_archived, + is_encoded=is_encoded, + is_favorite=is_favorite, + is_motion=is_motion, + is_not_in_album=is_not_in_album, + is_offline=is_offline, + is_visible=is_visible, + lens_model=lens_model, + library_id=library_id, + make=make, + model=model, + page=page, + person_ids=person_ids, + size=size, + state=state, + taken_after=taken_after, + taken_before=taken_before, + trashed_after=trashed_after, + trashed_before=trashed_before, + type=type, + updated_after=updated_after, + updated_before=updated_before, + with_archived=with_archived, + with_deleted=with_deleted, + with_exif=with_exif, + ) + + smart_search_dto.additional_properties = d + return smart_search_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/source_type.py b/immich_carddav_sync/immich_client/models/source_type.py new file mode 100644 index 0000000..6b2eacd --- /dev/null +++ b/immich_carddav_sync/immich_client/models/source_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class SourceType(str, Enum): + EXIF = "exif" + MACHINE_LEARNING = "machine-learning" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/stack_create_dto.py b/immich_carddav_sync/immich_client/models/stack_create_dto.py new file mode 100644 index 0000000..04d8b28 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/stack_create_dto.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="StackCreateDto") + + +@_attrs_define +class StackCreateDto: + """ + Attributes: + asset_ids (List[UUID]): first asset becomes the primary + """ + + asset_ids: List[UUID] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_ids = [] + for asset_ids_item_data in self.asset_ids: + asset_ids_item = str(asset_ids_item_data) + asset_ids.append(asset_ids_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetIds": asset_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + asset_ids = [] + _asset_ids = d.pop("assetIds") + for asset_ids_item_data in _asset_ids: + asset_ids_item = UUID(asset_ids_item_data) + + asset_ids.append(asset_ids_item) + + stack_create_dto = cls( + asset_ids=asset_ids, + ) + + stack_create_dto.additional_properties = d + return stack_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/stack_response_dto.py b/immich_carddav_sync/immich_client/models/stack_response_dto.py new file mode 100644 index 0000000..5038713 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/stack_response_dto.py @@ -0,0 +1,88 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.asset_response_dto import AssetResponseDto + + +T = TypeVar("T", bound="StackResponseDto") + + +@_attrs_define +class StackResponseDto: + """ + Attributes: + assets (List['AssetResponseDto']): + id (str): + primary_asset_id (str): + """ + + assets: List["AssetResponseDto"] + id: str + primary_asset_id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + assets = [] + for assets_item_data in self.assets: + assets_item = assets_item_data.to_dict() + assets.append(assets_item) + + id = self.id + + primary_asset_id = self.primary_asset_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assets": assets, + "id": id, + "primaryAssetId": primary_asset_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_response_dto import AssetResponseDto + + d = src_dict.copy() + assets = [] + _assets = d.pop("assets") + for assets_item_data in _assets: + assets_item = AssetResponseDto.from_dict(assets_item_data) + + assets.append(assets_item) + + id = d.pop("id") + + primary_asset_id = d.pop("primaryAssetId") + + stack_response_dto = cls( + assets=assets, + id=id, + primary_asset_id=primary_asset_id, + ) + + stack_response_dto.additional_properties = d + return stack_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/stack_update_dto.py b/immich_carddav_sync/immich_client/models/stack_update_dto.py new file mode 100644 index 0000000..0d5b38f --- /dev/null +++ b/immich_carddav_sync/immich_client/models/stack_update_dto.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar, Union +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StackUpdateDto") + + +@_attrs_define +class StackUpdateDto: + """ + Attributes: + primary_asset_id (Union[Unset, UUID]): + """ + + primary_asset_id: Union[Unset, UUID] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + primary_asset_id: Union[Unset, str] = UNSET + if not isinstance(self.primary_asset_id, Unset): + primary_asset_id = str(self.primary_asset_id) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if primary_asset_id is not UNSET: + field_dict["primaryAssetId"] = primary_asset_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _primary_asset_id = d.pop("primaryAssetId", UNSET) + primary_asset_id: Union[Unset, UUID] + if isinstance(_primary_asset_id, Unset): + primary_asset_id = UNSET + else: + primary_asset_id = UUID(_primary_asset_id) + + stack_update_dto = cls( + primary_asset_id=primary_asset_id, + ) + + stack_update_dto.additional_properties = d + return stack_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_faces_dto.py b/immich_carddav_sync/immich_client/models/system_config_faces_dto.py new file mode 100644 index 0000000..182c139 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_faces_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SystemConfigFacesDto") + + +@_attrs_define +class SystemConfigFacesDto: + """ + Attributes: + import_ (bool): + """ + + import_: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + import_ = self.import_ + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "import": import_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + import_ = d.pop("import") + + system_config_faces_dto = cls( + import_=import_, + ) + + system_config_faces_dto.additional_properties = d + return system_config_faces_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_generated_image_dto.py b/immich_carddav_sync/immich_client/models/system_config_generated_image_dto.py new file mode 100644 index 0000000..28b1312 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_generated_image_dto.py @@ -0,0 +1,76 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.image_format import ImageFormat + +T = TypeVar("T", bound="SystemConfigGeneratedImageDto") + + +@_attrs_define +class SystemConfigGeneratedImageDto: + """ + Attributes: + format_ (ImageFormat): + quality (int): + size (int): + """ + + format_: ImageFormat + quality: int + size: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + format_ = self.format_.value + + quality = self.quality + + size = self.size + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "format": format_, + "quality": quality, + "size": size, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + format_ = ImageFormat(d.pop("format")) + + quality = d.pop("quality") + + size = d.pop("size") + + system_config_generated_image_dto = cls( + format_=format_, + quality=quality, + size=size, + ) + + system_config_generated_image_dto.additional_properties = d + return system_config_generated_image_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_image_dto.py b/immich_carddav_sync/immich_client/models/system_config_image_dto.py new file mode 100644 index 0000000..30eeb1c --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_image_dto.py @@ -0,0 +1,90 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.colorspace import Colorspace + +if TYPE_CHECKING: + from ..models.system_config_generated_image_dto import SystemConfigGeneratedImageDto + + +T = TypeVar("T", bound="SystemConfigImageDto") + + +@_attrs_define +class SystemConfigImageDto: + """ + Attributes: + colorspace (Colorspace): + extract_embedded (bool): + preview (SystemConfigGeneratedImageDto): + thumbnail (SystemConfigGeneratedImageDto): + """ + + colorspace: Colorspace + extract_embedded: bool + preview: "SystemConfigGeneratedImageDto" + thumbnail: "SystemConfigGeneratedImageDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + colorspace = self.colorspace.value + + extract_embedded = self.extract_embedded + + preview = self.preview.to_dict() + + thumbnail = self.thumbnail.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "colorspace": colorspace, + "extractEmbedded": extract_embedded, + "preview": preview, + "thumbnail": thumbnail, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.system_config_generated_image_dto import SystemConfigGeneratedImageDto + + d = src_dict.copy() + colorspace = Colorspace(d.pop("colorspace")) + + extract_embedded = d.pop("extractEmbedded") + + preview = SystemConfigGeneratedImageDto.from_dict(d.pop("preview")) + + thumbnail = SystemConfigGeneratedImageDto.from_dict(d.pop("thumbnail")) + + system_config_image_dto = cls( + colorspace=colorspace, + extract_embedded=extract_embedded, + preview=preview, + thumbnail=thumbnail, + ) + + system_config_image_dto.additional_properties = d + return system_config_image_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_library_watch_dto.py b/immich_carddav_sync/immich_client/models/system_config_library_watch_dto.py new file mode 100644 index 0000000..22ff9f0 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_library_watch_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SystemConfigLibraryWatchDto") + + +@_attrs_define +class SystemConfigLibraryWatchDto: + """ + Attributes: + enabled (bool): + """ + + enabled: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + system_config_library_watch_dto = cls( + enabled=enabled, + ) + + system_config_library_watch_dto.additional_properties = d + return system_config_library_watch_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_metadata_dto.py b/immich_carddav_sync/immich_client/models/system_config_metadata_dto.py new file mode 100644 index 0000000..49c6b2b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_metadata_dto.py @@ -0,0 +1,64 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.system_config_faces_dto import SystemConfigFacesDto + + +T = TypeVar("T", bound="SystemConfigMetadataDto") + + +@_attrs_define +class SystemConfigMetadataDto: + """ + Attributes: + faces (SystemConfigFacesDto): + """ + + faces: "SystemConfigFacesDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + faces = self.faces.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "faces": faces, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.system_config_faces_dto import SystemConfigFacesDto + + d = src_dict.copy() + faces = SystemConfigFacesDto.from_dict(d.pop("faces")) + + system_config_metadata_dto = cls( + faces=faces, + ) + + system_config_metadata_dto.additional_properties = d + return system_config_metadata_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_notifications_dto.py b/immich_carddav_sync/immich_client/models/system_config_notifications_dto.py new file mode 100644 index 0000000..d88e782 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_notifications_dto.py @@ -0,0 +1,64 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.system_config_smtp_dto import SystemConfigSmtpDto + + +T = TypeVar("T", bound="SystemConfigNotificationsDto") + + +@_attrs_define +class SystemConfigNotificationsDto: + """ + Attributes: + smtp (SystemConfigSmtpDto): + """ + + smtp: "SystemConfigSmtpDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + smtp = self.smtp.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "smtp": smtp, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.system_config_smtp_dto import SystemConfigSmtpDto + + d = src_dict.copy() + smtp = SystemConfigSmtpDto.from_dict(d.pop("smtp")) + + system_config_notifications_dto = cls( + smtp=smtp, + ) + + system_config_notifications_dto.additional_properties = d + return system_config_notifications_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_server_dto.py b/immich_carddav_sync/immich_client/models/system_config_server_dto.py new file mode 100644 index 0000000..8b6bed5 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_server_dto.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SystemConfigServerDto") + + +@_attrs_define +class SystemConfigServerDto: + """ + Attributes: + external_domain (str): + login_page_message (str): + """ + + external_domain: str + login_page_message: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + external_domain = self.external_domain + + login_page_message = self.login_page_message + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "externalDomain": external_domain, + "loginPageMessage": login_page_message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + external_domain = d.pop("externalDomain") + + login_page_message = d.pop("loginPageMessage") + + system_config_server_dto = cls( + external_domain=external_domain, + login_page_message=login_page_message, + ) + + system_config_server_dto.additional_properties = d + return system_config_server_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_smtp_dto.py b/immich_carddav_sync/immich_client/models/system_config_smtp_dto.py new file mode 100644 index 0000000..84bd633 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_smtp_dto.py @@ -0,0 +1,88 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.system_config_smtp_transport_dto import SystemConfigSmtpTransportDto + + +T = TypeVar("T", bound="SystemConfigSmtpDto") + + +@_attrs_define +class SystemConfigSmtpDto: + """ + Attributes: + enabled (bool): + from_ (str): + reply_to (str): + transport (SystemConfigSmtpTransportDto): + """ + + enabled: bool + from_: str + reply_to: str + transport: "SystemConfigSmtpTransportDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + from_ = self.from_ + + reply_to = self.reply_to + + transport = self.transport.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "from": from_, + "replyTo": reply_to, + "transport": transport, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.system_config_smtp_transport_dto import SystemConfigSmtpTransportDto + + d = src_dict.copy() + enabled = d.pop("enabled") + + from_ = d.pop("from") + + reply_to = d.pop("replyTo") + + transport = SystemConfigSmtpTransportDto.from_dict(d.pop("transport")) + + system_config_smtp_dto = cls( + enabled=enabled, + from_=from_, + reply_to=reply_to, + transport=transport, + ) + + system_config_smtp_dto.additional_properties = d + return system_config_smtp_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_smtp_transport_dto.py b/immich_carddav_sync/immich_client/models/system_config_smtp_transport_dto.py new file mode 100644 index 0000000..5ff6a28 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_smtp_transport_dto.py @@ -0,0 +1,90 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SystemConfigSmtpTransportDto") + + +@_attrs_define +class SystemConfigSmtpTransportDto: + """ + Attributes: + host (str): + ignore_cert (bool): + password (str): + port (float): + username (str): + """ + + host: str + ignore_cert: bool + password: str + port: float + username: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + host = self.host + + ignore_cert = self.ignore_cert + + password = self.password + + port = self.port + + username = self.username + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "host": host, + "ignoreCert": ignore_cert, + "password": password, + "port": port, + "username": username, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + host = d.pop("host") + + ignore_cert = d.pop("ignoreCert") + + password = d.pop("password") + + port = d.pop("port") + + username = d.pop("username") + + system_config_smtp_transport_dto = cls( + host=host, + ignore_cert=ignore_cert, + password=password, + port=port, + username=username, + ) + + system_config_smtp_transport_dto.additional_properties = d + return system_config_smtp_transport_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/system_config_user_dto.py b/immich_carddav_sync/immich_client/models/system_config_user_dto.py new file mode 100644 index 0000000..42cc4fb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_user_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SystemConfigUserDto") + + +@_attrs_define +class SystemConfigUserDto: + """ + Attributes: + delete_delay (int): + """ + + delete_delay: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + delete_delay = self.delete_delay + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deleteDelay": delete_delay, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + delete_delay = d.pop("deleteDelay") + + system_config_user_dto = cls( + delete_delay=delete_delay, + ) + + system_config_user_dto.additional_properties = d + return system_config_user_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tag_bulk_assets_dto.py b/immich_carddav_sync/immich_client/models/tag_bulk_assets_dto.py new file mode 100644 index 0000000..40324fb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tag_bulk_assets_dto.py @@ -0,0 +1,83 @@ +from typing import Any, Dict, List, Type, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TagBulkAssetsDto") + + +@_attrs_define +class TagBulkAssetsDto: + """ + Attributes: + asset_ids (List[UUID]): + tag_ids (List[UUID]): + """ + + asset_ids: List[UUID] + tag_ids: List[UUID] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_ids = [] + for asset_ids_item_data in self.asset_ids: + asset_ids_item = str(asset_ids_item_data) + asset_ids.append(asset_ids_item) + + tag_ids = [] + for tag_ids_item_data in self.tag_ids: + tag_ids_item = str(tag_ids_item_data) + tag_ids.append(tag_ids_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetIds": asset_ids, + "tagIds": tag_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + asset_ids = [] + _asset_ids = d.pop("assetIds") + for asset_ids_item_data in _asset_ids: + asset_ids_item = UUID(asset_ids_item_data) + + asset_ids.append(asset_ids_item) + + tag_ids = [] + _tag_ids = d.pop("tagIds") + for tag_ids_item_data in _tag_ids: + tag_ids_item = UUID(tag_ids_item_data) + + tag_ids.append(tag_ids_item) + + tag_bulk_assets_dto = cls( + asset_ids=asset_ids, + tag_ids=tag_ids, + ) + + tag_bulk_assets_dto.additional_properties = d + return tag_bulk_assets_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tag_bulk_assets_response_dto.py b/immich_carddav_sync/immich_client/models/tag_bulk_assets_response_dto.py new file mode 100644 index 0000000..b95b72a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tag_bulk_assets_response_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TagBulkAssetsResponseDto") + + +@_attrs_define +class TagBulkAssetsResponseDto: + """ + Attributes: + count (int): + """ + + count: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + count = d.pop("count") + + tag_bulk_assets_response_dto = cls( + count=count, + ) + + tag_bulk_assets_response_dto.additional_properties = d + return tag_bulk_assets_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tag_create_dto.py b/immich_carddav_sync/immich_client/models/tag_create_dto.py new file mode 100644 index 0000000..06c8cc6 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tag_create_dto.py @@ -0,0 +1,100 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TagCreateDto") + + +@_attrs_define +class TagCreateDto: + """ + Attributes: + name (str): + color (Union[Unset, str]): + parent_id (Union[None, UUID, Unset]): + """ + + name: str + color: Union[Unset, str] = UNSET + parent_id: Union[None, UUID, Unset] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name + + color = self.color + + parent_id: Union[None, Unset, str] + if isinstance(self.parent_id, Unset): + parent_id = UNSET + elif isinstance(self.parent_id, UUID): + parent_id = str(self.parent_id) + else: + parent_id = self.parent_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if color is not UNSET: + field_dict["color"] = color + if parent_id is not UNSET: + field_dict["parentId"] = parent_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + color = d.pop("color", UNSET) + + def _parse_parent_id(data: object) -> Union[None, UUID, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + parent_id_type_0 = UUID(data) + + return parent_id_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + parent_id = _parse_parent_id(d.pop("parentId", UNSET)) + + tag_create_dto = cls( + name=name, + color=color, + parent_id=parent_id, + ) + + tag_create_dto.additional_properties = d + return tag_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tag_update_dto.py b/immich_carddav_sync/immich_client/models/tag_update_dto.py new file mode 100644 index 0000000..0fd51ac --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tag_update_dto.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TagUpdateDto") + + +@_attrs_define +class TagUpdateDto: + """ + Attributes: + color (Union[None, Unset, str]): + """ + + color: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + color: Union[None, Unset, str] + if isinstance(self.color, Unset): + color = UNSET + else: + color = self.color + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if color is not UNSET: + field_dict["color"] = color + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + + def _parse_color(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + color = _parse_color(d.pop("color", UNSET)) + + tag_update_dto = cls( + color=color, + ) + + tag_update_dto.additional_properties = d + return tag_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tag_upsert_dto.py b/immich_carddav_sync/immich_client/models/tag_upsert_dto.py new file mode 100644 index 0000000..b7fa8c4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tag_upsert_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TagUpsertDto") + + +@_attrs_define +class TagUpsertDto: + """ + Attributes: + tags (List[str]): + """ + + tags: List[str] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + tags = self.tags + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tags": tags, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + tags = cast(List[str], d.pop("tags")) + + tag_upsert_dto = cls( + tags=tags, + ) + + tag_upsert_dto.additional_properties = d + return tag_upsert_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tags_response.py b/immich_carddav_sync/immich_client/models/tags_response.py new file mode 100644 index 0000000..c8d9385 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tags_response.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TagsResponse") + + +@_attrs_define +class TagsResponse: + """ + Attributes: + enabled (bool): Default: True. + sidebar_web (bool): Default: True. + """ + + enabled: bool = True + sidebar_web: bool = True + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "enabled": enabled, + "sidebarWeb": sidebar_web, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled") + + sidebar_web = d.pop("sidebarWeb") + + tags_response = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + tags_response.additional_properties = d + return tags_response + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/tags_update.py b/immich_carddav_sync/immich_client/models/tags_update.py new file mode 100644 index 0000000..28c15f4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/tags_update.py @@ -0,0 +1,67 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TagsUpdate") + + +@_attrs_define +class TagsUpdate: + """ + Attributes: + enabled (Union[Unset, bool]): + sidebar_web (Union[Unset, bool]): + """ + + enabled: Union[Unset, bool] = UNSET + sidebar_web: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + sidebar_web = self.sidebar_web + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if sidebar_web is not UNSET: + field_dict["sidebarWeb"] = sidebar_web + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + enabled = d.pop("enabled", UNSET) + + sidebar_web = d.pop("sidebarWeb", UNSET) + + tags_update = cls( + enabled=enabled, + sidebar_web=sidebar_web, + ) + + tags_update.additional_properties = d + return tags_update + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/test_email_response_dto.py b/immich_carddav_sync/immich_client/models/test_email_response_dto.py new file mode 100644 index 0000000..302b152 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/test_email_response_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TestEmailResponseDto") + + +@_attrs_define +class TestEmailResponseDto: + """ + Attributes: + message_id (str): + """ + + message_id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + message_id = self.message_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "messageId": message_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + message_id = d.pop("messageId") + + test_email_response_dto = cls( + message_id=message_id, + ) + + test_email_response_dto.additional_properties = d + return test_email_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/trash_response_dto.py b/immich_carddav_sync/immich_client/models/trash_response_dto.py new file mode 100644 index 0000000..afdccd0 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/trash_response_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TrashResponseDto") + + +@_attrs_define +class TrashResponseDto: + """ + Attributes: + count (int): + """ + + count: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "count": count, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + count = d.pop("count") + + trash_response_dto = cls( + count=count, + ) + + trash_response_dto.additional_properties = d + return trash_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/update_album_user_dto.py b/immich_carddav_sync/immich_client/models/update_album_user_dto.py new file mode 100644 index 0000000..9d98c43 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/update_album_user_dto.py @@ -0,0 +1,60 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.album_user_role import AlbumUserRole + +T = TypeVar("T", bound="UpdateAlbumUserDto") + + +@_attrs_define +class UpdateAlbumUserDto: + """ + Attributes: + role (AlbumUserRole): + """ + + role: AlbumUserRole + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + role = self.role.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "role": role, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + role = AlbumUserRole(d.pop("role")) + + update_album_user_dto = cls( + role=role, + ) + + update_album_user_dto.additional_properties = d + return update_album_user_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_admin_create_dto.py b/immich_carddav_sync/immich_client/models/user_admin_create_dto.py new file mode 100644 index 0000000..b62f8a4 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_admin_create_dto.py @@ -0,0 +1,134 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserAdminCreateDto") + + +@_attrs_define +class UserAdminCreateDto: + """ + Attributes: + email (str): + name (str): + password (str): + notify (Union[Unset, bool]): + quota_size_in_bytes (Union[None, Unset, int]): + should_change_password (Union[Unset, bool]): + storage_label (Union[None, Unset, str]): + """ + + email: str + name: str + password: str + notify: Union[Unset, bool] = UNSET + quota_size_in_bytes: Union[None, Unset, int] = UNSET + should_change_password: Union[Unset, bool] = UNSET + storage_label: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + email = self.email + + name = self.name + + password = self.password + + notify = self.notify + + quota_size_in_bytes: Union[None, Unset, int] + if isinstance(self.quota_size_in_bytes, Unset): + quota_size_in_bytes = UNSET + else: + quota_size_in_bytes = self.quota_size_in_bytes + + should_change_password = self.should_change_password + + storage_label: Union[None, Unset, str] + if isinstance(self.storage_label, Unset): + storage_label = UNSET + else: + storage_label = self.storage_label + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "email": email, + "name": name, + "password": password, + } + ) + if notify is not UNSET: + field_dict["notify"] = notify + if quota_size_in_bytes is not UNSET: + field_dict["quotaSizeInBytes"] = quota_size_in_bytes + if should_change_password is not UNSET: + field_dict["shouldChangePassword"] = should_change_password + if storage_label is not UNSET: + field_dict["storageLabel"] = storage_label + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + email = d.pop("email") + + name = d.pop("name") + + password = d.pop("password") + + notify = d.pop("notify", UNSET) + + def _parse_quota_size_in_bytes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + quota_size_in_bytes = _parse_quota_size_in_bytes(d.pop("quotaSizeInBytes", UNSET)) + + should_change_password = d.pop("shouldChangePassword", UNSET) + + def _parse_storage_label(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + storage_label = _parse_storage_label(d.pop("storageLabel", UNSET)) + + user_admin_create_dto = cls( + email=email, + name=name, + password=password, + notify=notify, + quota_size_in_bytes=quota_size_in_bytes, + should_change_password=should_change_password, + storage_label=storage_label, + ) + + user_admin_create_dto.additional_properties = d + return user_admin_create_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_admin_delete_dto.py b/immich_carddav_sync/immich_client/models/user_admin_delete_dto.py new file mode 100644 index 0000000..ba06325 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_admin_delete_dto.py @@ -0,0 +1,58 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserAdminDeleteDto") + + +@_attrs_define +class UserAdminDeleteDto: + """ + Attributes: + force (Union[Unset, bool]): + """ + + force: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + force = self.force + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if force is not UNSET: + field_dict["force"] = force + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + force = d.pop("force", UNSET) + + user_admin_delete_dto = cls( + force=force, + ) + + user_admin_delete_dto.additional_properties = d + return user_admin_delete_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_admin_response_dto.py b/immich_carddav_sync/immich_client/models/user_admin_response_dto.py new file mode 100644 index 0000000..01d3290 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_admin_response_dto.py @@ -0,0 +1,251 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.user_avatar_color import UserAvatarColor +from ..models.user_status import UserStatus + +if TYPE_CHECKING: + from ..models.user_license import UserLicense + + +T = TypeVar("T", bound="UserAdminResponseDto") + + +@_attrs_define +class UserAdminResponseDto: + """ + Attributes: + avatar_color (UserAvatarColor): + created_at (datetime.datetime): + deleted_at (Union[None, datetime.datetime]): + email (str): + id (str): + is_admin (bool): + license_ (Union['UserLicense', None]): + name (str): + oauth_id (str): + profile_changed_at (datetime.datetime): + profile_image_path (str): + quota_size_in_bytes (Union[None, int]): + quota_usage_in_bytes (Union[None, int]): + should_change_password (bool): + status (UserStatus): + storage_label (Union[None, str]): + updated_at (datetime.datetime): + """ + + avatar_color: UserAvatarColor + created_at: datetime.datetime + deleted_at: Union[None, datetime.datetime] + email: str + id: str + is_admin: bool + license_: Union["UserLicense", None] + name: str + oauth_id: str + profile_changed_at: datetime.datetime + profile_image_path: str + quota_size_in_bytes: Union[None, int] + quota_usage_in_bytes: Union[None, int] + should_change_password: bool + status: UserStatus + storage_label: Union[None, str] + updated_at: datetime.datetime + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.user_license import UserLicense + + avatar_color = self.avatar_color.value + + created_at = self.created_at.isoformat() + + deleted_at: Union[None, str] + if isinstance(self.deleted_at, datetime.datetime): + deleted_at = self.deleted_at.isoformat() + else: + deleted_at = self.deleted_at + + email = self.email + + id = self.id + + is_admin = self.is_admin + + license_: Union[Dict[str, Any], None] + if isinstance(self.license_, UserLicense): + license_ = self.license_.to_dict() + else: + license_ = self.license_ + + name = self.name + + oauth_id = self.oauth_id + + profile_changed_at = self.profile_changed_at.isoformat() + + profile_image_path = self.profile_image_path + + quota_size_in_bytes: Union[None, int] + quota_size_in_bytes = self.quota_size_in_bytes + + quota_usage_in_bytes: Union[None, int] + quota_usage_in_bytes = self.quota_usage_in_bytes + + should_change_password = self.should_change_password + + status = self.status.value + + storage_label: Union[None, str] + storage_label = self.storage_label + + updated_at = self.updated_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "avatarColor": avatar_color, + "createdAt": created_at, + "deletedAt": deleted_at, + "email": email, + "id": id, + "isAdmin": is_admin, + "license": license_, + "name": name, + "oauthId": oauth_id, + "profileChangedAt": profile_changed_at, + "profileImagePath": profile_image_path, + "quotaSizeInBytes": quota_size_in_bytes, + "quotaUsageInBytes": quota_usage_in_bytes, + "shouldChangePassword": should_change_password, + "status": status, + "storageLabel": storage_label, + "updatedAt": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.user_license import UserLicense + + d = src_dict.copy() + avatar_color = UserAvatarColor(d.pop("avatarColor")) + + created_at = isoparse(d.pop("createdAt")) + + def _parse_deleted_at(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + deleted_at_type_0 = isoparse(data) + + return deleted_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + deleted_at = _parse_deleted_at(d.pop("deletedAt")) + + email = d.pop("email") + + id = d.pop("id") + + is_admin = d.pop("isAdmin") + + def _parse_license_(data: object) -> Union["UserLicense", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + license_type_1 = UserLicense.from_dict(data) + + return license_type_1 + except: # noqa: E722 + pass + return cast(Union["UserLicense", None], data) + + license_ = _parse_license_(d.pop("license")) + + name = d.pop("name") + + oauth_id = d.pop("oauthId") + + profile_changed_at = isoparse(d.pop("profileChangedAt")) + + profile_image_path = d.pop("profileImagePath") + + def _parse_quota_size_in_bytes(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + quota_size_in_bytes = _parse_quota_size_in_bytes(d.pop("quotaSizeInBytes")) + + def _parse_quota_usage_in_bytes(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) + + quota_usage_in_bytes = _parse_quota_usage_in_bytes(d.pop("quotaUsageInBytes")) + + should_change_password = d.pop("shouldChangePassword") + + status = UserStatus(d.pop("status")) + + def _parse_storage_label(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + storage_label = _parse_storage_label(d.pop("storageLabel")) + + updated_at = isoparse(d.pop("updatedAt")) + + user_admin_response_dto = cls( + avatar_color=avatar_color, + created_at=created_at, + deleted_at=deleted_at, + email=email, + id=id, + is_admin=is_admin, + license_=license_, + name=name, + oauth_id=oauth_id, + profile_changed_at=profile_changed_at, + profile_image_path=profile_image_path, + quota_size_in_bytes=quota_size_in_bytes, + quota_usage_in_bytes=quota_usage_in_bytes, + should_change_password=should_change_password, + status=status, + storage_label=storage_label, + updated_at=updated_at, + ) + + user_admin_response_dto.additional_properties = d + return user_admin_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_admin_update_dto.py b/immich_carddav_sync/immich_client/models/user_admin_update_dto.py new file mode 100644 index 0000000..e852916 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_admin_update_dto.py @@ -0,0 +1,125 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserAdminUpdateDto") + + +@_attrs_define +class UserAdminUpdateDto: + """ + Attributes: + email (Union[Unset, str]): + name (Union[Unset, str]): + password (Union[Unset, str]): + quota_size_in_bytes (Union[None, Unset, int]): + should_change_password (Union[Unset, bool]): + storage_label (Union[None, Unset, str]): + """ + + email: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + password: Union[Unset, str] = UNSET + quota_size_in_bytes: Union[None, Unset, int] = UNSET + should_change_password: Union[Unset, bool] = UNSET + storage_label: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + email = self.email + + name = self.name + + password = self.password + + quota_size_in_bytes: Union[None, Unset, int] + if isinstance(self.quota_size_in_bytes, Unset): + quota_size_in_bytes = UNSET + else: + quota_size_in_bytes = self.quota_size_in_bytes + + should_change_password = self.should_change_password + + storage_label: Union[None, Unset, str] + if isinstance(self.storage_label, Unset): + storage_label = UNSET + else: + storage_label = self.storage_label + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if email is not UNSET: + field_dict["email"] = email + if name is not UNSET: + field_dict["name"] = name + if password is not UNSET: + field_dict["password"] = password + if quota_size_in_bytes is not UNSET: + field_dict["quotaSizeInBytes"] = quota_size_in_bytes + if should_change_password is not UNSET: + field_dict["shouldChangePassword"] = should_change_password + if storage_label is not UNSET: + field_dict["storageLabel"] = storage_label + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + email = d.pop("email", UNSET) + + name = d.pop("name", UNSET) + + password = d.pop("password", UNSET) + + def _parse_quota_size_in_bytes(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + quota_size_in_bytes = _parse_quota_size_in_bytes(d.pop("quotaSizeInBytes", UNSET)) + + should_change_password = d.pop("shouldChangePassword", UNSET) + + def _parse_storage_label(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + storage_label = _parse_storage_label(d.pop("storageLabel", UNSET)) + + user_admin_update_dto = cls( + email=email, + name=name, + password=password, + quota_size_in_bytes=quota_size_in_bytes, + should_change_password=should_change_password, + storage_label=storage_label, + ) + + user_admin_update_dto.additional_properties = d + return user_admin_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_license.py b/immich_carddav_sync/immich_client/models/user_license.py new file mode 100644 index 0000000..ad6a1a8 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_license.py @@ -0,0 +1,76 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +T = TypeVar("T", bound="UserLicense") + + +@_attrs_define +class UserLicense: + """ + Attributes: + activated_at (datetime.datetime): + activation_key (str): + license_key (str): + """ + + activated_at: datetime.datetime + activation_key: str + license_key: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + activated_at = self.activated_at.isoformat() + + activation_key = self.activation_key + + license_key = self.license_key + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "activatedAt": activated_at, + "activationKey": activation_key, + "licenseKey": license_key, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + activated_at = isoparse(d.pop("activatedAt")) + + activation_key = d.pop("activationKey") + + license_key = d.pop("licenseKey") + + user_license = cls( + activated_at=activated_at, + activation_key=activation_key, + license_key=license_key, + ) + + user_license.additional_properties = d + return user_license + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_preferences_response_dto.py b/immich_carddav_sync/immich_client/models/user_preferences_response_dto.py new file mode 100644 index 0000000..50fc41c --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_preferences_response_dto.py @@ -0,0 +1,144 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.avatar_response import AvatarResponse + from ..models.download_response import DownloadResponse + from ..models.email_notifications_response import EmailNotificationsResponse + from ..models.folders_response import FoldersResponse + from ..models.memories_response import MemoriesResponse + from ..models.people_response import PeopleResponse + from ..models.purchase_response import PurchaseResponse + from ..models.ratings_response import RatingsResponse + from ..models.tags_response import TagsResponse + + +T = TypeVar("T", bound="UserPreferencesResponseDto") + + +@_attrs_define +class UserPreferencesResponseDto: + """ + Attributes: + avatar (AvatarResponse): + download (DownloadResponse): + email_notifications (EmailNotificationsResponse): + folders (FoldersResponse): + memories (MemoriesResponse): + people (PeopleResponse): + purchase (PurchaseResponse): + ratings (RatingsResponse): + tags (TagsResponse): + """ + + avatar: "AvatarResponse" + download: "DownloadResponse" + email_notifications: "EmailNotificationsResponse" + folders: "FoldersResponse" + memories: "MemoriesResponse" + people: "PeopleResponse" + purchase: "PurchaseResponse" + ratings: "RatingsResponse" + tags: "TagsResponse" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + avatar = self.avatar.to_dict() + + download = self.download.to_dict() + + email_notifications = self.email_notifications.to_dict() + + folders = self.folders.to_dict() + + memories = self.memories.to_dict() + + people = self.people.to_dict() + + purchase = self.purchase.to_dict() + + ratings = self.ratings.to_dict() + + tags = self.tags.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "avatar": avatar, + "download": download, + "emailNotifications": email_notifications, + "folders": folders, + "memories": memories, + "people": people, + "purchase": purchase, + "ratings": ratings, + "tags": tags, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.avatar_response import AvatarResponse + from ..models.download_response import DownloadResponse + from ..models.email_notifications_response import EmailNotificationsResponse + from ..models.folders_response import FoldersResponse + from ..models.memories_response import MemoriesResponse + from ..models.people_response import PeopleResponse + from ..models.purchase_response import PurchaseResponse + from ..models.ratings_response import RatingsResponse + from ..models.tags_response import TagsResponse + + d = src_dict.copy() + avatar = AvatarResponse.from_dict(d.pop("avatar")) + + download = DownloadResponse.from_dict(d.pop("download")) + + email_notifications = EmailNotificationsResponse.from_dict(d.pop("emailNotifications")) + + folders = FoldersResponse.from_dict(d.pop("folders")) + + memories = MemoriesResponse.from_dict(d.pop("memories")) + + people = PeopleResponse.from_dict(d.pop("people")) + + purchase = PurchaseResponse.from_dict(d.pop("purchase")) + + ratings = RatingsResponse.from_dict(d.pop("ratings")) + + tags = TagsResponse.from_dict(d.pop("tags")) + + user_preferences_response_dto = cls( + avatar=avatar, + download=download, + email_notifications=email_notifications, + folders=folders, + memories=memories, + people=people, + purchase=purchase, + ratings=ratings, + tags=tags, + ) + + user_preferences_response_dto.additional_properties = d + return user_preferences_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_preferences_update_dto.py b/immich_carddav_sync/immich_client/models/user_preferences_update_dto.py new file mode 100644 index 0000000..4a89ea3 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_preferences_update_dto.py @@ -0,0 +1,215 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.avatar_update import AvatarUpdate + from ..models.download_update import DownloadUpdate + from ..models.email_notifications_update import EmailNotificationsUpdate + from ..models.folders_update import FoldersUpdate + from ..models.memories_update import MemoriesUpdate + from ..models.people_update import PeopleUpdate + from ..models.purchase_update import PurchaseUpdate + from ..models.ratings_update import RatingsUpdate + from ..models.tags_update import TagsUpdate + + +T = TypeVar("T", bound="UserPreferencesUpdateDto") + + +@_attrs_define +class UserPreferencesUpdateDto: + """ + Attributes: + avatar (Union[Unset, AvatarUpdate]): + download (Union[Unset, DownloadUpdate]): + email_notifications (Union[Unset, EmailNotificationsUpdate]): + folders (Union[Unset, FoldersUpdate]): + memories (Union[Unset, MemoriesUpdate]): + people (Union[Unset, PeopleUpdate]): + purchase (Union[Unset, PurchaseUpdate]): + ratings (Union[Unset, RatingsUpdate]): + tags (Union[Unset, TagsUpdate]): + """ + + avatar: Union[Unset, "AvatarUpdate"] = UNSET + download: Union[Unset, "DownloadUpdate"] = UNSET + email_notifications: Union[Unset, "EmailNotificationsUpdate"] = UNSET + folders: Union[Unset, "FoldersUpdate"] = UNSET + memories: Union[Unset, "MemoriesUpdate"] = UNSET + people: Union[Unset, "PeopleUpdate"] = UNSET + purchase: Union[Unset, "PurchaseUpdate"] = UNSET + ratings: Union[Unset, "RatingsUpdate"] = UNSET + tags: Union[Unset, "TagsUpdate"] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + avatar: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.avatar, Unset): + avatar = self.avatar.to_dict() + + download: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.download, Unset): + download = self.download.to_dict() + + email_notifications: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.email_notifications, Unset): + email_notifications = self.email_notifications.to_dict() + + folders: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.folders, Unset): + folders = self.folders.to_dict() + + memories: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.memories, Unset): + memories = self.memories.to_dict() + + people: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.people, Unset): + people = self.people.to_dict() + + purchase: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.purchase, Unset): + purchase = self.purchase.to_dict() + + ratings: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.ratings, Unset): + ratings = self.ratings.to_dict() + + tags: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.tags, Unset): + tags = self.tags.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if avatar is not UNSET: + field_dict["avatar"] = avatar + if download is not UNSET: + field_dict["download"] = download + if email_notifications is not UNSET: + field_dict["emailNotifications"] = email_notifications + if folders is not UNSET: + field_dict["folders"] = folders + if memories is not UNSET: + field_dict["memories"] = memories + if people is not UNSET: + field_dict["people"] = people + if purchase is not UNSET: + field_dict["purchase"] = purchase + if ratings is not UNSET: + field_dict["ratings"] = ratings + if tags is not UNSET: + field_dict["tags"] = tags + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.avatar_update import AvatarUpdate + from ..models.download_update import DownloadUpdate + from ..models.email_notifications_update import EmailNotificationsUpdate + from ..models.folders_update import FoldersUpdate + from ..models.memories_update import MemoriesUpdate + from ..models.people_update import PeopleUpdate + from ..models.purchase_update import PurchaseUpdate + from ..models.ratings_update import RatingsUpdate + from ..models.tags_update import TagsUpdate + + d = src_dict.copy() + _avatar = d.pop("avatar", UNSET) + avatar: Union[Unset, AvatarUpdate] + if isinstance(_avatar, Unset): + avatar = UNSET + else: + avatar = AvatarUpdate.from_dict(_avatar) + + _download = d.pop("download", UNSET) + download: Union[Unset, DownloadUpdate] + if isinstance(_download, Unset): + download = UNSET + else: + download = DownloadUpdate.from_dict(_download) + + _email_notifications = d.pop("emailNotifications", UNSET) + email_notifications: Union[Unset, EmailNotificationsUpdate] + if isinstance(_email_notifications, Unset): + email_notifications = UNSET + else: + email_notifications = EmailNotificationsUpdate.from_dict(_email_notifications) + + _folders = d.pop("folders", UNSET) + folders: Union[Unset, FoldersUpdate] + if isinstance(_folders, Unset): + folders = UNSET + else: + folders = FoldersUpdate.from_dict(_folders) + + _memories = d.pop("memories", UNSET) + memories: Union[Unset, MemoriesUpdate] + if isinstance(_memories, Unset): + memories = UNSET + else: + memories = MemoriesUpdate.from_dict(_memories) + + _people = d.pop("people", UNSET) + people: Union[Unset, PeopleUpdate] + if isinstance(_people, Unset): + people = UNSET + else: + people = PeopleUpdate.from_dict(_people) + + _purchase = d.pop("purchase", UNSET) + purchase: Union[Unset, PurchaseUpdate] + if isinstance(_purchase, Unset): + purchase = UNSET + else: + purchase = PurchaseUpdate.from_dict(_purchase) + + _ratings = d.pop("ratings", UNSET) + ratings: Union[Unset, RatingsUpdate] + if isinstance(_ratings, Unset): + ratings = UNSET + else: + ratings = RatingsUpdate.from_dict(_ratings) + + _tags = d.pop("tags", UNSET) + tags: Union[Unset, TagsUpdate] + if isinstance(_tags, Unset): + tags = UNSET + else: + tags = TagsUpdate.from_dict(_tags) + + user_preferences_update_dto = cls( + avatar=avatar, + download=download, + email_notifications=email_notifications, + folders=folders, + memories=memories, + people=people, + purchase=purchase, + ratings=ratings, + tags=tags, + ) + + user_preferences_update_dto.additional_properties = d + return user_preferences_update_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/user_status.py b/immich_carddav_sync/immich_client/models/user_status.py new file mode 100644 index 0000000..484925a --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class UserStatus(str, Enum): + ACTIVE = "active" + DELETED = "deleted" + REMOVING = "removing" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/user_update_me_dto.py b/immich_carddav_sync/immich_client/models/user_update_me_dto.py new file mode 100644 index 0000000..3b17cf7 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_update_me_dto.py @@ -0,0 +1,76 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UserUpdateMeDto") + + +@_attrs_define +class UserUpdateMeDto: + """ + Attributes: + email (Union[Unset, str]): + name (Union[Unset, str]): + password (Union[Unset, str]): + """ + + email: Union[Unset, str] = UNSET + name: Union[Unset, str] = UNSET + password: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + email = self.email + + name = self.name + + password = self.password + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if email is not UNSET: + field_dict["email"] = email + if name is not UNSET: + field_dict["name"] = name + if password is not UNSET: + field_dict["password"] = password + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + email = d.pop("email", UNSET) + + name = d.pop("name", UNSET) + + password = d.pop("password", UNSET) + + user_update_me_dto = cls( + email=email, + name=name, + password=password, + ) + + user_update_me_dto.additional_properties = d + return user_update_me_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/validate_library_dto.py b/immich_carddav_sync/immich_client/models/validate_library_dto.py new file mode 100644 index 0000000..ae74843 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/validate_library_dto.py @@ -0,0 +1,71 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ValidateLibraryDto") + + +@_attrs_define +class ValidateLibraryDto: + """ + Attributes: + exclusion_patterns (Union[Unset, List[str]]): + import_paths (Union[Unset, List[str]]): + """ + + exclusion_patterns: Union[Unset, List[str]] = UNSET + import_paths: Union[Unset, List[str]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + exclusion_patterns: Union[Unset, List[str]] = UNSET + if not isinstance(self.exclusion_patterns, Unset): + exclusion_patterns = self.exclusion_patterns + + import_paths: Union[Unset, List[str]] = UNSET + if not isinstance(self.import_paths, Unset): + import_paths = self.import_paths + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if exclusion_patterns is not UNSET: + field_dict["exclusionPatterns"] = exclusion_patterns + if import_paths is not UNSET: + field_dict["importPaths"] = import_paths + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + exclusion_patterns = cast(List[str], d.pop("exclusionPatterns", UNSET)) + + import_paths = cast(List[str], d.pop("importPaths", UNSET)) + + validate_library_dto = cls( + exclusion_patterns=exclusion_patterns, + import_paths=import_paths, + ) + + validate_library_dto.additional_properties = d + return validate_library_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/validate_library_import_path_response_dto.py b/immich_carddav_sync/immich_client/models/validate_library_import_path_response_dto.py new file mode 100644 index 0000000..909ce08 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/validate_library_import_path_response_dto.py @@ -0,0 +1,77 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ValidateLibraryImportPathResponseDto") + + +@_attrs_define +class ValidateLibraryImportPathResponseDto: + """ + Attributes: + import_path (str): + is_valid (bool): Default: False. + message (Union[Unset, str]): + """ + + import_path: str + is_valid: bool = False + message: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + import_path = self.import_path + + is_valid = self.is_valid + + message = self.message + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "importPath": import_path, + "isValid": is_valid, + } + ) + if message is not UNSET: + field_dict["message"] = message + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + import_path = d.pop("importPath") + + is_valid = d.pop("isValid") + + message = d.pop("message", UNSET) + + validate_library_import_path_response_dto = cls( + import_path=import_path, + is_valid=is_valid, + message=message, + ) + + validate_library_import_path_response_dto.additional_properties = d + return validate_library_import_path_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/validate_library_response_dto.py b/immich_carddav_sync/immich_client/models/validate_library_response_dto.py new file mode 100644 index 0000000..5b28259 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/validate_library_response_dto.py @@ -0,0 +1,74 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validate_library_import_path_response_dto import ValidateLibraryImportPathResponseDto + + +T = TypeVar("T", bound="ValidateLibraryResponseDto") + + +@_attrs_define +class ValidateLibraryResponseDto: + """ + Attributes: + import_paths (Union[Unset, List['ValidateLibraryImportPathResponseDto']]): + """ + + import_paths: Union[Unset, List["ValidateLibraryImportPathResponseDto"]] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + import_paths: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.import_paths, Unset): + import_paths = [] + for import_paths_item_data in self.import_paths: + import_paths_item = import_paths_item_data.to_dict() + import_paths.append(import_paths_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if import_paths is not UNSET: + field_dict["importPaths"] = import_paths + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.validate_library_import_path_response_dto import ValidateLibraryImportPathResponseDto + + d = src_dict.copy() + import_paths = [] + _import_paths = d.pop("importPaths", UNSET) + for import_paths_item_data in _import_paths or []: + import_paths_item = ValidateLibraryImportPathResponseDto.from_dict(import_paths_item_data) + + import_paths.append(import_paths_item) + + validate_library_response_dto = cls( + import_paths=import_paths, + ) + + validate_library_response_dto.additional_properties = d + return validate_library_response_dto + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/immich_carddav_sync/immich_client/models/video_container.py b/immich_carddav_sync/immich_client/models/video_container.py new file mode 100644 index 0000000..5bde736 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/video_container.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class VideoContainer(str, Enum): + MOV = "mov" + MP4 = "mp4" + OGG = "ogg" + WEBM = "webm" + + def __str__(self) -> str: + return str(self.value)