immich 1.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. immich/.openapi-generator/FILES +372 -0
  2. immich/.openapi-generator/VERSION +1 -0
  3. immich/.openapi-generator-ignore +48 -0
  4. immich/__init__.py +3 -0
  5. immich/client/__init__.py +1162 -0
  6. immich/client/api/__init__.py +39 -0
  7. immich/client/api/activities_api.py +1092 -0
  8. immich/client/api/albums_api.py +3228 -0
  9. immich/client/api/api_keys_api.py +1484 -0
  10. immich/client/api/assets_api.py +5834 -0
  11. immich/client/api/authentication_admin_api.py +254 -0
  12. immich/client/api/authentication_api.py +3881 -0
  13. immich/client/api/deprecated_api.py +2199 -0
  14. immich/client/api/download_api.py +603 -0
  15. immich/client/api/duplicates_api.py +743 -0
  16. immich/client/api/faces_api.py +1053 -0
  17. immich/client/api/jobs_api.py +783 -0
  18. immich/client/api/libraries_api.py +2004 -0
  19. immich/client/api/maintenance_admin_api.py +533 -0
  20. immich/client/api/map_api.py +640 -0
  21. immich/client/api/memories_api.py +2250 -0
  22. immich/client/api/notifications_admin_api.py +808 -0
  23. immich/client/api/notifications_api.py +1564 -0
  24. immich/client/api/partners_api.py +1278 -0
  25. immich/client/api/people_api.py +2905 -0
  26. immich/client/api/plugins_api.py +730 -0
  27. immich/client/api/queues_api.py +1292 -0
  28. immich/client/api/search_api.py +3198 -0
  29. immich/client/api/server_api.py +3466 -0
  30. immich/client/api/sessions_api.py +1472 -0
  31. immich/client/api/shared_links_api.py +2177 -0
  32. immich/client/api/stacks_api.py +1769 -0
  33. immich/client/api/sync_api.py +1512 -0
  34. immich/client/api/system_config_api.py +967 -0
  35. immich/client/api/system_metadata_api.py +964 -0
  36. immich/client/api/tags_api.py +2296 -0
  37. immich/client/api/timeline_api.py +1193 -0
  38. immich/client/api/trash_api.py +739 -0
  39. immich/client/api/users_admin_api.py +2607 -0
  40. immich/client/api/users_api.py +3577 -0
  41. immich/client/api/views_api.py +503 -0
  42. immich/client/api/workflows_api.py +1257 -0
  43. immich/client/api_client.py +756 -0
  44. immich/client/api_response.py +20 -0
  45. immich/client/configuration.py +638 -0
  46. immich/client/exceptions.py +222 -0
  47. immich/client/models/__init__.py +424 -0
  48. immich/client/models/activity_create_dto.py +94 -0
  49. immich/client/models/activity_response_dto.py +121 -0
  50. immich/client/models/activity_statistics_response_dto.py +85 -0
  51. immich/client/models/add_users_dto.py +101 -0
  52. immich/client/models/admin_onboarding_update_dto.py +82 -0
  53. immich/client/models/album_response_dto.py +199 -0
  54. immich/client/models/album_statistics_response_dto.py +90 -0
  55. immich/client/models/album_user_add_dto.py +87 -0
  56. immich/client/models/album_user_create_dto.py +87 -0
  57. immich/client/models/album_user_response_dto.py +95 -0
  58. immich/client/models/album_user_role.py +34 -0
  59. immich/client/models/albums_add_assets_dto.py +86 -0
  60. immich/client/models/albums_add_assets_response_dto.py +86 -0
  61. immich/client/models/albums_response.py +83 -0
  62. immich/client/models/albums_update.py +85 -0
  63. immich/client/models/api_key_create_dto.py +87 -0
  64. immich/client/models/api_key_create_response_dto.py +94 -0
  65. immich/client/models/api_key_response_dto.py +102 -0
  66. immich/client/models/api_key_update_dto.py +87 -0
  67. immich/client/models/asset_bulk_delete_dto.py +84 -0
  68. immich/client/models/asset_bulk_update_dto.py +143 -0
  69. immich/client/models/asset_bulk_upload_check_dto.py +98 -0
  70. immich/client/models/asset_bulk_upload_check_item.py +85 -0
  71. immich/client/models/asset_bulk_upload_check_response_dto.py +101 -0
  72. immich/client/models/asset_bulk_upload_check_result.py +126 -0
  73. immich/client/models/asset_copy_dto.py +113 -0
  74. immich/client/models/asset_delta_sync_dto.py +87 -0
  75. immich/client/models/asset_delta_sync_response_dto.py +102 -0
  76. immich/client/models/asset_face_create_dto.py +110 -0
  77. immich/client/models/asset_face_delete_dto.py +82 -0
  78. immich/client/models/asset_face_response_dto.py +125 -0
  79. immich/client/models/asset_face_update_dto.py +96 -0
  80. immich/client/models/asset_face_update_item.py +86 -0
  81. immich/client/models/asset_face_without_person_response_dto.py +111 -0
  82. immich/client/models/asset_full_sync_dto.py +95 -0
  83. immich/client/models/asset_ids_dto.py +83 -0
  84. immich/client/models/asset_ids_response_dto.py +109 -0
  85. immich/client/models/asset_job_name.py +36 -0
  86. immich/client/models/asset_jobs_dto.py +87 -0
  87. immich/client/models/asset_media_response_dto.py +84 -0
  88. immich/client/models/asset_media_size.py +35 -0
  89. immich/client/models/asset_media_status.py +35 -0
  90. immich/client/models/asset_metadata_key.py +33 -0
  91. immich/client/models/asset_metadata_response_dto.py +92 -0
  92. immich/client/models/asset_metadata_upsert_dto.py +101 -0
  93. immich/client/models/asset_metadata_upsert_item_dto.py +84 -0
  94. immich/client/models/asset_ocr_response_dto.py +145 -0
  95. immich/client/models/asset_order.py +34 -0
  96. immich/client/models/asset_response_dto.py +291 -0
  97. immich/client/models/asset_stack_response_dto.py +90 -0
  98. immich/client/models/asset_stats_response_dto.py +90 -0
  99. immich/client/models/asset_type_enum.py +36 -0
  100. immich/client/models/asset_visibility.py +36 -0
  101. immich/client/models/audio_codec.py +36 -0
  102. immich/client/models/auth_status_response_dto.py +100 -0
  103. immich/client/models/avatar_update.py +83 -0
  104. immich/client/models/bulk_id_error_reason.py +36 -0
  105. immich/client/models/bulk_id_response_dto.py +102 -0
  106. immich/client/models/bulk_ids_dto.py +83 -0
  107. immich/client/models/cast_response.py +88 -0
  108. immich/client/models/cast_update.py +82 -0
  109. immich/client/models/change_password_dto.py +101 -0
  110. immich/client/models/check_existing_assets_dto.py +91 -0
  111. immich/client/models/check_existing_assets_response_dto.py +82 -0
  112. immich/client/models/clip_config.py +85 -0
  113. immich/client/models/colorspace.py +34 -0
  114. immich/client/models/contributor_count_response_dto.py +85 -0
  115. immich/client/models/cq_mode.py +35 -0
  116. immich/client/models/create_album_dto.py +112 -0
  117. immich/client/models/create_library_dto.py +103 -0
  118. immich/client/models/create_profile_image_response_dto.py +95 -0
  119. immich/client/models/database_backup_config.py +94 -0
  120. immich/client/models/download_archive_info.py +85 -0
  121. immich/client/models/download_info_dto.py +96 -0
  122. immich/client/models/download_response.py +90 -0
  123. immich/client/models/download_response_dto.py +100 -0
  124. immich/client/models/download_update.py +93 -0
  125. immich/client/models/duplicate_detection_config.py +89 -0
  126. immich/client/models/duplicate_response_dto.py +98 -0
  127. immich/client/models/email_notifications_response.py +90 -0
  128. immich/client/models/email_notifications_update.py +90 -0
  129. immich/client/models/exif_response_dto.py +284 -0
  130. immich/client/models/face_dto.py +83 -0
  131. immich/client/models/facial_recognition_config.py +107 -0
  132. immich/client/models/folders_response.py +92 -0
  133. immich/client/models/folders_update.py +85 -0
  134. immich/client/models/image_format.py +34 -0
  135. immich/client/models/job_create_dto.py +83 -0
  136. immich/client/models/job_name.py +87 -0
  137. immich/client/models/job_settings_dto.py +83 -0
  138. immich/client/models/library_response_dto.py +118 -0
  139. immich/client/models/library_stats_response_dto.py +92 -0
  140. immich/client/models/license_key_dto.py +98 -0
  141. immich/client/models/license_response_dto.py +101 -0
  142. immich/client/models/log_level.py +38 -0
  143. immich/client/models/login_credential_dto.py +85 -0
  144. immich/client/models/login_response_dto.py +109 -0
  145. immich/client/models/logout_response_dto.py +85 -0
  146. immich/client/models/machine_learning_availability_checks_dto.py +90 -0
  147. immich/client/models/maintenance_action.py +34 -0
  148. immich/client/models/maintenance_auth_dto.py +82 -0
  149. immich/client/models/maintenance_login_dto.py +82 -0
  150. immich/client/models/manual_job_name.py +38 -0
  151. immich/client/models/map_marker_response_dto.py +111 -0
  152. immich/client/models/map_reverse_geocode_response_dto.py +105 -0
  153. immich/client/models/memories_response.py +92 -0
  154. immich/client/models/memories_update.py +86 -0
  155. immich/client/models/memory_create_dto.py +112 -0
  156. immich/client/models/memory_response_dto.py +142 -0
  157. immich/client/models/memory_search_order.py +35 -0
  158. immich/client/models/memory_statistics_response_dto.py +82 -0
  159. immich/client/models/memory_type.py +33 -0
  160. immich/client/models/memory_update_dto.py +91 -0
  161. immich/client/models/merge_person_dto.py +83 -0
  162. immich/client/models/metadata_search_dto.py +277 -0
  163. immich/client/models/notification_create_dto.py +120 -0
  164. immich/client/models/notification_delete_all_dto.py +83 -0
  165. immich/client/models/notification_dto.py +112 -0
  166. immich/client/models/notification_level.py +36 -0
  167. immich/client/models/notification_type.py +38 -0
  168. immich/client/models/notification_update_all_dto.py +90 -0
  169. immich/client/models/notification_update_dto.py +88 -0
  170. immich/client/models/o_auth_authorize_response_dto.py +82 -0
  171. immich/client/models/o_auth_callback_dto.py +90 -0
  172. immich/client/models/o_auth_config_dto.py +90 -0
  173. immich/client/models/o_auth_token_endpoint_auth_method.py +34 -0
  174. immich/client/models/ocr_config.py +109 -0
  175. immich/client/models/on_this_day_dto.py +86 -0
  176. immich/client/models/onboarding_dto.py +82 -0
  177. immich/client/models/onboarding_response_dto.py +82 -0
  178. immich/client/models/partner_create_dto.py +83 -0
  179. immich/client/models/partner_direction.py +34 -0
  180. immich/client/models/partner_response_dto.py +108 -0
  181. immich/client/models/partner_update_dto.py +82 -0
  182. immich/client/models/people_response.py +92 -0
  183. immich/client/models/people_response_dto.py +104 -0
  184. immich/client/models/people_update.py +85 -0
  185. immich/client/models/people_update_dto.py +96 -0
  186. immich/client/models/people_update_item.py +128 -0
  187. immich/client/models/permission.py +177 -0
  188. immich/client/models/person_create_dto.py +117 -0
  189. immich/client/models/person_response_dto.py +115 -0
  190. immich/client/models/person_statistics_response_dto.py +82 -0
  191. immich/client/models/person_update_dto.py +125 -0
  192. immich/client/models/person_with_faces_response_dto.py +133 -0
  193. immich/client/models/pin_code_change_dto.py +90 -0
  194. immich/client/models/pin_code_reset_dto.py +85 -0
  195. immich/client/models/pin_code_setup_dto.py +82 -0
  196. immich/client/models/places_response_dto.py +100 -0
  197. immich/client/models/plugin_action_response_dto.py +112 -0
  198. immich/client/models/plugin_context_type.py +35 -0
  199. immich/client/models/plugin_filter_response_dto.py +112 -0
  200. immich/client/models/plugin_response_dto.py +139 -0
  201. immich/client/models/plugin_trigger_response_dto.py +87 -0
  202. immich/client/models/plugin_trigger_type.py +34 -0
  203. immich/client/models/purchase_response.py +88 -0
  204. immich/client/models/purchase_update.py +92 -0
  205. immich/client/models/queue_command.py +37 -0
  206. immich/client/models/queue_command_dto.py +86 -0
  207. immich/client/models/queue_delete_dto.py +85 -0
  208. immich/client/models/queue_job_response_dto.py +93 -0
  209. immich/client/models/queue_job_status.py +38 -0
  210. immich/client/models/queue_name.py +49 -0
  211. immich/client/models/queue_response_dto.py +97 -0
  212. immich/client/models/queue_response_legacy_dto.py +100 -0
  213. immich/client/models/queue_statistics_dto.py +103 -0
  214. immich/client/models/queue_status_legacy_dto.py +85 -0
  215. immich/client/models/queue_update_dto.py +82 -0
  216. immich/client/models/queues_response_legacy_dto.py +242 -0
  217. immich/client/models/random_search_dto.py +234 -0
  218. immich/client/models/ratings_response.py +84 -0
  219. immich/client/models/ratings_update.py +82 -0
  220. immich/client/models/reaction_level.py +34 -0
  221. immich/client/models/reaction_type.py +34 -0
  222. immich/client/models/reverse_geocoding_state_response_dto.py +101 -0
  223. immich/client/models/search_album_response_dto.py +114 -0
  224. immich/client/models/search_asset_response_dto.py +127 -0
  225. immich/client/models/search_explore_item.py +94 -0
  226. immich/client/models/search_explore_response_dto.py +98 -0
  227. immich/client/models/search_facet_count_response_dto.py +85 -0
  228. immich/client/models/search_facet_response_dto.py +103 -0
  229. immich/client/models/search_response_dto.py +100 -0
  230. immich/client/models/search_statistics_response_dto.py +82 -0
  231. immich/client/models/search_suggestion_type.py +38 -0
  232. immich/client/models/server_about_response_dto.py +156 -0
  233. immich/client/models/server_apk_links_dto.py +97 -0
  234. immich/client/models/server_config_dto.py +118 -0
  235. immich/client/models/server_features_dto.py +130 -0
  236. immich/client/models/server_media_types_response_dto.py +90 -0
  237. immich/client/models/server_ping_response.py +87 -0
  238. immich/client/models/server_stats_response_dto.py +119 -0
  239. immich/client/models/server_storage_response_dto.py +108 -0
  240. immich/client/models/server_theme_dto.py +82 -0
  241. immich/client/models/server_version_history_response_dto.py +91 -0
  242. immich/client/models/server_version_response_dto.py +90 -0
  243. immich/client/models/session_create_dto.py +96 -0
  244. immich/client/models/session_create_response_dto.py +120 -0
  245. immich/client/models/session_response_dto.py +117 -0
  246. immich/client/models/session_unlock_dto.py +85 -0
  247. immich/client/models/session_update_dto.py +84 -0
  248. immich/client/models/set_maintenance_mode_dto.py +83 -0
  249. immich/client/models/shared_link_create_dto.py +142 -0
  250. immich/client/models/shared_link_edit_dto.py +134 -0
  251. immich/client/models/shared_link_response_dto.py +173 -0
  252. immich/client/models/shared_link_type.py +34 -0
  253. immich/client/models/shared_links_response.py +92 -0
  254. immich/client/models/shared_links_update.py +85 -0
  255. immich/client/models/sign_up_dto.py +90 -0
  256. immich/client/models/smart_search_dto.py +245 -0
  257. immich/client/models/source_type.py +35 -0
  258. immich/client/models/stack_create_dto.py +86 -0
  259. immich/client/models/stack_response_dto.py +100 -0
  260. immich/client/models/stack_update_dto.py +83 -0
  261. immich/client/models/statistics_search_dto.py +217 -0
  262. immich/client/models/sync_ack_delete_dto.py +83 -0
  263. immich/client/models/sync_ack_dto.py +84 -0
  264. immich/client/models/sync_ack_set_dto.py +83 -0
  265. immich/client/models/sync_album_delete_v1.py +82 -0
  266. immich/client/models/sync_album_to_asset_delete_v1.py +85 -0
  267. immich/client/models/sync_album_to_asset_v1.py +85 -0
  268. immich/client/models/sync_album_user_delete_v1.py +85 -0
  269. immich/client/models/sync_album_user_v1.py +91 -0
  270. immich/client/models/sync_album_v1.py +122 -0
  271. immich/client/models/sync_asset_delete_v1.py +82 -0
  272. immich/client/models/sync_asset_exif_v1.py +296 -0
  273. immich/client/models/sync_asset_face_delete_v1.py +82 -0
  274. immich/client/models/sync_asset_face_v1.py +120 -0
  275. immich/client/models/sync_asset_metadata_delete_v1.py +86 -0
  276. immich/client/models/sync_asset_metadata_v1.py +91 -0
  277. immich/client/models/sync_asset_v1.py +187 -0
  278. immich/client/models/sync_auth_user_v1.py +154 -0
  279. immich/client/models/sync_entity_type.py +79 -0
  280. immich/client/models/sync_memory_asset_delete_v1.py +85 -0
  281. immich/client/models/sync_memory_asset_v1.py +85 -0
  282. immich/client/models/sync_memory_delete_v1.py +82 -0
  283. immich/client/models/sync_memory_v1.py +143 -0
  284. immich/client/models/sync_partner_delete_v1.py +88 -0
  285. immich/client/models/sync_partner_v1.py +90 -0
  286. immich/client/models/sync_person_delete_v1.py +82 -0
  287. immich/client/models/sync_person_v1.py +131 -0
  288. immich/client/models/sync_request_type.py +52 -0
  289. immich/client/models/sync_stack_delete_v1.py +82 -0
  290. immich/client/models/sync_stack_v1.py +101 -0
  291. immich/client/models/sync_stream_dto.py +86 -0
  292. immich/client/models/sync_user_delete_v1.py +82 -0
  293. immich/client/models/sync_user_metadata_delete_v1.py +84 -0
  294. immich/client/models/sync_user_metadata_v1.py +91 -0
  295. immich/client/models/sync_user_v1.py +118 -0
  296. immich/client/models/system_config_backups_dto.py +92 -0
  297. immich/client/models/system_config_dto.py +302 -0
  298. immich/client/models/system_config_f_fmpeg_dto.py +156 -0
  299. immich/client/models/system_config_faces_dto.py +82 -0
  300. immich/client/models/system_config_generated_fullsize_image_dto.py +92 -0
  301. immich/client/models/system_config_generated_image_dto.py +92 -0
  302. immich/client/models/system_config_image_dto.py +124 -0
  303. immich/client/models/system_config_job_dto.py +194 -0
  304. immich/client/models/system_config_library_dto.py +104 -0
  305. immich/client/models/system_config_library_scan_dto.py +85 -0
  306. immich/client/models/system_config_library_watch_dto.py +82 -0
  307. immich/client/models/system_config_logging_dto.py +86 -0
  308. immich/client/models/system_config_machine_learning_dto.py +147 -0
  309. immich/client/models/system_config_map_dto.py +90 -0
  310. immich/client/models/system_config_metadata_dto.py +92 -0
  311. immich/client/models/system_config_new_version_check_dto.py +82 -0
  312. immich/client/models/system_config_nightly_tasks_dto.py +103 -0
  313. immich/client/models/system_config_notifications_dto.py +92 -0
  314. immich/client/models/system_config_o_auth_dto.py +155 -0
  315. immich/client/models/system_config_password_login_dto.py +82 -0
  316. immich/client/models/system_config_reverse_geocoding_dto.py +82 -0
  317. immich/client/models/system_config_server_dto.py +94 -0
  318. immich/client/models/system_config_smtp_dto.py +100 -0
  319. immich/client/models/system_config_smtp_transport_dto.py +107 -0
  320. immich/client/models/system_config_storage_template_dto.py +94 -0
  321. immich/client/models/system_config_template_emails_dto.py +94 -0
  322. immich/client/models/system_config_template_storage_option_dto.py +109 -0
  323. immich/client/models/system_config_templates_dto.py +94 -0
  324. immich/client/models/system_config_theme_dto.py +82 -0
  325. immich/client/models/system_config_trash_dto.py +86 -0
  326. immich/client/models/system_config_user_dto.py +83 -0
  327. immich/client/models/tag_bulk_assets_dto.py +86 -0
  328. immich/client/models/tag_bulk_assets_response_dto.py +82 -0
  329. immich/client/models/tag_create_dto.py +111 -0
  330. immich/client/models/tag_response_dto.py +107 -0
  331. immich/client/models/tag_update_dto.py +87 -0
  332. immich/client/models/tag_upsert_dto.py +82 -0
  333. immich/client/models/tags_response.py +92 -0
  334. immich/client/models/tags_update.py +85 -0
  335. immich/client/models/template_dto.py +82 -0
  336. immich/client/models/template_response_dto.py +83 -0
  337. immich/client/models/test_email_response_dto.py +82 -0
  338. immich/client/models/time_bucket_asset_response_dto.py +195 -0
  339. immich/client/models/time_buckets_response_dto.py +88 -0
  340. immich/client/models/tone_mapping.py +36 -0
  341. immich/client/models/transcode_hw_accel.py +37 -0
  342. immich/client/models/transcode_policy.py +37 -0
  343. immich/client/models/trash_response_dto.py +82 -0
  344. immich/client/models/update_album_dto.py +106 -0
  345. immich/client/models/update_album_user_dto.py +83 -0
  346. immich/client/models/update_asset_dto.py +135 -0
  347. immich/client/models/update_library_dto.py +95 -0
  348. immich/client/models/usage_by_user_dto.py +117 -0
  349. immich/client/models/user_admin_create_dto.py +136 -0
  350. immich/client/models/user_admin_delete_dto.py +82 -0
  351. immich/client/models/user_admin_response_dto.py +176 -0
  352. immich/client/models/user_admin_update_dto.py +141 -0
  353. immich/client/models/user_avatar_color.py +42 -0
  354. immich/client/models/user_license.py +91 -0
  355. immich/client/models/user_metadata_key.py +35 -0
  356. immich/client/models/user_preferences_response_dto.py +186 -0
  357. immich/client/models/user_preferences_update_dto.py +197 -0
  358. immich/client/models/user_response_dto.py +105 -0
  359. immich/client/models/user_status.py +35 -0
  360. immich/client/models/user_update_me_dto.py +98 -0
  361. immich/client/models/validate_access_token_response_dto.py +82 -0
  362. immich/client/models/validate_library_dto.py +93 -0
  363. immich/client/models/validate_library_import_path_response_dto.py +92 -0
  364. immich/client/models/validate_library_response_dto.py +103 -0
  365. immich/client/models/version_check_state_response_dto.py +98 -0
  366. immich/client/models/video_codec.py +36 -0
  367. immich/client/models/video_container.py +36 -0
  368. immich/client/models/workflow_action_item_dto.py +89 -0
  369. immich/client/models/workflow_action_response_dto.py +105 -0
  370. immich/client/models/workflow_create_dto.py +128 -0
  371. immich/client/models/workflow_filter_item_dto.py +89 -0
  372. immich/client/models/workflow_filter_response_dto.py +105 -0
  373. immich/client/models/workflow_response_dto.py +144 -0
  374. immich/client/models/workflow_update_dto.py +128 -0
  375. immich/client/py.typed +0 -0
  376. immich/client/rest.py +199 -0
  377. immich/client_wrapper/__init__.py +15 -0
  378. immich/client_wrapper/assets_api_wrapped.py +87 -0
  379. immich/client_wrapper/download_api_wrapped.py +111 -0
  380. immich/client_wrapper/users_api_wrapped.py +41 -0
  381. immich/py.typed +0 -0
  382. immich/sdk.py +365 -0
  383. immich/utils.py +100 -0
  384. immich-1.2.1.dist-info/METADATA +166 -0
  385. immich-1.2.1.dist-info/RECORD +387 -0
  386. immich-1.2.1.dist-info/WHEEL +4 -0
  387. immich-1.2.1.dist-info/licenses/LICENSE +9 -0
@@ -0,0 +1,20 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+
10
+ class ApiResponse(BaseModel, Generic[T]):
11
+ """
12
+ API response object
13
+ """
14
+
15
+ status_code: StrictInt = Field(description="HTTP status code")
16
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
17
+ data: T = Field(description="Deserialized data given the data type")
18
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
19
+
20
+ model_config = {"arbitrary_types_allowed": True}
@@ -0,0 +1,638 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Immich
5
+
6
+ Immich API
7
+
8
+ The version of the OpenAPI document: 2.4.1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import base64
15
+ import copy
16
+ import http.client as httplib
17
+ import logging
18
+ from logging import FileHandler
19
+ import sys
20
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
21
+ from typing_extensions import NotRequired, Self
22
+
23
+
24
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
25
+ "multipleOf",
26
+ "maximum",
27
+ "exclusiveMaximum",
28
+ "minimum",
29
+ "exclusiveMinimum",
30
+ "maxLength",
31
+ "minLength",
32
+ "pattern",
33
+ "maxItems",
34
+ "minItems",
35
+ }
36
+
37
+ ServerVariablesT = Dict[str, str]
38
+
39
+ GenericAuthSetting = TypedDict(
40
+ "GenericAuthSetting",
41
+ {
42
+ "type": str,
43
+ "in": str,
44
+ "key": str,
45
+ "value": str,
46
+ },
47
+ )
48
+
49
+
50
+ OAuth2AuthSetting = TypedDict(
51
+ "OAuth2AuthSetting",
52
+ {
53
+ "type": Literal["oauth2"],
54
+ "in": Literal["header"],
55
+ "key": Literal["Authorization"],
56
+ "value": str,
57
+ },
58
+ )
59
+
60
+
61
+ APIKeyAuthSetting = TypedDict(
62
+ "APIKeyAuthSetting",
63
+ {
64
+ "type": Literal["api_key"],
65
+ "in": str,
66
+ "key": str,
67
+ "value": Optional[str],
68
+ },
69
+ )
70
+
71
+
72
+ BasicAuthSetting = TypedDict(
73
+ "BasicAuthSetting",
74
+ {
75
+ "type": Literal["basic"],
76
+ "in": Literal["header"],
77
+ "key": Literal["Authorization"],
78
+ "value": Optional[str],
79
+ },
80
+ )
81
+
82
+
83
+ BearerFormatAuthSetting = TypedDict(
84
+ "BearerFormatAuthSetting",
85
+ {
86
+ "type": Literal["bearer"],
87
+ "in": Literal["header"],
88
+ "format": Literal["JWT"],
89
+ "key": Literal["Authorization"],
90
+ "value": str,
91
+ },
92
+ )
93
+
94
+
95
+ BearerAuthSetting = TypedDict(
96
+ "BearerAuthSetting",
97
+ {
98
+ "type": Literal["bearer"],
99
+ "in": Literal["header"],
100
+ "key": Literal["Authorization"],
101
+ "value": str,
102
+ },
103
+ )
104
+
105
+
106
+ HTTPSignatureAuthSetting = TypedDict(
107
+ "HTTPSignatureAuthSetting",
108
+ {
109
+ "type": Literal["http-signature"],
110
+ "in": Literal["header"],
111
+ "key": Literal["Authorization"],
112
+ "value": None,
113
+ },
114
+ )
115
+
116
+
117
+ AuthSettings = TypedDict(
118
+ "AuthSettings",
119
+ {
120
+ "bearer": BearerFormatAuthSetting,
121
+ "cookie": APIKeyAuthSetting,
122
+ "api_key": APIKeyAuthSetting,
123
+ },
124
+ total=False,
125
+ )
126
+
127
+
128
+ class HostSettingVariable(TypedDict):
129
+ description: str
130
+ default_value: str
131
+ enum_values: List[str]
132
+
133
+
134
+ class HostSetting(TypedDict):
135
+ url: str
136
+ description: str
137
+ variables: NotRequired[Dict[str, HostSettingVariable]]
138
+
139
+
140
+ class Configuration:
141
+ """This class contains various settings of the API client.
142
+
143
+ :param host: Base url.
144
+ :param ignore_operation_servers
145
+ Boolean to ignore operation servers for the API client.
146
+ Config will use `host` as the base url regardless of the operation servers.
147
+ :param api_key: Dict to store API key(s).
148
+ Each entry in the dict specifies an API key.
149
+ The dict key is the name of the security scheme in the OAS specification.
150
+ The dict value is the API key secret.
151
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
152
+ The dict key is the name of the security scheme in the OAS specification.
153
+ The dict value is an API key prefix when generating the auth data.
154
+ :param username: Username for HTTP basic authentication.
155
+ :param password: Password for HTTP basic authentication.
156
+ :param access_token: Access token.
157
+ :param server_index: Index to servers configuration.
158
+ :param server_variables: Mapping with string values to replace variables in
159
+ templated server configuration. The validation of enums is performed for
160
+ variables with defined enum values before.
161
+ :param server_operation_index: Mapping from operation ID to an index to server
162
+ configuration.
163
+ :param server_operation_variables: Mapping from operation ID to a mapping with
164
+ string values to replace variables in templated server configuration.
165
+ The validation of enums is performed for variables with defined enum
166
+ values before.
167
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
168
+ in PEM format.
169
+ :param retries: Number of retries for API requests.
170
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
171
+ in PEM (str) or DER (bytes) format.
172
+ :param cert_file: the path to a client certificate file, for mTLS.
173
+ :param key_file: the path to a client key file, for mTLS.
174
+
175
+ :Example:
176
+
177
+ API Key Authentication Example.
178
+ Given the following security scheme in the OpenAPI specification:
179
+ components:
180
+ securitySchemes:
181
+ cookieAuth: # name for the security scheme
182
+ type: apiKey
183
+ in: cookie
184
+ name: JSESSIONID # cookie name
185
+
186
+ You can programmatically set the cookie:
187
+
188
+ conf = client.Configuration(
189
+ api_key={'cookieAuth': 'abc123'}
190
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
191
+ )
192
+
193
+ The following cookie will be added to the HTTP request:
194
+ Cookie: JSESSIONID abc123
195
+ """
196
+
197
+ _default: ClassVar[Optional[Self]] = None
198
+
199
+ def __init__(
200
+ self,
201
+ host: Optional[str] = None,
202
+ api_key: Optional[Dict[str, str]] = None,
203
+ api_key_prefix: Optional[Dict[str, str]] = None,
204
+ username: Optional[str] = None,
205
+ password: Optional[str] = None,
206
+ access_token: Optional[str] = None,
207
+ server_index: Optional[int] = None,
208
+ server_variables: Optional[ServerVariablesT] = None,
209
+ server_operation_index: Optional[Dict[int, int]] = None,
210
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
211
+ ignore_operation_servers: bool = False,
212
+ ssl_ca_cert: Optional[str] = None,
213
+ retries: Optional[int] = None,
214
+ ca_cert_data: Optional[Union[str, bytes]] = None,
215
+ cert_file: Optional[str] = None,
216
+ key_file: Optional[str] = None,
217
+ *,
218
+ debug: Optional[bool] = None,
219
+ ) -> None:
220
+ """Constructor"""
221
+ self._base_path = (
222
+ "https://raw.githubusercontent.com/api" if host is None else host
223
+ )
224
+ """Default Base url
225
+ """
226
+ self.server_index = 0 if server_index is None and host is None else server_index
227
+ self.server_operation_index = server_operation_index or {}
228
+ """Default server index
229
+ """
230
+ self.server_variables = server_variables or {}
231
+ self.server_operation_variables = server_operation_variables or {}
232
+ """Default server variables
233
+ """
234
+ self.ignore_operation_servers = ignore_operation_servers
235
+ """Ignore operation servers
236
+ """
237
+ self.temp_folder_path = None
238
+ """Temp file folder for downloading files
239
+ """
240
+ # Authentication Settings
241
+ self.api_key = {}
242
+ if api_key:
243
+ self.api_key = api_key
244
+ """dict to store API key(s)
245
+ """
246
+ self.api_key_prefix = {}
247
+ if api_key_prefix:
248
+ self.api_key_prefix = api_key_prefix
249
+ """dict to store API prefix (e.g. Bearer)
250
+ """
251
+ self.refresh_api_key_hook = None
252
+ """function hook to refresh API key if expired
253
+ """
254
+ self.username = username
255
+ """Username for HTTP basic authentication
256
+ """
257
+ self.password = password
258
+ """Password for HTTP basic authentication
259
+ """
260
+ self.access_token = access_token
261
+ """Access token
262
+ """
263
+ self.logger = {}
264
+ """Logging Settings
265
+ """
266
+ self.logger["package_logger"] = logging.getLogger("client")
267
+ self.logger_format = "%(asctime)s %(levelname)s %(message)s"
268
+ """Log format
269
+ """
270
+ self.logger_stream_handler = None
271
+ """Log stream handler
272
+ """
273
+ self.logger_file_handler: Optional[FileHandler] = None
274
+ """Log file handler
275
+ """
276
+ self.logger_file = None
277
+ """Debug file location
278
+ """
279
+ if debug is not None:
280
+ self.debug = debug
281
+ else:
282
+ self.__debug = False
283
+ """Debug switch
284
+ """
285
+
286
+ self.verify_ssl = True
287
+ """SSL/TLS verification
288
+ Set this to false to skip verifying SSL certificate when calling API
289
+ from https server.
290
+ """
291
+ self.ssl_ca_cert = ssl_ca_cert
292
+ """Set this to customize the certificate file to verify the peer.
293
+ """
294
+ self.ca_cert_data = ca_cert_data
295
+ """Set this to verify the peer using PEM (str) or DER (bytes)
296
+ certificate data.
297
+ """
298
+ self.cert_file = cert_file
299
+ """client certificate file
300
+ """
301
+ self.key_file = key_file
302
+ """client key file
303
+ """
304
+ self.assert_hostname = None
305
+ """Set this to True/False to enable/disable SSL hostname verification.
306
+ """
307
+ self.tls_server_name = None
308
+ """SSL/TLS Server Name Indication (SNI)
309
+ Set this to the SNI value expected by the server.
310
+ """
311
+
312
+ self.connection_pool_maxsize = 100
313
+ """This value is passed to the aiohttp to limit simultaneous connections.
314
+ Default values is 100, None means no-limit.
315
+ """
316
+
317
+ self.proxy: Optional[str] = None
318
+ """Proxy URL
319
+ """
320
+ self.proxy_headers = None
321
+ """Proxy headers
322
+ """
323
+ self.safe_chars_for_path_param = ""
324
+ """Safe chars for path_param
325
+ """
326
+ self.retries = retries
327
+ """Adding retries to override urllib3 default value 3
328
+ """
329
+ # Enable client side validation
330
+ self.client_side_validation = True
331
+
332
+ self.socket_options = None
333
+ """Options to pass down to the underlying urllib3 socket
334
+ """
335
+
336
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
337
+ """datetime format
338
+ """
339
+
340
+ self.date_format = "%Y-%m-%d"
341
+ """date format
342
+ """
343
+
344
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
345
+ cls = self.__class__
346
+ result = cls.__new__(cls)
347
+ memo[id(self)] = result
348
+ for k, v in self.__dict__.items():
349
+ if k not in ("logger", "logger_file_handler"):
350
+ setattr(result, k, copy.deepcopy(v, memo))
351
+ # shallow copy of loggers
352
+ result.logger = copy.copy(self.logger)
353
+ # use setters to configure loggers
354
+ result.logger_file = self.logger_file
355
+ result.debug = self.debug
356
+ return result
357
+
358
+ def __setattr__(self, name: str, value: Any) -> None:
359
+ object.__setattr__(self, name, value)
360
+
361
+ @classmethod
362
+ def set_default(cls, default: Optional[Self]) -> None:
363
+ """Set default instance of configuration.
364
+
365
+ It stores default configuration, which can be
366
+ returned by get_default_copy method.
367
+
368
+ :param default: object of Configuration
369
+ """
370
+ cls._default = default
371
+
372
+ @classmethod
373
+ def get_default_copy(cls) -> Self:
374
+ """Deprecated. Please use `get_default` instead.
375
+
376
+ Deprecated. Please use `get_default` instead.
377
+
378
+ :return: The configuration object.
379
+ """
380
+ return cls.get_default()
381
+
382
+ @classmethod
383
+ def get_default(cls) -> Self:
384
+ """Return the default configuration.
385
+
386
+ This method returns newly created, based on default constructor,
387
+ object of Configuration class or returns a copy of default
388
+ configuration.
389
+
390
+ :return: The configuration object.
391
+ """
392
+ if cls._default is None:
393
+ cls._default = cls()
394
+ return cls._default
395
+
396
+ @property
397
+ def logger_file(self) -> Optional[str]:
398
+ """The logger file.
399
+
400
+ If the logger_file is None, then add stream handler and remove file
401
+ handler. Otherwise, add file handler and remove stream handler.
402
+
403
+ :param value: The logger_file path.
404
+ :type: str
405
+ """
406
+ return self.__logger_file
407
+
408
+ @logger_file.setter
409
+ def logger_file(self, value: Optional[str]) -> None:
410
+ """The logger file.
411
+
412
+ If the logger_file is None, then add stream handler and remove file
413
+ handler. Otherwise, add file handler and remove stream handler.
414
+
415
+ :param value: The logger_file path.
416
+ :type: str
417
+ """
418
+ self.__logger_file = value
419
+ if self.__logger_file:
420
+ # If set logging file,
421
+ # then add file handler and remove stream handler.
422
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
423
+ self.logger_file_handler.setFormatter(self.logger_formatter)
424
+ for _, logger in self.logger.items():
425
+ logger.addHandler(self.logger_file_handler)
426
+
427
+ @property
428
+ def debug(self) -> bool:
429
+ """Debug status
430
+
431
+ :param value: The debug status, True or False.
432
+ :type: bool
433
+ """
434
+ return self.__debug
435
+
436
+ @debug.setter
437
+ def debug(self, value: bool) -> None:
438
+ """Debug status
439
+
440
+ :param value: The debug status, True or False.
441
+ :type: bool
442
+ """
443
+ self.__debug = value
444
+ if self.__debug:
445
+ # if debug status is True, turn on debug logging
446
+ for _, logger in self.logger.items():
447
+ logger.setLevel(logging.DEBUG)
448
+ # turn on httplib debug
449
+ httplib.HTTPConnection.debuglevel = 1
450
+ else:
451
+ # if debug status is False, turn off debug logging,
452
+ # setting log level to default `logging.WARNING`
453
+ for _, logger in self.logger.items():
454
+ logger.setLevel(logging.WARNING)
455
+ # turn off httplib debug
456
+ httplib.HTTPConnection.debuglevel = 0
457
+
458
+ @property
459
+ def logger_format(self) -> str:
460
+ """The logger format.
461
+
462
+ The logger_formatter will be updated when sets logger_format.
463
+
464
+ :param value: The format string.
465
+ :type: str
466
+ """
467
+ return self.__logger_format
468
+
469
+ @logger_format.setter
470
+ def logger_format(self, value: str) -> None:
471
+ """The logger format.
472
+
473
+ The logger_formatter will be updated when sets logger_format.
474
+
475
+ :param value: The format string.
476
+ :type: str
477
+ """
478
+ self.__logger_format = value
479
+ self.logger_formatter = logging.Formatter(self.__logger_format)
480
+
481
+ def get_api_key_with_prefix(
482
+ self, identifier: str, alias: Optional[str] = None
483
+ ) -> Optional[str]:
484
+ """Gets API key (with prefix if set).
485
+
486
+ :param identifier: The identifier of apiKey.
487
+ :param alias: The alternative identifier of apiKey.
488
+ :return: The token for api key authentication.
489
+ """
490
+ if self.refresh_api_key_hook is not None:
491
+ self.refresh_api_key_hook(self)
492
+ key = self.api_key.get(
493
+ identifier, self.api_key.get(alias) if alias is not None else None
494
+ )
495
+ if key:
496
+ prefix = self.api_key_prefix.get(identifier)
497
+ if prefix:
498
+ return "%s %s" % (prefix, key)
499
+ else:
500
+ return key
501
+
502
+ return None
503
+
504
+ def get_basic_auth_token(self) -> Optional[str]:
505
+ """Gets HTTP basic authentication header (string).
506
+
507
+ :return: The token for basic HTTP authentication.
508
+ """
509
+ username = ""
510
+ if self.username is not None:
511
+ username = self.username
512
+ password = ""
513
+ if self.password is not None:
514
+ password = self.password
515
+
516
+ return "Basic " + base64.b64encode(
517
+ (username + ":" + password).encode("utf-8")
518
+ ).decode("utf-8")
519
+
520
+ def auth_settings(self) -> AuthSettings:
521
+ """Gets Auth Settings dict for api client.
522
+
523
+ :return: The Auth Settings information dict.
524
+ """
525
+ auth: AuthSettings = {}
526
+ if self.access_token is not None:
527
+ auth["bearer"] = {
528
+ "type": "bearer",
529
+ "in": "header",
530
+ "format": "JWT",
531
+ "key": "Authorization",
532
+ "value": "Bearer " + self.access_token,
533
+ }
534
+ if "cookie" in self.api_key:
535
+ auth["cookie"] = {
536
+ "type": "api_key",
537
+ "in": "cookie",
538
+ "key": "immich_access_token",
539
+ "value": self.get_api_key_with_prefix(
540
+ "cookie",
541
+ ),
542
+ }
543
+ if "api_key" in self.api_key:
544
+ auth["api_key"] = {
545
+ "type": "api_key",
546
+ "in": "header",
547
+ "key": "x-api-key",
548
+ "value": self.get_api_key_with_prefix(
549
+ "api_key",
550
+ ),
551
+ }
552
+ return auth
553
+
554
+ def to_debug_report(self) -> str:
555
+ """Gets the essential information for debugging.
556
+
557
+ :return: The report for debugging.
558
+ """
559
+ return (
560
+ "Python SDK Debug Report:\n"
561
+ "OS: {env}\n"
562
+ "Python Version: {pyversion}\n"
563
+ "Version of the API: 2.4.1\n"
564
+ "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
565
+ )
566
+
567
+ def get_host_settings(self) -> List[HostSetting]:
568
+ """Gets an array of host settings
569
+
570
+ :return: An array of host settings
571
+ """
572
+ return [
573
+ {
574
+ "url": "https://raw.githubusercontent.com/api",
575
+ "description": "No description provided",
576
+ }
577
+ ]
578
+
579
+ def get_host_from_settings(
580
+ self,
581
+ index: Optional[int],
582
+ variables: Optional[ServerVariablesT] = None,
583
+ servers: Optional[List[HostSetting]] = None,
584
+ ) -> str:
585
+ """Gets host URL based on the index and variables
586
+ :param index: array index of the host settings
587
+ :param variables: hash of variable and the corresponding value
588
+ :param servers: an array of host settings or None
589
+ :return: URL based on host settings
590
+ """
591
+ if index is None:
592
+ return self._base_path
593
+
594
+ variables = {} if variables is None else variables
595
+ servers = self.get_host_settings() if servers is None else servers
596
+
597
+ try:
598
+ server = servers[index]
599
+ except IndexError:
600
+ raise ValueError(
601
+ "Invalid index {0} when selecting the host settings. "
602
+ "Must be less than {1}".format(index, len(servers))
603
+ )
604
+
605
+ url = server["url"]
606
+
607
+ # go through variables and replace placeholders
608
+ for variable_name, variable in server.get("variables", {}).items():
609
+ used_value = variables.get(variable_name, variable["default_value"])
610
+
611
+ if (
612
+ "enum_values" in variable
613
+ and variable["enum_values"]
614
+ and used_value not in variable["enum_values"]
615
+ ):
616
+ raise ValueError(
617
+ "The variable `{0}` in the host URL has invalid value "
618
+ "{1}. Must be {2}.".format(
619
+ variable_name, variables[variable_name], variable["enum_values"]
620
+ )
621
+ )
622
+
623
+ url = url.replace("{" + variable_name + "}", used_value)
624
+
625
+ return url
626
+
627
+ @property
628
+ def host(self) -> str:
629
+ """Return generated host."""
630
+ return self.get_host_from_settings(
631
+ self.server_index, variables=self.server_variables
632
+ )
633
+
634
+ @host.setter
635
+ def host(self, value: str) -> None:
636
+ """Fix base path."""
637
+ self._base_path = value
638
+ self.server_index = None