diff --git a/.gitignore b/.gitignore index 3f85f7f..57ed579 100644 --- a/.gitignore +++ b/.gitignore @@ -134,3 +134,7 @@ dmypy.json # Cython debug symbols cython_debug/ + +# other +/immich-openapi-specs.json +/temp diff --git a/generate-immich-client.sh b/generate-immich-client.sh new file mode 100755 index 0000000..05f0e7c --- /dev/null +++ b/generate-immich-client.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# TODO move this to Poetry + +set -e +rm -fr temp +mkdir -p temp +curl "https://raw.githubusercontent.com/immich-app/immich/v1.118.2/open-api/immich-openapi-specs.json" >immich-openapi-specs.json +cd temp + +python3 -m venv venv +source venv/bin/activate +pip install openapi-python-client +openapi-python-client generate --path ../immich-openapi-specs.json +cd - + +rm -fr immich_carddav_sync/immich_client +cp -r temp/immich-client/immich_client immich_carddav_sync/ +rm -fr temp diff --git a/immich_carddav_sync/immich_client/README.md b/immich_carddav_sync/immich_client/README.md deleted file mode 100644 index 78b50a5..0000000 --- a/immich_carddav_sync/immich_client/README.md +++ /dev/null @@ -1 +0,0 @@ -Automatically generated from OpenAPI specification from Immich v1.74.0 diff --git a/immich_carddav_sync/immich_client/__init__.py b/immich_carddav_sync/immich_client/__init__.py index 6a2e7ea..4f4ff83 100644 --- a/immich_carddav_sync/immich_client/__init__.py +++ b/immich_carddav_sync/immich_client/__init__.py @@ -1,4 +1,5 @@ -""" A client library for accessing Immich """ +"""A client library for accessing Immich""" + from .client import AuthenticatedClient, Client __all__ = ( diff --git a/immich_carddav_sync/immich_client/api/__init__.py b/immich_carddav_sync/immich_client/api/__init__.py index dc035f4..81f9fa2 100644 --- a/immich_carddav_sync/immich_client/api/__init__.py +++ b/immich_carddav_sync/immich_client/api/__init__.py @@ -1 +1 @@ -""" Contains methods for accessing the API """ +"""Contains methods for accessing the API""" diff --git a/immich_carddav_sync/immich_client/api/album/add_assets_to_album.py b/immich_carddav_sync/immich_client/api/album/add_assets_to_album.py deleted file mode 100644 index 5a1bc01..0000000 --- a/immich_carddav_sync/immich_client/api/album/add_assets_to_album.py +++ /dev/null @@ -1,190 +0,0 @@ -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.bulk_ids_dto import BulkIdsDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - id: str, - *, - json_body: BulkIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/album/{id}/assets".format( - id=id, - ), - "json": json_json_body, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["BulkIdResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/add_users_to_album.py b/immich_carddav_sync/immich_client/api/album/add_users_to_album.py deleted file mode 100644 index 48cbd65..0000000 --- a/immich_carddav_sync/immich_client/api/album/add_users_to_album.py +++ /dev/null @@ -1,166 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -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: str, - *, - json_body: AddUsersDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/album/{id}/users".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlbumResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: AddUsersDto, -) -> Response[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: AddUsersDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: AddUsersDto, -) -> Response[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: AddUsersDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/create_album.py b/immich_carddav_sync/immich_client/api/album/create_album.py deleted file mode 100644 index 7ed36c8..0000000 --- a/immich_carddav_sync/immich_client/api/album/create_album.py +++ /dev/null @@ -1,151 +0,0 @@ -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( - *, - json_body: CreateAlbumDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/album", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlbumResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - json_body: CreateAlbumDto, -) -> Response[AlbumResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: CreateAlbumDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: CreateAlbumDto, -) -> Response[AlbumResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: CreateAlbumDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/delete_album.py b/immich_carddav_sync/immich_client/api/album/delete_album.py deleted file mode 100644 index 6447024..0000000 --- a/immich_carddav_sync/immich_client/api/album/delete_album.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/album/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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/album/get_album_count.py b/immich_carddav_sync/immich_client/api/album/get_album_count.py deleted file mode 100644 index 336408b..0000000 --- a/immich_carddav_sync/immich_client/api/album/get_album_count.py +++ /dev/null @@ -1,122 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.album_count_response_dto import AlbumCountResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/album/count", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlbumCountResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = AlbumCountResponseDto.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[AlbumCountResponseDto]: - 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[AlbumCountResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AlbumCountResponseDto] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[AlbumCountResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AlbumCountResponseDto - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[AlbumCountResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AlbumCountResponseDto] - """ - - 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[AlbumCountResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AlbumCountResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/get_all_albums.py b/immich_carddav_sync/immich_client/api/album/get_all_albums.py deleted file mode 100644 index 84e06b5..0000000 --- a/immich_carddav_sync/immich_client/api/album/get_all_albums.py +++ /dev/null @@ -1,173 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -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( - *, - shared: Union[Unset, None, bool] = UNSET, - asset_id: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["shared"] = shared - - params["assetId"] = asset_id - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/album", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AlbumResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - shared: Union[Unset, None, bool] = UNSET, - asset_id: Union[Unset, None, str] = UNSET, -) -> Response[List["AlbumResponseDto"]]: - """ - Args: - shared (Union[Unset, None, bool]): - asset_id (Union[Unset, None, 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['AlbumResponseDto']] - """ - - kwargs = _get_kwargs( - shared=shared, - asset_id=asset_id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - shared: Union[Unset, None, bool] = UNSET, - asset_id: Union[Unset, None, str] = UNSET, -) -> Optional[List["AlbumResponseDto"]]: - """ - Args: - shared (Union[Unset, None, bool]): - asset_id (Union[Unset, None, 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['AlbumResponseDto'] - """ - - return sync_detailed( - client=client, - shared=shared, - asset_id=asset_id, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - shared: Union[Unset, None, bool] = UNSET, - asset_id: Union[Unset, None, str] = UNSET, -) -> Response[List["AlbumResponseDto"]]: - """ - Args: - shared (Union[Unset, None, bool]): - asset_id (Union[Unset, None, 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['AlbumResponseDto']] - """ - - kwargs = _get_kwargs( - shared=shared, - 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, - shared: Union[Unset, None, bool] = UNSET, - asset_id: Union[Unset, None, str] = UNSET, -) -> Optional[List["AlbumResponseDto"]]: - """ - Args: - shared (Union[Unset, None, bool]): - asset_id (Union[Unset, None, 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['AlbumResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - shared=shared, - asset_id=asset_id, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/remove_asset_from_album.py b/immich_carddav_sync/immich_client/api/album/remove_asset_from_album.py deleted file mode 100644 index 5cdee36..0000000 --- a/immich_carddav_sync/immich_client/api/album/remove_asset_from_album.py +++ /dev/null @@ -1,171 +0,0 @@ -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.bulk_ids_dto import BulkIdsDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: BulkIdsDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "delete", - "url": "/album/{id}/assets".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["BulkIdResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: BulkIdsDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/remove_user_from_album.py b/immich_carddav_sync/immich_client/api/album/remove_user_from_album.py deleted file mode 100644 index 0286752..0000000 --- a/immich_carddav_sync/immich_client/api/album/remove_user_from_album.py +++ /dev/null @@ -1,101 +0,0 @@ -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( - id: str, - user_id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/album/{id}/user/{userId}".format( - id=id, - userId=user_id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - user_id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - id (str): - 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: str, - user_id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - id (str): - 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/album/update_album_info.py b/immich_carddav_sync/immich_client/api/album/update_album_info.py deleted file mode 100644 index 246426b..0000000 --- a/immich_carddav_sync/immich_client/api/album/update_album_info.py +++ /dev/null @@ -1,166 +0,0 @@ -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.update_album_dto import UpdateAlbumDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: UpdateAlbumDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "patch", - "url": "/album/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlbumResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: UpdateAlbumDto, -) -> Response[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAlbumDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAlbumDto, -) -> Response[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAlbumDto, -) -> Optional[AlbumResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_key/__init__.py b/immich_carddav_sync/immich_client/api/api_key/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/api_key/create_key.py b/immich_carddav_sync/immich_client/api/api_key/create_key.py deleted file mode 100644 index c10be07..0000000 --- a/immich_carddav_sync/immich_client/api/api_key/create_key.py +++ /dev/null @@ -1,151 +0,0 @@ -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( - *, - json_body: APIKeyCreateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/api-key", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[APIKeyCreateResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - json_body: APIKeyCreateDto, -) -> Response[APIKeyCreateResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: APIKeyCreateDto, -) -> Optional[APIKeyCreateResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: APIKeyCreateDto, -) -> Response[APIKeyCreateResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: APIKeyCreateDto, -) -> Optional[APIKeyCreateResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_key/delete_key.py b/immich_carddav_sync/immich_client/api/api_key/delete_key.py deleted file mode 100644 index 66d44bf..0000000 --- a/immich_carddav_sync/immich_client/api/api_key/delete_key.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/api-key/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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_key/get_key.py b/immich_carddav_sync/immich_client/api/api_key/get_key.py deleted file mode 100644 index 2db8300..0000000 --- a/immich_carddav_sync/immich_client/api/api_key/get_key.py +++ /dev/null @@ -1,148 +0,0 @@ -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_response_dto import APIKeyResponseDto -from ...types import Response - - -def _get_kwargs( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/api-key/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[APIKeyResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[APIKeyResponseDto]: - """ - Args: - 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[APIKeyResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[APIKeyResponseDto]: - """ - Args: - 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: - APIKeyResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[APIKeyResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[APIKeyResponseDto]: - """ - Args: - 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: - APIKeyResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/api_key/get_keys.py b/immich_carddav_sync/immich_client/api/api_key/get_keys.py deleted file mode 100644 index 3ab8b69..0000000 --- a/immich_carddav_sync/immich_client/api/api_key/get_keys.py +++ /dev/null @@ -1,127 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/api-key", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["APIKeyResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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_key/update_key.py b/immich_carddav_sync/immich_client/api/api_key/update_key.py deleted file mode 100644 index c2c79f9..0000000 --- a/immich_carddav_sync/immich_client/api/api_key/update_key.py +++ /dev/null @@ -1,166 +0,0 @@ -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_response_dto import APIKeyResponseDto -from ...models.api_key_update_dto import APIKeyUpdateDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: APIKeyUpdateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/api-key/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[APIKeyResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: APIKeyUpdateDto, -) -> Response[APIKeyResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: APIKeyUpdateDto, -) -> Optional[APIKeyResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: APIKeyUpdateDto, -) -> Response[APIKeyResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: APIKeyUpdateDto, -) -> Optional[APIKeyResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/__init__.py b/immich_carddav_sync/immich_client/api/asset/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/asset/bulk_upload_check.py b/immich_carddav_sync/immich_client/api/asset/bulk_upload_check.py deleted file mode 100644 index 372b324..0000000 --- a/immich_carddav_sync/immich_client/api/asset/bulk_upload_check.py +++ /dev/null @@ -1,155 +0,0 @@ -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( - *, - json_body: AssetBulkUploadCheckDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/bulk-upload-check", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetBulkUploadCheckResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: AssetBulkUploadCheckDto, -) -> Response[AssetBulkUploadCheckResponseDto]: - """Checks if assets exist by checksums - - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: AssetBulkUploadCheckDto, -) -> Optional[AssetBulkUploadCheckResponseDto]: - """Checks if assets exist by checksums - - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: AssetBulkUploadCheckDto, -) -> Response[AssetBulkUploadCheckResponseDto]: - """Checks if assets exist by checksums - - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: AssetBulkUploadCheckDto, -) -> Optional[AssetBulkUploadCheckResponseDto]: - """Checks if assets exist by checksums - - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/check_duplicate_asset.py b/immich_carddav_sync/immich_client/api/asset/check_duplicate_asset.py deleted file mode 100644 index 37cb20c..0000000 --- a/immich_carddav_sync/immich_client/api/asset/check_duplicate_asset.py +++ /dev/null @@ -1,174 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.check_duplicate_asset_dto import CheckDuplicateAssetDto -from ...models.check_duplicate_asset_response_dto import CheckDuplicateAssetResponseDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - json_body: CheckDuplicateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/check", - "json": json_json_body, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CheckDuplicateAssetResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = CheckDuplicateAssetResponseDto.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[CheckDuplicateAssetResponseDto]: - 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, - json_body: CheckDuplicateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[CheckDuplicateAssetResponseDto]: - """Check duplicated asset before uploading - for Web upload used - - Args: - key (Union[Unset, None, str]): - json_body (CheckDuplicateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CheckDuplicateAssetResponseDto] - """ - - kwargs = _get_kwargs( - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: CheckDuplicateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[CheckDuplicateAssetResponseDto]: - """Check duplicated asset before uploading - for Web upload used - - Args: - key (Union[Unset, None, str]): - json_body (CheckDuplicateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CheckDuplicateAssetResponseDto - """ - - return sync_detailed( - client=client, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: CheckDuplicateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[CheckDuplicateAssetResponseDto]: - """Check duplicated asset before uploading - for Web upload used - - Args: - key (Union[Unset, None, str]): - json_body (CheckDuplicateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[CheckDuplicateAssetResponseDto] - """ - - kwargs = _get_kwargs( - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: CheckDuplicateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[CheckDuplicateAssetResponseDto]: - """Check duplicated asset before uploading - for Web upload used - - Args: - key (Union[Unset, None, str]): - json_body (CheckDuplicateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - CheckDuplicateAssetResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/check_existing_assets.py b/immich_carddav_sync/immich_client/api/asset/check_existing_assets.py deleted file mode 100644 index e4bcbdc..0000000 --- a/immich_carddav_sync/immich_client/api/asset/check_existing_assets.py +++ /dev/null @@ -1,155 +0,0 @@ -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( - *, - json_body: CheckExistingAssetsDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/exist", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CheckExistingAssetsResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: CheckExistingAssetsDto, -) -> Response[CheckExistingAssetsResponseDto]: - """Checks if multiple assets exist on the server and returns all existing - used by background backup - - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: CheckExistingAssetsDto, -) -> Optional[CheckExistingAssetsResponseDto]: - """Checks if multiple assets exist on the server and returns all existing - used by background backup - - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: CheckExistingAssetsDto, -) -> Response[CheckExistingAssetsResponseDto]: - """Checks if multiple assets exist on the server and returns all existing - used by background backup - - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: CheckExistingAssetsDto, -) -> Optional[CheckExistingAssetsResponseDto]: - """Checks if multiple assets exist on the server and returns all existing - used by background backup - - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/delete_asset.py b/immich_carddav_sync/immich_client/api/asset/delete_asset.py deleted file mode 100644 index d9dd9f7..0000000 --- a/immich_carddav_sync/immich_client/api/asset/delete_asset.py +++ /dev/null @@ -1,156 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.delete_asset_dto import DeleteAssetDto -from ...models.delete_asset_response_dto import DeleteAssetResponseDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: DeleteAssetDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "delete", - "url": "/asset", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["DeleteAssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = DeleteAssetResponseDto.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["DeleteAssetResponseDto"]]: - 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, - json_body: DeleteAssetDto, -) -> Response[List["DeleteAssetResponseDto"]]: - """ - Args: - json_body (DeleteAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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['DeleteAssetResponseDto']] - """ - - kwargs = _get_kwargs( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: DeleteAssetDto, -) -> Optional[List["DeleteAssetResponseDto"]]: - """ - Args: - json_body (DeleteAssetDto): - - Raises: - errors.UnexpectedStatus: If the server 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['DeleteAssetResponseDto'] - """ - - return sync_detailed( - client=client, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: DeleteAssetDto, -) -> Response[List["DeleteAssetResponseDto"]]: - """ - Args: - json_body (DeleteAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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['DeleteAssetResponseDto']] - """ - - kwargs = _get_kwargs( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: DeleteAssetDto, -) -> Optional[List["DeleteAssetResponseDto"]]: - """ - Args: - json_body (DeleteAssetDto): - - Raises: - errors.UnexpectedStatus: If the server 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['DeleteAssetResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/download_archive.py b/immich_carddav_sync/immich_client/api/asset/download_archive.py deleted file mode 100644 index e7ae386..0000000 --- a/immich_carddav_sync/immich_client/api/asset/download_archive.py +++ /dev/null @@ -1,166 +0,0 @@ -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( - *, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/download/archive", - "json": json_json_body, - "params": params, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - key (Union[Unset, None, str]): - json_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( - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - key (Union[Unset, None, str]): - json_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( - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/download_file.py b/immich_carddav_sync/immich_client/api/asset/download_file.py deleted file mode 100644 index 39afbdd..0000000 --- a/immich_carddav_sync/immich_client/api/asset/download_file.py +++ /dev/null @@ -1,164 +0,0 @@ -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 ...types import UNSET, File, Response, Unset - - -def _get_kwargs( - id: str, - *, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - return { - "method": "post", - "url": "/asset/download/{id}".format( - id=id, - ), - "params": params, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - id (str): - key (Union[Unset, None, 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/asset/get_all_assets.py b/immich_carddav_sync/immich_client/api/asset/get_all_assets.py deleted file mode 100644 index 41e6921..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_all_assets.py +++ /dev/null @@ -1,238 +0,0 @@ -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( - *, - user_id: Union[Unset, None, str] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - without_thumbs: Union[Unset, None, bool] = UNSET, - skip: Union[Unset, None, float] = UNSET, - if_none_match: Union[Unset, str] = UNSET, -) -> Dict[str, Any]: - headers = {} - if not isinstance(if_none_match, Unset): - headers["if-none-match"] = if_none_match - - params: Dict[str, Any] = {} - params["userId"] = user_id - - params["isFavorite"] = is_favorite - - params["isArchived"] = is_archived - - params["withoutThumbs"] = without_thumbs - - params["skip"] = skip - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset", - "params": params, - "headers": headers, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - user_id: Union[Unset, None, str] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - without_thumbs: Union[Unset, None, bool] = UNSET, - skip: Union[Unset, None, float] = UNSET, - if_none_match: Union[Unset, str] = UNSET, -) -> Response[List["AssetResponseDto"]]: - """Get all AssetEntity belong to the user - - Args: - user_id (Union[Unset, None, str]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - without_thumbs (Union[Unset, None, bool]): - skip (Union[Unset, None, float]): - if_none_match (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['AssetResponseDto']] - """ - - kwargs = _get_kwargs( - user_id=user_id, - is_favorite=is_favorite, - is_archived=is_archived, - without_thumbs=without_thumbs, - skip=skip, - if_none_match=if_none_match, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - user_id: Union[Unset, None, str] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - without_thumbs: Union[Unset, None, bool] = UNSET, - skip: Union[Unset, None, float] = UNSET, - if_none_match: Union[Unset, str] = UNSET, -) -> Optional[List["AssetResponseDto"]]: - """Get all AssetEntity belong to the user - - Args: - user_id (Union[Unset, None, str]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - without_thumbs (Union[Unset, None, bool]): - skip (Union[Unset, None, float]): - if_none_match (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['AssetResponseDto'] - """ - - return sync_detailed( - client=client, - user_id=user_id, - is_favorite=is_favorite, - is_archived=is_archived, - without_thumbs=without_thumbs, - skip=skip, - if_none_match=if_none_match, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - user_id: Union[Unset, None, str] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - without_thumbs: Union[Unset, None, bool] = UNSET, - skip: Union[Unset, None, float] = UNSET, - if_none_match: Union[Unset, str] = UNSET, -) -> Response[List["AssetResponseDto"]]: - """Get all AssetEntity belong to the user - - Args: - user_id (Union[Unset, None, str]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - without_thumbs (Union[Unset, None, bool]): - skip (Union[Unset, None, float]): - if_none_match (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['AssetResponseDto']] - """ - - kwargs = _get_kwargs( - user_id=user_id, - is_favorite=is_favorite, - is_archived=is_archived, - without_thumbs=without_thumbs, - skip=skip, - if_none_match=if_none_match, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - user_id: Union[Unset, None, str] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - without_thumbs: Union[Unset, None, bool] = UNSET, - skip: Union[Unset, None, float] = UNSET, - if_none_match: Union[Unset, str] = UNSET, -) -> Optional[List["AssetResponseDto"]]: - """Get all AssetEntity belong to the user - - Args: - user_id (Union[Unset, None, str]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - without_thumbs (Union[Unset, None, bool]): - skip (Union[Unset, None, float]): - if_none_match (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['AssetResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - user_id=user_id, - is_favorite=is_favorite, - is_archived=is_archived, - without_thumbs=without_thumbs, - skip=skip, - if_none_match=if_none_match, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_asset_by_id.py b/immich_carddav_sync/immich_client/api/asset/get_asset_by_id.py deleted file mode 100644 index 9ac7930..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_asset_by_id.py +++ /dev/null @@ -1,172 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, - *, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - return { - "method": "get", - "url": "/asset/assetById/{id}".format( - id=id, - ), - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Response[AssetResponseDto]: - """Get a single asset's information - - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AssetResponseDto]: - """Get a single asset's information - - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Response[AssetResponseDto]: - """Get a single asset's information - - Args: - id (str): - key (Union[Unset, None, 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: str, - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AssetResponseDto]: - """Get a single asset's information - - Args: - id (str): - key (Union[Unset, None, 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/asset/get_asset_search_terms.py b/immich_carddav_sync/immich_client/api/asset/get_asset_search_terms.py deleted file mode 100644 index c08308c..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_asset_search_terms.py +++ /dev/null @@ -1,117 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/asset/search-terms", - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]: - if response.status_code == HTTPStatus.OK: - 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/api/asset/get_asset_stats.py b/immich_carddav_sync/immich_client/api/asset/get_asset_stats.py deleted file mode 100644 index 481b5ed..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_asset_stats.py +++ /dev/null @@ -1,168 +0,0 @@ -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, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["isArchived"] = is_archived - - params["isFavorite"] = is_favorite - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/statistics", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetStatsResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, -) -> Response[AssetStatsResponseDto]: - """ - Args: - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, -) -> Optional[AssetStatsResponseDto]: - """ - Args: - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, 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, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, -) -> Response[AssetStatsResponseDto]: - """ - Args: - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, 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, - ) - - 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, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, -) -> Optional[AssetStatsResponseDto]: - """ - Args: - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, 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, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_asset_thumbnail.py b/immich_carddav_sync/immich_client/api/asset/get_asset_thumbnail.py deleted file mode 100644 index db8d9d1..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_asset_thumbnail.py +++ /dev/null @@ -1,119 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.thumbnail_format import ThumbnailFormat -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - id: str, - *, - format_: Union[Unset, None, ThumbnailFormat] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - json_format_: Union[Unset, None, str] = UNSET - if not isinstance(format_, Unset): - json_format_ = format_.value if format_ else None - - params["format"] = json_format_ - - params["key"] = key - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/thumbnail/{id}".format( - id=id, - ), - "params": params, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - 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: str, - *, - client: AuthenticatedClient, - format_: Union[Unset, None, ThumbnailFormat] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[Any]: - """ - Args: - id (str): - format_ (Union[Unset, None, ThumbnailFormat]): - key (Union[Unset, None, 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, - format_=format_, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - format_: Union[Unset, None, ThumbnailFormat] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[Any]: - """ - Args: - id (str): - format_ (Union[Unset, None, ThumbnailFormat]): - key (Union[Unset, None, 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, - format_=format_, - key=key, - ) - - 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/asset/get_by_time_bucket.py b/immich_carddav_sync/immich_client/api/asset/get_by_time_bucket.py deleted file mode 100644 index 014c739..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_by_time_bucket.py +++ /dev/null @@ -1,266 +0,0 @@ -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.time_bucket_size import TimeBucketSize -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - time_bucket: str, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - json_size = size.value - - params["size"] = json_size - - params["userId"] = user_id - - params["albumId"] = album_id - - params["personId"] = person_id - - params["isArchived"] = is_archived - - params["isFavorite"] = is_favorite - - params["timeBucket"] = time_bucket - - params["key"] = key - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/time-bucket", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - time_bucket: str, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - time_bucket (str): - key (Union[Unset, None, 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( - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - time_bucket=time_bucket, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - time_bucket: str, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - time_bucket (str): - key (Union[Unset, None, 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, - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - time_bucket=time_bucket, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - time_bucket: str, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - time_bucket (str): - key (Union[Unset, None, 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( - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - time_bucket=time_bucket, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - time_bucket: str, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - time_bucket (str): - key (Union[Unset, None, 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, - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - time_bucket=time_bucket, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_curated_locations.py b/immich_carddav_sync/immich_client/api/asset/get_curated_locations.py deleted file mode 100644 index c55dbc6..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_curated_locations.py +++ /dev/null @@ -1,127 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.curated_locations_response_dto import CuratedLocationsResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/asset/curated-locations", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["CuratedLocationsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = CuratedLocationsResponseDto.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["CuratedLocationsResponseDto"]]: - 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["CuratedLocationsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['CuratedLocationsResponseDto']] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[List["CuratedLocationsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['CuratedLocationsResponseDto'] - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[List["CuratedLocationsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['CuratedLocationsResponseDto']] - """ - - 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["CuratedLocationsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['CuratedLocationsResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_curated_objects.py b/immich_carddav_sync/immich_client/api/asset/get_curated_objects.py deleted file mode 100644 index 2613021..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_curated_objects.py +++ /dev/null @@ -1,127 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.curated_objects_response_dto import CuratedObjectsResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/asset/curated-objects", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["CuratedObjectsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = CuratedObjectsResponseDto.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["CuratedObjectsResponseDto"]]: - 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["CuratedObjectsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['CuratedObjectsResponseDto']] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[List["CuratedObjectsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['CuratedObjectsResponseDto'] - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[List["CuratedObjectsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['CuratedObjectsResponseDto']] - """ - - 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["CuratedObjectsResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['CuratedObjectsResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_download_info.py b/immich_carddav_sync/immich_client/api/asset/get_download_info.py deleted file mode 100644 index 5f861e5..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_download_info.py +++ /dev/null @@ -1,170 +0,0 @@ -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( - *, - json_body: DownloadInfoDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/download/info", - "json": json_json_body, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DownloadResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - json_body: DownloadInfoDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[DownloadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - json_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( - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: DownloadInfoDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[DownloadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: DownloadInfoDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[DownloadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - json_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( - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: DownloadInfoDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[DownloadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_map_markers.py b/immich_carddav_sync/immich_client/api/asset/get_map_markers.py deleted file mode 100644 index d88f618..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_map_markers.py +++ /dev/null @@ -1,197 +0,0 @@ -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( - *, - is_favorite: Union[Unset, None, bool] = UNSET, - file_created_after: Union[Unset, None, datetime.datetime] = UNSET, - file_created_before: Union[Unset, None, datetime.datetime] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["isFavorite"] = is_favorite - - json_file_created_after: Union[Unset, None, str] = UNSET - if not isinstance(file_created_after, Unset): - json_file_created_after = file_created_after.isoformat() if file_created_after else None - - params["fileCreatedAfter"] = json_file_created_after - - json_file_created_before: Union[Unset, None, str] = UNSET - if not isinstance(file_created_before, Unset): - json_file_created_before = file_created_before.isoformat() if file_created_before else None - - params["fileCreatedBefore"] = json_file_created_before - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/map-marker", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["MapMarkerResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - is_favorite: Union[Unset, None, bool] = UNSET, - file_created_after: Union[Unset, None, datetime.datetime] = UNSET, - file_created_before: Union[Unset, None, datetime.datetime] = UNSET, -) -> Response[List["MapMarkerResponseDto"]]: - """ - Args: - is_favorite (Union[Unset, None, bool]): - file_created_after (Union[Unset, None, datetime.datetime]): - file_created_before (Union[Unset, None, datetime.datetime]): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - is_favorite=is_favorite, - file_created_after=file_created_after, - file_created_before=file_created_before, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - is_favorite: Union[Unset, None, bool] = UNSET, - file_created_after: Union[Unset, None, datetime.datetime] = UNSET, - file_created_before: Union[Unset, None, datetime.datetime] = UNSET, -) -> Optional[List["MapMarkerResponseDto"]]: - """ - Args: - is_favorite (Union[Unset, None, bool]): - file_created_after (Union[Unset, None, datetime.datetime]): - file_created_before (Union[Unset, None, datetime.datetime]): - - Raises: - errors.UnexpectedStatus: If the server 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, - is_favorite=is_favorite, - file_created_after=file_created_after, - file_created_before=file_created_before, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - is_favorite: Union[Unset, None, bool] = UNSET, - file_created_after: Union[Unset, None, datetime.datetime] = UNSET, - file_created_before: Union[Unset, None, datetime.datetime] = UNSET, -) -> Response[List["MapMarkerResponseDto"]]: - """ - Args: - is_favorite (Union[Unset, None, bool]): - file_created_after (Union[Unset, None, datetime.datetime]): - file_created_before (Union[Unset, None, datetime.datetime]): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - is_favorite=is_favorite, - file_created_after=file_created_after, - file_created_before=file_created_before, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - is_favorite: Union[Unset, None, bool] = UNSET, - file_created_after: Union[Unset, None, datetime.datetime] = UNSET, - file_created_before: Union[Unset, None, datetime.datetime] = UNSET, -) -> Optional[List["MapMarkerResponseDto"]]: - """ - Args: - is_favorite (Union[Unset, None, bool]): - file_created_after (Union[Unset, None, datetime.datetime]): - file_created_before (Union[Unset, None, datetime.datetime]): - - Raises: - errors.UnexpectedStatus: If the server 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, - is_favorite=is_favorite, - file_created_after=file_created_after, - file_created_before=file_created_before, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_memory_lane.py b/immich_carddav_sync/immich_client/api/asset/get_memory_lane.py deleted file mode 100644 index f643582..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_memory_lane.py +++ /dev/null @@ -1,161 +0,0 @@ -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.memory_lane_response_dto import MemoryLaneResponseDto -from ...types import UNSET, Response - - -def _get_kwargs( - *, - timestamp: datetime.datetime, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - json_timestamp = timestamp.isoformat() - - params["timestamp"] = json_timestamp - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/memory-lane", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["MemoryLaneResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - timestamp: datetime.datetime, -) -> Response[List["MemoryLaneResponseDto"]]: - """ - Args: - timestamp (datetime.datetime): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - timestamp=timestamp, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - timestamp: datetime.datetime, -) -> Optional[List["MemoryLaneResponseDto"]]: - """ - Args: - timestamp (datetime.datetime): - - Raises: - errors.UnexpectedStatus: If the server 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, - timestamp=timestamp, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - timestamp: datetime.datetime, -) -> Response[List["MemoryLaneResponseDto"]]: - """ - Args: - timestamp (datetime.datetime): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - timestamp=timestamp, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - timestamp: datetime.datetime, -) -> Optional[List["MemoryLaneResponseDto"]]: - """ - Args: - timestamp (datetime.datetime): - - Raises: - errors.UnexpectedStatus: If the server 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, - timestamp=timestamp, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_time_buckets.py b/immich_carddav_sync/immich_client/api/asset/get_time_buckets.py deleted file mode 100644 index 356f6f9..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_time_buckets.py +++ /dev/null @@ -1,251 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.time_bucket_response_dto import TimeBucketResponseDto -from ...models.time_bucket_size import TimeBucketSize -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - json_size = size.value - - params["size"] = json_size - - params["userId"] = user_id - - params["albumId"] = album_id - - params["personId"] = person_id - - params["isArchived"] = is_archived - - params["isFavorite"] = is_favorite - - params["key"] = key - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/time-buckets", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["TimeBucketResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["TimeBucketResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - key (Union[Unset, None, 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['TimeBucketResponseDto']] - """ - - kwargs = _get_kwargs( - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["TimeBucketResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - key (Union[Unset, None, 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['TimeBucketResponseDto'] - """ - - return sync_detailed( - client=client, - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["TimeBucketResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - key (Union[Unset, None, 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['TimeBucketResponseDto']] - """ - - kwargs = _get_kwargs( - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - size: TimeBucketSize, - user_id: Union[Unset, None, str] = UNSET, - album_id: Union[Unset, None, str] = UNSET, - person_id: Union[Unset, None, str] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["TimeBucketResponseDto"]]: - """ - Args: - size (TimeBucketSize): - user_id (Union[Unset, None, str]): - album_id (Union[Unset, None, str]): - person_id (Union[Unset, None, str]): - is_archived (Union[Unset, None, bool]): - is_favorite (Union[Unset, None, bool]): - key (Union[Unset, None, 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['TimeBucketResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - size=size, - user_id=user_id, - album_id=album_id, - person_id=person_id, - is_archived=is_archived, - is_favorite=is_favorite, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/get_user_assets_by_device_id.py b/immich_carddav_sync/immich_client/api/asset/get_user_assets_by_device_id.py deleted file mode 100644 index 26e6d54..0000000 --- a/immich_carddav_sync/immich_client/api/asset/get_user_assets_by_device_id.py +++ /dev/null @@ -1,147 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/asset/{deviceId}".format( - deviceId=device_id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]: - if response.status_code == HTTPStatus.OK: - 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/asset/import_file.py b/immich_carddav_sync/immich_client/api/asset/import_file.py deleted file mode 100644 index 62bf43d..0000000 --- a/immich_carddav_sync/immich_client/api/asset/import_file.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.asset_file_upload_response_dto import AssetFileUploadResponseDto -from ...models.import_asset_dto import ImportAssetDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: ImportAssetDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/import", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetFileUploadResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = AssetFileUploadResponseDto.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[AssetFileUploadResponseDto]: - 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, - json_body: ImportAssetDto, -) -> Response[AssetFileUploadResponseDto]: - """ - Args: - json_body (ImportAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AssetFileUploadResponseDto] - """ - - kwargs = _get_kwargs( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: ImportAssetDto, -) -> Optional[AssetFileUploadResponseDto]: - """ - Args: - json_body (ImportAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AssetFileUploadResponseDto - """ - - return sync_detailed( - client=client, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: ImportAssetDto, -) -> Response[AssetFileUploadResponseDto]: - """ - Args: - json_body (ImportAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AssetFileUploadResponseDto] - """ - - kwargs = _get_kwargs( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: ImportAssetDto, -) -> Optional[AssetFileUploadResponseDto]: - """ - Args: - json_body (ImportAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AssetFileUploadResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/run_asset_jobs.py b/immich_carddav_sync/immich_client/api/asset/run_asset_jobs.py deleted file mode 100644 index e183f5a..0000000 --- a/immich_carddav_sync/immich_client/api/asset/run_asset_jobs.py +++ /dev/null @@ -1,96 +0,0 @@ -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( - *, - json_body: AssetJobsDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/jobs", - "json": json_json_body, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - 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, - json_body: AssetJobsDto, -) -> Response[Any]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: AssetJobsDto, -) -> Response[Any]: - """ - Args: - json_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( - json_body=json_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/asset/search_asset.py b/immich_carddav_sync/immich_client/api/asset/search_asset.py deleted file mode 100644 index 115e4a2..0000000 --- a/immich_carddav_sync/immich_client/api/asset/search_asset.py +++ /dev/null @@ -1,156 +0,0 @@ -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.search_asset_dto import SearchAssetDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: SearchAssetDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/asset/search", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: SearchAssetDto, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - json_body (SearchAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: SearchAssetDto, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - json_body (SearchAssetDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: SearchAssetDto, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - json_body (SearchAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: SearchAssetDto, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - json_body (SearchAssetDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/serve_file.py b/immich_carddav_sync/immich_client/api/asset/serve_file.py deleted file mode 100644 index 30e9a5e..0000000 --- a/immich_carddav_sync/immich_client/api/asset/serve_file.py +++ /dev/null @@ -1,194 +0,0 @@ -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 ...types import UNSET, File, Response, Unset - - -def _get_kwargs( - id: str, - *, - is_thumb: Union[Unset, None, bool] = UNSET, - is_web: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["isThumb"] = is_thumb - - params["isWeb"] = is_web - - params["key"] = key - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/asset/file/{id}".format( - id=id, - ), - "params": params, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[File]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - is_thumb: Union[Unset, None, bool] = UNSET, - is_web: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - id (str): - is_thumb (Union[Unset, None, bool]): - is_web (Union[Unset, None, bool]): - key (Union[Unset, None, 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, - is_thumb=is_thumb, - is_web=is_web, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - is_thumb: Union[Unset, None, bool] = UNSET, - is_web: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - id (str): - is_thumb (Union[Unset, None, bool]): - is_web (Union[Unset, None, bool]): - key (Union[Unset, None, 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, - is_thumb=is_thumb, - is_web=is_web, - key=key, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - is_thumb: Union[Unset, None, bool] = UNSET, - is_web: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[File]: - """ - Args: - id (str): - is_thumb (Union[Unset, None, bool]): - is_web (Union[Unset, None, bool]): - key (Union[Unset, None, 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, - is_thumb=is_thumb, - is_web=is_web, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - is_thumb: Union[Unset, None, bool] = UNSET, - is_web: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[File]: - """ - Args: - id (str): - is_thumb (Union[Unset, None, bool]): - is_web (Union[Unset, None, bool]): - key (Union[Unset, None, 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, - is_thumb=is_thumb, - is_web=is_web, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/update_asset.py b/immich_carddav_sync/immich_client/api/asset/update_asset.py deleted file mode 100644 index 314af27..0000000 --- a/immich_carddav_sync/immich_client/api/asset/update_asset.py +++ /dev/null @@ -1,170 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -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: str, - *, - json_body: UpdateAssetDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/asset/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: UpdateAssetDto, -) -> Response[AssetResponseDto]: - """Update an asset - - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAssetDto, -) -> Optional[AssetResponseDto]: - """Update an asset - - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAssetDto, -) -> Response[AssetResponseDto]: - """Update an asset - - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateAssetDto, -) -> Optional[AssetResponseDto]: - """Update an asset - - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/asset/update_assets.py b/immich_carddav_sync/immich_client/api/asset/update_assets.py deleted file mode 100644 index 611d5bc..0000000 --- a/immich_carddav_sync/immich_client/api/asset/update_assets.py +++ /dev/null @@ -1,96 +0,0 @@ -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( - *, - json_body: AssetBulkUpdateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/asset", - "json": json_json_body, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - 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, - json_body: AssetBulkUpdateDto, -) -> Response[Any]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: AssetBulkUpdateDto, -) -> Response[Any]: - """ - Args: - json_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( - json_body=json_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/asset/upload_file.py b/immich_carddav_sync/immich_client/api/asset/upload_file.py deleted file mode 100644 index 9ba2939..0000000 --- a/immich_carddav_sync/immich_client/api/asset/upload_file.py +++ /dev/null @@ -1,170 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.asset_file_upload_response_dto import AssetFileUploadResponseDto -from ...models.create_asset_dto import CreateAssetDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - multipart_data: CreateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - multipart_multipart_data = multipart_data.to_multipart() - - return { - "method": "post", - "url": "/asset/upload", - "files": multipart_multipart_data, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AssetFileUploadResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = AssetFileUploadResponseDto.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[AssetFileUploadResponseDto]: - 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, - multipart_data: CreateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[AssetFileUploadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - multipart_data (CreateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AssetFileUploadResponseDto] - """ - - kwargs = _get_kwargs( - multipart_data=multipart_data, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - multipart_data: CreateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AssetFileUploadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - multipart_data (CreateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AssetFileUploadResponseDto - """ - - return sync_detailed( - client=client, - multipart_data=multipart_data, - key=key, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - multipart_data: CreateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[AssetFileUploadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - multipart_data (CreateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AssetFileUploadResponseDto] - """ - - kwargs = _get_kwargs( - multipart_data=multipart_data, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - multipart_data: CreateAssetDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AssetFileUploadResponseDto]: - """ - Args: - key (Union[Unset, None, str]): - multipart_data (CreateAssetDto): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AssetFileUploadResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - multipart_data=multipart_data, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/album/__init__.py b/immich_carddav_sync/immich_client/api/audit/__init__.py similarity index 100% rename from immich_carddav_sync/immich_client/api/album/__init__.py rename to immich_carddav_sync/immich_client/api/audit/__init__.py diff --git a/immich_carddav_sync/immich_client/api/album/get_album_info.py b/immich_carddav_sync/immich_client/api/audit/get_audit_deletes.py similarity index 55% rename from immich_carddav_sync/immich_client/api/album/get_album_info.py rename to immich_carddav_sync/immich_client/api/audit/get_audit_deletes.py index 5be518c..d0f2982 100644 --- a/immich_carddav_sync/immich_client/api/album/get_album_info.py +++ b/immich_carddav_sync/immich_client/api/audit/get_audit_deletes.py @@ -1,43 +1,52 @@ +import datetime 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.audit_deletes_response_dto import AuditDeletesResponseDto +from ...models.entity_type import EntityType from ...types import UNSET, Response, Unset def _get_kwargs( - id: str, *, - without_assets: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, + after: datetime.datetime, + entity_type: EntityType, + user_id: Union[Unset, UUID] = UNSET, ) -> Dict[str, Any]: - pass - params: Dict[str, Any] = {} - params["withoutAssets"] = without_assets - params["key"] = key + json_after = after.isoformat() + params["after"] = json_after + + json_entity_type = entity_type.value + params["entityType"] = json_entity_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} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/album/{id}".format( - id=id, - ), + "url": "/audit/deletes", "params": params, } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AlbumResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = AlbumResponseDto.from_dict(response.json()) +) -> Optional[AuditDeletesResponseDto]: + if response.status_code == 200: + response_200 = AuditDeletesResponseDto.from_dict(response.json()) return response_200 if client.raise_on_unexpected_status: @@ -48,7 +57,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AlbumResponseDto]: +) -> Response[AuditDeletesResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,30 +67,30 @@ def _build_response( def sync_detailed( - id: str, *, client: AuthenticatedClient, - without_assets: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[AlbumResponseDto]: + after: datetime.datetime, + entity_type: EntityType, + user_id: Union[Unset, UUID] = UNSET, +) -> Response[AuditDeletesResponseDto]: """ Args: - id (str): - without_assets (Union[Unset, None, bool]): - key (Union[Unset, None, str]): + after (datetime.datetime): + entity_type (EntityType): + 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[AlbumResponseDto] + Response[AuditDeletesResponseDto] """ kwargs = _get_kwargs( - id=id, - without_assets=without_assets, - key=key, + after=after, + entity_type=entity_type, + user_id=user_id, ) response = client.get_httpx_client().request( @@ -92,59 +101,59 @@ def sync_detailed( def sync( - id: str, *, client: AuthenticatedClient, - without_assets: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AlbumResponseDto]: + after: datetime.datetime, + entity_type: EntityType, + user_id: Union[Unset, UUID] = UNSET, +) -> Optional[AuditDeletesResponseDto]: """ Args: - id (str): - without_assets (Union[Unset, None, bool]): - key (Union[Unset, None, str]): + after (datetime.datetime): + entity_type (EntityType): + 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: - AlbumResponseDto + AuditDeletesResponseDto """ return sync_detailed( - id=id, client=client, - without_assets=without_assets, - key=key, + after=after, + entity_type=entity_type, + user_id=user_id, ).parsed async def asyncio_detailed( - id: str, *, client: AuthenticatedClient, - without_assets: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Response[AlbumResponseDto]: + after: datetime.datetime, + entity_type: EntityType, + user_id: Union[Unset, UUID] = UNSET, +) -> Response[AuditDeletesResponseDto]: """ Args: - id (str): - without_assets (Union[Unset, None, bool]): - key (Union[Unset, None, str]): + after (datetime.datetime): + entity_type (EntityType): + 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[AlbumResponseDto] + Response[AuditDeletesResponseDto] """ kwargs = _get_kwargs( - id=id, - without_assets=without_assets, - key=key, + after=after, + entity_type=entity_type, + user_id=user_id, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -153,31 +162,31 @@ async def asyncio_detailed( async def asyncio( - id: str, *, client: AuthenticatedClient, - without_assets: Union[Unset, None, bool] = UNSET, - key: Union[Unset, None, str] = UNSET, -) -> Optional[AlbumResponseDto]: + after: datetime.datetime, + entity_type: EntityType, + user_id: Union[Unset, UUID] = UNSET, +) -> Optional[AuditDeletesResponseDto]: """ Args: - id (str): - without_assets (Union[Unset, None, bool]): - key (Union[Unset, None, str]): + after (datetime.datetime): + entity_type (EntityType): + 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: - AlbumResponseDto + AuditDeletesResponseDto """ return ( await asyncio_detailed( - id=id, client=client, - without_assets=without_assets, - key=key, + after=after, + entity_type=entity_type, + user_id=user_id, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/authentication/change_password.py b/immich_carddav_sync/immich_client/api/authentication/change_password.py index 1398cc3..6de7c86 100644 --- a/immich_carddav_sync/immich_client/api/authentication/change_password.py +++ b/immich_carddav_sync/immich_client/api/authentication/change_password.py @@ -6,30 +6,35 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.change_password_dto import ChangePasswordDto -from ...models.user_response_dto import UserResponseDto +from ...models.user_admin_response_dto import UserAdminResponseDto from ...types import Response def _get_kwargs( *, - json_body: ChangePasswordDto, + body: ChangePasswordDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth/change-password", - "json": json_json_body, } + _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[UserResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = UserResponseDto.from_dict(response.json()) +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) return response_200 if client.raise_on_unexpected_status: @@ -40,7 +45,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UserResponseDto]: +) -> Response[UserAdminResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -52,22 +57,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - json_body: ChangePasswordDto, -) -> Response[UserResponseDto]: + body: ChangePasswordDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (ChangePasswordDto): + body (ChangePasswordDto): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -80,45 +85,45 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - json_body: ChangePasswordDto, -) -> Optional[UserResponseDto]: + body: ChangePasswordDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (ChangePasswordDto): + body (ChangePasswordDto): Raises: errors.UnexpectedStatus: If the server 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 + UserAdminResponseDto """ return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, - json_body: ChangePasswordDto, -) -> Response[UserResponseDto]: + body: ChangePasswordDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (ChangePasswordDto): + body (ChangePasswordDto): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -129,23 +134,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - json_body: ChangePasswordDto, -) -> Optional[UserResponseDto]: + body: ChangePasswordDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (ChangePasswordDto): + body (ChangePasswordDto): Raises: errors.UnexpectedStatus: If the server 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 + UserAdminResponseDto """ return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/authentication/get_auth_devices.py b/immich_carddav_sync/immich_client/api/authentication/get_auth_devices.py deleted file mode 100644 index 4253e70..0000000 --- a/immich_carddav_sync/immich_client/api/authentication/get_auth_devices.py +++ /dev/null @@ -1,127 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.auth_device_response_dto import AuthDeviceResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/auth/devices", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AuthDeviceResponseDto"]]: - if response.status_code == HTTPStatus.OK: - response_200 = [] - _response_200 = response.json() - for response_200_item_data in _response_200: - response_200_item = AuthDeviceResponseDto.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["AuthDeviceResponseDto"]]: - 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["AuthDeviceResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['AuthDeviceResponseDto']] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[List["AuthDeviceResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['AuthDeviceResponseDto'] - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[List["AuthDeviceResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server returns 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['AuthDeviceResponseDto']] - """ - - 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["AuthDeviceResponseDto"]]: - """ - Raises: - errors.UnexpectedStatus: If the server 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['AuthDeviceResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/authentication/login.py b/immich_carddav_sync/immich_client/api/authentication/login.py index 2b892c5..fa46c84 100644 --- a/immich_carddav_sync/immich_client/api/authentication/login.py +++ b/immich_carddav_sync/immich_client/api/authentication/login.py @@ -12,23 +12,28 @@ def _get_kwargs( *, - json_body: LoginCredentialDto, + body: LoginCredentialDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth/login", - "json": json_json_body, } + _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[LoginResponseDto]: - if response.status_code == HTTPStatus.CREATED: + if response.status_code == 201: response_201 = LoginResponseDto.from_dict(response.json()) return response_201 @@ -52,11 +57,11 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: LoginCredentialDto, + body: LoginCredentialDto, ) -> Response[LoginResponseDto]: """ Args: - json_body (LoginCredentialDto): + body (LoginCredentialDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -67,7 +72,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -80,11 +85,11 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: LoginCredentialDto, + body: LoginCredentialDto, ) -> Optional[LoginResponseDto]: """ Args: - json_body (LoginCredentialDto): + body (LoginCredentialDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,18 +101,18 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: LoginCredentialDto, + body: LoginCredentialDto, ) -> Response[LoginResponseDto]: """ Args: - json_body (LoginCredentialDto): + body (LoginCredentialDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,7 +123,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -129,11 +134,11 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: LoginCredentialDto, + body: LoginCredentialDto, ) -> Optional[LoginResponseDto]: """ Args: - json_body (LoginCredentialDto): + body (LoginCredentialDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,6 +151,6 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/authentication/logout.py b/immich_carddav_sync/immich_client/api/authentication/logout.py index c4aa678..4ae6a1f 100644 --- a/immich_carddav_sync/immich_client/api/authentication/logout.py +++ b/immich_carddav_sync/immich_client/api/authentication/logout.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth/logout", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[LogoutResponseDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = LogoutResponseDto.from_dict(response.json()) return response_200 diff --git a/immich_carddav_sync/immich_client/api/authentication/logout_auth_device.py b/immich_carddav_sync/immich_client/api/authentication/logout_auth_device.py deleted file mode 100644 index 6d945f0..0000000 --- a/immich_carddav_sync/immich_client/api/authentication/logout_auth_device.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/auth/devices/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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/authentication/logout_auth_devices.py b/immich_carddav_sync/immich_client/api/authentication/logout_auth_devices.py deleted file mode 100644 index 160cbd8..0000000 --- a/immich_carddav_sync/immich_client/api/authentication/logout_auth_devices.py +++ /dev/null @@ -1,77 +0,0 @@ -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]: - pass - - return { - "method": "delete", - "url": "/auth/devices", - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.NO_CONTENT: - 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/authentication/admin_sign_up.py b/immich_carddav_sync/immich_client/api/authentication/sign_up_admin.py similarity index 67% rename from immich_carddav_sync/immich_client/api/authentication/admin_sign_up.py rename to immich_carddav_sync/immich_client/api/authentication/sign_up_admin.py index 5172937..02b97d5 100644 --- a/immich_carddav_sync/immich_client/api/authentication/admin_sign_up.py +++ b/immich_carddav_sync/immich_client/api/authentication/sign_up_admin.py @@ -1,40 +1,42 @@ from http import HTTPStatus -from typing import Any, Dict, Optional, Union, cast +from typing import Any, Dict, Optional, Union import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.admin_signup_response_dto import AdminSignupResponseDto from ...models.sign_up_dto import SignUpDto +from ...models.user_admin_response_dto import UserAdminResponseDto from ...types import Response def _get_kwargs( *, - json_body: SignUpDto, + body: SignUpDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth/admin-sign-up", - "json": json_json_body, } + _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[Union[AdminSignupResponseDto, Any]]: - if response.status_code == HTTPStatus.CREATED: - response_201 = AdminSignupResponseDto.from_dict(response.json()) +) -> Optional[UserAdminResponseDto]: + if response.status_code == 201: + response_201 = UserAdminResponseDto.from_dict(response.json()) return response_201 - if response.status_code == HTTPStatus.BAD_REQUEST: - response_400 = cast(Any, None) - return response_400 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -43,7 +45,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[AdminSignupResponseDto, Any]]: +) -> Response[UserAdminResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,22 +57,22 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: SignUpDto, -) -> Response[Union[AdminSignupResponseDto, Any]]: + body: SignUpDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (SignUpDto): + body (SignUpDto): Raises: errors.UnexpectedStatus: If the server returns 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[AdminSignupResponseDto, Any]] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -83,45 +85,45 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: SignUpDto, -) -> Optional[Union[AdminSignupResponseDto, Any]]: + body: SignUpDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (SignUpDto): + body (SignUpDto): Raises: errors.UnexpectedStatus: If the server 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[AdminSignupResponseDto, Any] + UserAdminResponseDto """ return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: SignUpDto, -) -> Response[Union[AdminSignupResponseDto, Any]]: + body: SignUpDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (SignUpDto): + body (SignUpDto): Raises: errors.UnexpectedStatus: If the server returns 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[AdminSignupResponseDto, Any]] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -132,23 +134,23 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: SignUpDto, -) -> Optional[Union[AdminSignupResponseDto, Any]]: + body: SignUpDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (SignUpDto): + body (SignUpDto): Raises: errors.UnexpectedStatus: If the server 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[AdminSignupResponseDto, Any] + UserAdminResponseDto """ return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/authentication/validate_access_token.py b/immich_carddav_sync/immich_client/api/authentication/validate_access_token.py index e4878e2..9b2e977 100644 --- a/immich_carddav_sync/immich_client/api/authentication/validate_access_token.py +++ b/immich_carddav_sync/immich_client/api/authentication/validate_access_token.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/auth/validateToken", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ValidateAccessTokenResponseDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = ValidateAccessTokenResponseDto.from_dict(response.json()) return response_200 diff --git a/immich_carddav_sync/immich_client/api/job/__init__.py b/immich_carddav_sync/immich_client/api/job/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/job/get_all_jobs_status.py b/immich_carddav_sync/immich_client/api/job/get_all_jobs_status.py deleted file mode 100644 index bba4530..0000000 --- a/immich_carddav_sync/immich_client/api/job/get_all_jobs_status.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/jobs", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AllJobStatusResponseDto]: - if response.status_code == HTTPStatus.OK: - 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/job/send_job_command.py b/immich_carddav_sync/immich_client/api/job/send_job_command.py deleted file mode 100644 index c6c8bdb..0000000 --- a/immich_carddav_sync/immich_client/api/job/send_job_command.py +++ /dev/null @@ -1,163 +0,0 @@ -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, - *, - json_body: JobCommandDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/jobs/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[JobStatusDto]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: JobCommandDto, -) -> Response[JobStatusDto]: - """ - Args: - id (JobName): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: JobName, - *, - client: AuthenticatedClient, - json_body: JobCommandDto, -) -> Optional[JobStatusDto]: - """ - Args: - id (JobName): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: JobName, - *, - client: AuthenticatedClient, - json_body: JobCommandDto, -) -> Response[JobStatusDto]: - """ - Args: - id (JobName): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: JobName, - *, - client: AuthenticatedClient, - json_body: JobCommandDto, -) -> Optional[JobStatusDto]: - """ - Args: - id (JobName): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/o_auth/callback.py b/immich_carddav_sync/immich_client/api/o_auth/finish_o_auth.py similarity index 84% rename from immich_carddav_sync/immich_client/api/o_auth/callback.py rename to immich_carddav_sync/immich_client/api/o_auth/finish_o_auth.py index da00ee7..9910a52 100644 --- a/immich_carddav_sync/immich_client/api/o_auth/callback.py +++ b/immich_carddav_sync/immich_client/api/o_auth/finish_o_auth.py @@ -12,23 +12,28 @@ def _get_kwargs( *, - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/oauth/callback", - "json": json_json_body, } + _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[LoginResponseDto]: - if response.status_code == HTTPStatus.CREATED: + if response.status_code == 201: response_201 = LoginResponseDto.from_dict(response.json()) return response_201 @@ -52,11 +57,11 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Response[LoginResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -67,7 +72,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -80,11 +85,11 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Optional[LoginResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,18 +101,18 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Response[LoginResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,7 +123,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -129,11 +134,11 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Optional[LoginResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,6 +151,6 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/o_auth/link.py b/immich_carddav_sync/immich_client/api/o_auth/link_o_auth_account.py similarity index 71% rename from immich_carddav_sync/immich_client/api/o_auth/link.py rename to immich_carddav_sync/immich_client/api/o_auth/link_o_auth_account.py index 8e754af..a827935 100644 --- a/immich_carddav_sync/immich_client/api/o_auth/link.py +++ b/immich_carddav_sync/immich_client/api/o_auth/link_o_auth_account.py @@ -6,30 +6,35 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.o_auth_callback_dto import OAuthCallbackDto -from ...models.user_response_dto import UserResponseDto +from ...models.user_admin_response_dto import UserAdminResponseDto from ...types import Response def _get_kwargs( *, - json_body: OAuthCallbackDto, + body: OAuthCallbackDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/oauth/link", - "json": json_json_body, } + _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[UserResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = UserResponseDto.from_dict(response.json()) +) -> Optional[UserAdminResponseDto]: + if response.status_code == 201: + response_201 = UserAdminResponseDto.from_dict(response.json()) return response_201 if client.raise_on_unexpected_status: @@ -40,7 +45,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UserResponseDto]: +) -> Response[UserAdminResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -52,22 +57,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - json_body: OAuthCallbackDto, -) -> Response[UserResponseDto]: + body: OAuthCallbackDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -80,45 +85,45 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - json_body: OAuthCallbackDto, -) -> Optional[UserResponseDto]: + body: OAuthCallbackDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server 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 + UserAdminResponseDto """ return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, - json_body: OAuthCallbackDto, -) -> Response[UserResponseDto]: + body: OAuthCallbackDto, +) -> Response[UserAdminResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -129,23 +134,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - json_body: OAuthCallbackDto, -) -> Optional[UserResponseDto]: + body: OAuthCallbackDto, +) -> Optional[UserAdminResponseDto]: """ Args: - json_body (OAuthCallbackDto): + body (OAuthCallbackDto): Raises: errors.UnexpectedStatus: If the server 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 + UserAdminResponseDto """ return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/o_auth/mobile_redirect.py b/immich_carddav_sync/immich_client/api/o_auth/redirect_o_auth_to_mobile.py similarity index 95% rename from immich_carddav_sync/immich_client/api/o_auth/mobile_redirect.py rename to immich_carddav_sync/immich_client/api/o_auth/redirect_o_auth_to_mobile.py index 4f40de4..f30a0a4 100644 --- a/immich_carddav_sync/immich_client/api/o_auth/mobile_redirect.py +++ b/immich_carddav_sync/immich_client/api/o_auth/redirect_o_auth_to_mobile.py @@ -9,16 +9,16 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/oauth/mobile-redirect", } + return _kwargs + def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: return None if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) diff --git a/immich_carddav_sync/immich_client/api/o_auth/generate_config.py b/immich_carddav_sync/immich_client/api/o_auth/start_o_auth.py similarity index 69% rename from immich_carddav_sync/immich_client/api/o_auth/generate_config.py rename to immich_carddav_sync/immich_client/api/o_auth/start_o_auth.py index 4e4e15b..5ef2f59 100644 --- a/immich_carddav_sync/immich_client/api/o_auth/generate_config.py +++ b/immich_carddav_sync/immich_client/api/o_auth/start_o_auth.py @@ -5,31 +5,36 @@ from ... import errors from ...client import AuthenticatedClient, Client +from ...models.o_auth_authorize_response_dto import OAuthAuthorizeResponseDto from ...models.o_auth_config_dto import OAuthConfigDto -from ...models.o_auth_config_response_dto import OAuthConfigResponseDto from ...types import Response def _get_kwargs( *, - json_body: OAuthConfigDto, + body: OAuthConfigDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "post", - "url": "/oauth/config", - "json": json_json_body, + "url": "/oauth/authorize", } + _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[OAuthConfigResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = OAuthConfigResponseDto.from_dict(response.json()) +) -> Optional[OAuthAuthorizeResponseDto]: + if response.status_code == 201: + response_201 = OAuthAuthorizeResponseDto.from_dict(response.json()) return response_201 if client.raise_on_unexpected_status: @@ -40,7 +45,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[OAuthConfigResponseDto]: +) -> Response[OAuthAuthorizeResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -52,22 +57,22 @@ def _build_response( def sync_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthConfigDto, -) -> Response[OAuthConfigResponseDto]: + body: OAuthConfigDto, +) -> Response[OAuthAuthorizeResponseDto]: """ Args: - json_body (OAuthConfigDto): + body (OAuthConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OAuthConfigResponseDto] + Response[OAuthAuthorizeResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -80,45 +85,45 @@ def sync_detailed( def sync( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthConfigDto, -) -> Optional[OAuthConfigResponseDto]: + body: OAuthConfigDto, +) -> Optional[OAuthAuthorizeResponseDto]: """ Args: - json_body (OAuthConfigDto): + body (OAuthConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OAuthConfigResponseDto + OAuthAuthorizeResponseDto """ return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthConfigDto, -) -> Response[OAuthConfigResponseDto]: + body: OAuthConfigDto, +) -> Response[OAuthAuthorizeResponseDto]: """ Args: - json_body (OAuthConfigDto): + body (OAuthConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[OAuthConfigResponseDto] + Response[OAuthAuthorizeResponseDto] """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -129,23 +134,23 @@ async def asyncio_detailed( async def asyncio( *, client: Union[AuthenticatedClient, Client], - json_body: OAuthConfigDto, -) -> Optional[OAuthConfigResponseDto]: + body: OAuthConfigDto, +) -> Optional[OAuthAuthorizeResponseDto]: """ Args: - json_body (OAuthConfigDto): + body (OAuthConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - OAuthConfigResponseDto + OAuthAuthorizeResponseDto """ return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/o_auth/unlink.py b/immich_carddav_sync/immich_client/api/o_auth/unlink_o_auth_account.py similarity index 80% rename from immich_carddav_sync/immich_client/api/o_auth/unlink.py rename to immich_carddav_sync/immich_client/api/o_auth/unlink_o_auth_account.py index cd5832d..42574ec 100644 --- a/immich_carddav_sync/immich_client/api/o_auth/unlink.py +++ b/immich_carddav_sync/immich_client/api/o_auth/unlink_o_auth_account.py @@ -5,26 +5,26 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.user_response_dto import UserResponseDto +from ...models.user_admin_response_dto import UserAdminResponseDto from ...types import Response def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "post", "url": "/oauth/unlink", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = UserResponseDto.from_dict(response.json()) +) -> Optional[UserAdminResponseDto]: + if response.status_code == 200: + response_200 = UserAdminResponseDto.from_dict(response.json()) - return response_201 + return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -33,7 +33,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UserResponseDto]: +) -> Response[UserAdminResponseDto]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,14 +45,14 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[UserResponseDto]: +) -> 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[UserResponseDto] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs() @@ -67,14 +67,14 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[UserResponseDto]: +) -> 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: - UserResponseDto + UserAdminResponseDto """ return sync_detailed( @@ -85,14 +85,14 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[UserResponseDto]: +) -> 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[UserResponseDto] + Response[UserAdminResponseDto] """ kwargs = _get_kwargs() @@ -105,14 +105,14 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[UserResponseDto]: +) -> 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: - UserResponseDto + UserAdminResponseDto """ return ( diff --git a/immich_carddav_sync/immich_client/api/partner/__init__.py b/immich_carddav_sync/immich_client/api/partner/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/partner/create_partner.py b/immich_carddav_sync/immich_client/api/partner/create_partner.py deleted file mode 100644 index fb71088..0000000 --- a/immich_carddav_sync/immich_client/api/partner/create_partner.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "post", - "url": "/partner/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = UserResponseDto.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[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: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[UserResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/partner/remove_partner.py b/immich_carddav_sync/immich_client/api/partner/remove_partner.py deleted file mode 100644 index 5d2730a..0000000 --- a/immich_carddav_sync/immich_client/api/partner/remove_partner.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/partner/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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/person/__init__.py b/immich_carddav_sync/immich_client/api/person/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/person/get_all_people.py b/immich_carddav_sync/immich_client/api/person/get_all_people.py deleted file mode 100644 index ce8187d..0000000 --- a/immich_carddav_sync/immich_client/api/person/get_all_people.py +++ /dev/null @@ -1,153 +0,0 @@ -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( - *, - with_hidden: Union[Unset, None, bool] = False, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["withHidden"] = with_hidden - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/person", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PeopleResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, - with_hidden: Union[Unset, None, bool] = False, -) -> Response[PeopleResponseDto]: - """ - Args: - with_hidden (Union[Unset, None, 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( - with_hidden=with_hidden, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - with_hidden: Union[Unset, None, bool] = False, -) -> Optional[PeopleResponseDto]: - """ - Args: - with_hidden (Union[Unset, None, 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, - with_hidden=with_hidden, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - with_hidden: Union[Unset, None, bool] = False, -) -> Response[PeopleResponseDto]: - """ - Args: - with_hidden (Union[Unset, None, 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( - 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, - with_hidden: Union[Unset, None, bool] = False, -) -> Optional[PeopleResponseDto]: - """ - Args: - with_hidden (Union[Unset, None, 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, - with_hidden=with_hidden, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/person/get_person.py b/immich_carddav_sync/immich_client/api/person/get_person.py deleted file mode 100644 index a0ad3f7..0000000 --- a/immich_carddav_sync/immich_client/api/person/get_person.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -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: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/person/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PersonResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[PersonResponseDto]: - """ - Args: - 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[PersonResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[PersonResponseDto]: - """ - Args: - 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: - PersonResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[PersonResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[PersonResponseDto]: - """ - Args: - 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: - PersonResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/person/get_person_assets.py b/immich_carddav_sync/immich_client/api/person/get_person_assets.py deleted file mode 100644 index 5ded87c..0000000 --- a/immich_carddav_sync/immich_client/api/person/get_person_assets.py +++ /dev/null @@ -1,153 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/person/{id}/assets".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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( - id: str, - *, - client: AuthenticatedClient, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto']] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto'] - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto']] - """ - - 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: str, - *, - client: AuthenticatedClient, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto'] - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/person/get_person_thumbnail.py b/immich_carddav_sync/immich_client/api/person/get_person_thumbnail.py deleted file mode 100644 index 948dfc0..0000000 --- a/immich_carddav_sync/immich_client/api/person/get_person_thumbnail.py +++ /dev/null @@ -1,91 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/person/{id}/thumbnail".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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/person/merge_person.py b/immich_carddav_sync/immich_client/api/person/merge_person.py deleted file mode 100644 index b214777..0000000 --- a/immich_carddav_sync/immich_client/api/person/merge_person.py +++ /dev/null @@ -1,171 +0,0 @@ -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.merge_person_dto import MergePersonDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: MergePersonDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/person/{id}/merge".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["BulkIdResponseDto"]]: - if response.status_code == HTTPStatus.CREATED: - 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: str, - *, - client: AuthenticatedClient, - json_body: MergePersonDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: MergePersonDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: MergePersonDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: MergePersonDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/person/update_people.py b/immich_carddav_sync/immich_client/api/person/update_people.py deleted file mode 100644 index 14b49ce..0000000 --- a/immich_carddav_sync/immich_client/api/person/update_people.py +++ /dev/null @@ -1,156 +0,0 @@ -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( - *, - json_body: PeopleUpdateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/person", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["BulkIdResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - json_body: PeopleUpdateDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: PeopleUpdateDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: PeopleUpdateDto, -) -> Response[List["BulkIdResponseDto"]]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: PeopleUpdateDto, -) -> Optional[List["BulkIdResponseDto"]]: - """ - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/person/update_person.py b/immich_carddav_sync/immich_client/api/person/update_person.py deleted file mode 100644 index 13d5196..0000000 --- a/immich_carddav_sync/immich_client/api/person/update_person.py +++ /dev/null @@ -1,166 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -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: str, - *, - json_body: PersonUpdateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/person/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PersonResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: PersonUpdateDto, -) -> Response[PersonResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: PersonUpdateDto, -) -> Optional[PersonResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: PersonUpdateDto, -) -> Response[PersonResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: PersonUpdateDto, -) -> Optional[PersonResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/get_explore_data.py b/immich_carddav_sync/immich_client/api/search/get_explore_data.py index cc74dee..b660561 100644 --- a/immich_carddav_sync/immich_client/api/search/get_explore_data.py +++ b/immich_carddav_sync/immich_client/api/search/get_explore_data.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/search/explore", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[List["SearchExploreResponseDto"]]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = [] _response_200 = response.json() for response_200_item_data in _response_200: diff --git a/immich_carddav_sync/immich_client/api/search/get_search_config.py b/immich_carddav_sync/immich_client/api/search/get_search_config.py deleted file mode 100644 index a767056..0000000 --- a/immich_carddav_sync/immich_client/api/search/get_search_config.py +++ /dev/null @@ -1,122 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.search_config_response_dto import SearchConfigResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/search/config", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SearchConfigResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = SearchConfigResponseDto.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[SearchConfigResponseDto]: - 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[SearchConfigResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchConfigResponseDto] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[SearchConfigResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchConfigResponseDto - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[SearchConfigResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[SearchConfigResponseDto] - """ - - 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[SearchConfigResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - SearchConfigResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/search/search.py b/immich_carddav_sync/immich_client/api/search/search.py deleted file mode 100644 index bedefe7..0000000 --- a/immich_carddav_sync/immich_client/api/search/search.py +++ /dev/null @@ -1,397 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, List, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.search_response_dto import SearchResponseDto -from ...models.search_type import SearchType -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - q: Union[Unset, None, str] = UNSET, - query: Union[Unset, None, str] = UNSET, - clip: Union[Unset, None, bool] = UNSET, - type: Union[Unset, None, SearchType] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - exif_info_city: Union[Unset, None, str] = UNSET, - exif_info_state: Union[Unset, None, str] = UNSET, - exif_info_country: Union[Unset, None, str] = UNSET, - exif_info_make: Union[Unset, None, str] = UNSET, - exif_info_model: Union[Unset, None, str] = UNSET, - exif_info_projection_type: Union[Unset, None, str] = UNSET, - smart_info_objects: Union[Unset, None, List[str]] = UNSET, - smart_info_tags: Union[Unset, None, List[str]] = UNSET, - recent: Union[Unset, None, bool] = UNSET, - motion: Union[Unset, None, bool] = UNSET, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["q"] = q - - params["query"] = query - - params["clip"] = clip - - json_type: Union[Unset, None, str] = UNSET - if not isinstance(type, Unset): - json_type = type.value if type else None - - params["type"] = json_type - - params["isFavorite"] = is_favorite - - params["isArchived"] = is_archived - - params["exifInfo.city"] = exif_info_city - - params["exifInfo.state"] = exif_info_state - - params["exifInfo.country"] = exif_info_country - - params["exifInfo.make"] = exif_info_make - - params["exifInfo.model"] = exif_info_model - - params["exifInfo.projectionType"] = exif_info_projection_type - - json_smart_info_objects: Union[Unset, None, List[str]] = UNSET - if not isinstance(smart_info_objects, Unset): - if smart_info_objects is None: - json_smart_info_objects = None - else: - json_smart_info_objects = smart_info_objects - - params["smartInfo.objects"] = json_smart_info_objects - - json_smart_info_tags: Union[Unset, None, List[str]] = UNSET - if not isinstance(smart_info_tags, Unset): - if smart_info_tags is None: - json_smart_info_tags = None - else: - json_smart_info_tags = smart_info_tags - - params["smartInfo.tags"] = json_smart_info_tags - - params["recent"] = recent - - params["motion"] = motion - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/search", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SearchResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, - q: Union[Unset, None, str] = UNSET, - query: Union[Unset, None, str] = UNSET, - clip: Union[Unset, None, bool] = UNSET, - type: Union[Unset, None, SearchType] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - exif_info_city: Union[Unset, None, str] = UNSET, - exif_info_state: Union[Unset, None, str] = UNSET, - exif_info_country: Union[Unset, None, str] = UNSET, - exif_info_make: Union[Unset, None, str] = UNSET, - exif_info_model: Union[Unset, None, str] = UNSET, - exif_info_projection_type: Union[Unset, None, str] = UNSET, - smart_info_objects: Union[Unset, None, List[str]] = UNSET, - smart_info_tags: Union[Unset, None, List[str]] = UNSET, - recent: Union[Unset, None, bool] = UNSET, - motion: Union[Unset, None, bool] = UNSET, -) -> Response[SearchResponseDto]: - """ - Args: - q (Union[Unset, None, str]): - query (Union[Unset, None, str]): - clip (Union[Unset, None, bool]): - type (Union[Unset, None, SearchType]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - exif_info_city (Union[Unset, None, str]): - exif_info_state (Union[Unset, None, str]): - exif_info_country (Union[Unset, None, str]): - exif_info_make (Union[Unset, None, str]): - exif_info_model (Union[Unset, None, str]): - exif_info_projection_type (Union[Unset, None, str]): - smart_info_objects (Union[Unset, None, List[str]]): - smart_info_tags (Union[Unset, None, List[str]]): - recent (Union[Unset, None, bool]): - motion (Union[Unset, None, 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[SearchResponseDto] - """ - - kwargs = _get_kwargs( - q=q, - query=query, - clip=clip, - type=type, - is_favorite=is_favorite, - is_archived=is_archived, - exif_info_city=exif_info_city, - exif_info_state=exif_info_state, - exif_info_country=exif_info_country, - exif_info_make=exif_info_make, - exif_info_model=exif_info_model, - exif_info_projection_type=exif_info_projection_type, - smart_info_objects=smart_info_objects, - smart_info_tags=smart_info_tags, - recent=recent, - motion=motion, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - q: Union[Unset, None, str] = UNSET, - query: Union[Unset, None, str] = UNSET, - clip: Union[Unset, None, bool] = UNSET, - type: Union[Unset, None, SearchType] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - exif_info_city: Union[Unset, None, str] = UNSET, - exif_info_state: Union[Unset, None, str] = UNSET, - exif_info_country: Union[Unset, None, str] = UNSET, - exif_info_make: Union[Unset, None, str] = UNSET, - exif_info_model: Union[Unset, None, str] = UNSET, - exif_info_projection_type: Union[Unset, None, str] = UNSET, - smart_info_objects: Union[Unset, None, List[str]] = UNSET, - smart_info_tags: Union[Unset, None, List[str]] = UNSET, - recent: Union[Unset, None, bool] = UNSET, - motion: Union[Unset, None, bool] = UNSET, -) -> Optional[SearchResponseDto]: - """ - Args: - q (Union[Unset, None, str]): - query (Union[Unset, None, str]): - clip (Union[Unset, None, bool]): - type (Union[Unset, None, SearchType]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - exif_info_city (Union[Unset, None, str]): - exif_info_state (Union[Unset, None, str]): - exif_info_country (Union[Unset, None, str]): - exif_info_make (Union[Unset, None, str]): - exif_info_model (Union[Unset, None, str]): - exif_info_projection_type (Union[Unset, None, str]): - smart_info_objects (Union[Unset, None, List[str]]): - smart_info_tags (Union[Unset, None, List[str]]): - recent (Union[Unset, None, bool]): - motion (Union[Unset, None, 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: - SearchResponseDto - """ - - return sync_detailed( - client=client, - q=q, - query=query, - clip=clip, - type=type, - is_favorite=is_favorite, - is_archived=is_archived, - exif_info_city=exif_info_city, - exif_info_state=exif_info_state, - exif_info_country=exif_info_country, - exif_info_make=exif_info_make, - exif_info_model=exif_info_model, - exif_info_projection_type=exif_info_projection_type, - smart_info_objects=smart_info_objects, - smart_info_tags=smart_info_tags, - recent=recent, - motion=motion, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - q: Union[Unset, None, str] = UNSET, - query: Union[Unset, None, str] = UNSET, - clip: Union[Unset, None, bool] = UNSET, - type: Union[Unset, None, SearchType] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - exif_info_city: Union[Unset, None, str] = UNSET, - exif_info_state: Union[Unset, None, str] = UNSET, - exif_info_country: Union[Unset, None, str] = UNSET, - exif_info_make: Union[Unset, None, str] = UNSET, - exif_info_model: Union[Unset, None, str] = UNSET, - exif_info_projection_type: Union[Unset, None, str] = UNSET, - smart_info_objects: Union[Unset, None, List[str]] = UNSET, - smart_info_tags: Union[Unset, None, List[str]] = UNSET, - recent: Union[Unset, None, bool] = UNSET, - motion: Union[Unset, None, bool] = UNSET, -) -> Response[SearchResponseDto]: - """ - Args: - q (Union[Unset, None, str]): - query (Union[Unset, None, str]): - clip (Union[Unset, None, bool]): - type (Union[Unset, None, SearchType]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - exif_info_city (Union[Unset, None, str]): - exif_info_state (Union[Unset, None, str]): - exif_info_country (Union[Unset, None, str]): - exif_info_make (Union[Unset, None, str]): - exif_info_model (Union[Unset, None, str]): - exif_info_projection_type (Union[Unset, None, str]): - smart_info_objects (Union[Unset, None, List[str]]): - smart_info_tags (Union[Unset, None, List[str]]): - recent (Union[Unset, None, bool]): - motion (Union[Unset, None, 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[SearchResponseDto] - """ - - kwargs = _get_kwargs( - q=q, - query=query, - clip=clip, - type=type, - is_favorite=is_favorite, - is_archived=is_archived, - exif_info_city=exif_info_city, - exif_info_state=exif_info_state, - exif_info_country=exif_info_country, - exif_info_make=exif_info_make, - exif_info_model=exif_info_model, - exif_info_projection_type=exif_info_projection_type, - smart_info_objects=smart_info_objects, - smart_info_tags=smart_info_tags, - recent=recent, - motion=motion, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - q: Union[Unset, None, str] = UNSET, - query: Union[Unset, None, str] = UNSET, - clip: Union[Unset, None, bool] = UNSET, - type: Union[Unset, None, SearchType] = UNSET, - is_favorite: Union[Unset, None, bool] = UNSET, - is_archived: Union[Unset, None, bool] = UNSET, - exif_info_city: Union[Unset, None, str] = UNSET, - exif_info_state: Union[Unset, None, str] = UNSET, - exif_info_country: Union[Unset, None, str] = UNSET, - exif_info_make: Union[Unset, None, str] = UNSET, - exif_info_model: Union[Unset, None, str] = UNSET, - exif_info_projection_type: Union[Unset, None, str] = UNSET, - smart_info_objects: Union[Unset, None, List[str]] = UNSET, - smart_info_tags: Union[Unset, None, List[str]] = UNSET, - recent: Union[Unset, None, bool] = UNSET, - motion: Union[Unset, None, bool] = UNSET, -) -> Optional[SearchResponseDto]: - """ - Args: - q (Union[Unset, None, str]): - query (Union[Unset, None, str]): - clip (Union[Unset, None, bool]): - type (Union[Unset, None, SearchType]): - is_favorite (Union[Unset, None, bool]): - is_archived (Union[Unset, None, bool]): - exif_info_city (Union[Unset, None, str]): - exif_info_state (Union[Unset, None, str]): - exif_info_country (Union[Unset, None, str]): - exif_info_make (Union[Unset, None, str]): - exif_info_model (Union[Unset, None, str]): - exif_info_projection_type (Union[Unset, None, str]): - smart_info_objects (Union[Unset, None, List[str]]): - smart_info_tags (Union[Unset, None, List[str]]): - recent (Union[Unset, None, bool]): - motion (Union[Unset, None, 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: - SearchResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - q=q, - query=query, - clip=clip, - type=type, - is_favorite=is_favorite, - is_archived=is_archived, - exif_info_city=exif_info_city, - exif_info_state=exif_info_state, - exif_info_country=exif_info_country, - exif_info_make=exif_info_make, - exif_info_model=exif_info_model, - exif_info_projection_type=exif_info_projection_type, - smart_info_objects=smart_info_objects, - smart_info_tags=smart_info_tags, - recent=recent, - motion=motion, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/partner/get_partners.py b/immich_carddav_sync/immich_client/api/search/search_person.py similarity index 65% rename from immich_carddav_sync/immich_client/api/partner/get_partners.py rename to immich_carddav_sync/immich_client/api/search/search_person.py index e27af1a..117991d 100644 --- a/immich_carddav_sync/immich_client/api/partner/get_partners.py +++ b/immich_carddav_sync/immich_client/api/search/search_person.py @@ -5,39 +5,40 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.get_partners_direction import GetPartnersDirection -from ...models.user_response_dto import UserResponseDto -from ...types import UNSET, Response +from ...models.person_response_dto import PersonResponseDto +from ...types import UNSET, Response, Unset def _get_kwargs( *, - direction: GetPartnersDirection, + name: str, + with_hidden: Union[Unset, bool] = UNSET, ) -> Dict[str, Any]: - pass - params: Dict[str, Any] = {} - json_direction = direction.value - params["direction"] = json_direction + params["name"] = name + + params["withHidden"] = with_hidden params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { + _kwargs: Dict[str, Any] = { "method": "get", - "url": "/partner", + "url": "/search/person", "params": params, } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["UserResponseDto"]]: - if response.status_code == HTTPStatus.OK: +) -> 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 = UserResponseDto.from_dict(response_200_item_data) + response_200_item = PersonResponseDto.from_dict(response_200_item_data) response_200.append(response_200_item) @@ -50,7 +51,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[List["UserResponseDto"]]: +) -> Response[List["PersonResponseDto"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,22 +63,25 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - direction: GetPartnersDirection, -) -> Response[List["UserResponseDto"]]: + name: str, + with_hidden: Union[Unset, bool] = UNSET, +) -> Response[List["PersonResponseDto"]]: """ Args: - direction (GetPartnersDirection): + name (str): + 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[List['UserResponseDto']] + Response[List['PersonResponseDto']] """ kwargs = _get_kwargs( - direction=direction, + name=name, + with_hidden=with_hidden, ) response = client.get_httpx_client().request( @@ -90,45 +94,51 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - direction: GetPartnersDirection, -) -> Optional[List["UserResponseDto"]]: + name: str, + with_hidden: Union[Unset, bool] = UNSET, +) -> Optional[List["PersonResponseDto"]]: """ Args: - direction (GetPartnersDirection): + name (str): + 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: - List['UserResponseDto'] + List['PersonResponseDto'] """ return sync_detailed( client=client, - direction=direction, + name=name, + with_hidden=with_hidden, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, - direction: GetPartnersDirection, -) -> Response[List["UserResponseDto"]]: + name: str, + with_hidden: Union[Unset, bool] = UNSET, +) -> Response[List["PersonResponseDto"]]: """ Args: - direction (GetPartnersDirection): + name (str): + 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[List['UserResponseDto']] + Response[List['PersonResponseDto']] """ kwargs = _get_kwargs( - direction=direction, + name=name, + with_hidden=with_hidden, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -139,23 +149,26 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - direction: GetPartnersDirection, -) -> Optional[List["UserResponseDto"]]: + name: str, + with_hidden: Union[Unset, bool] = UNSET, +) -> Optional[List["PersonResponseDto"]]: """ Args: - direction (GetPartnersDirection): + name (str): + 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: - List['UserResponseDto'] + List['PersonResponseDto'] """ return ( await asyncio_detailed( client=client, - direction=direction, + name=name, + with_hidden=with_hidden, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/server_info/__init__.py b/immich_carddav_sync/immich_client/api/server_info/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/server_info/get_server_features.py b/immich_carddav_sync/immich_client/api/server_info/get_server_features.py deleted file mode 100644 index d4768ed..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/get_server_features.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/server-info/features", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerFeaturesDto]: - if response.status_code == HTTPStatus.OK: - 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_info/get_server_info.py b/immich_carddav_sync/immich_client/api/server_info/get_server_info.py deleted file mode 100644 index 89eea03..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/get_server_info.py +++ /dev/null @@ -1,122 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.server_info_response_dto import ServerInfoResponseDto -from ...types import Response - - -def _get_kwargs() -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/server-info", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerInfoResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = ServerInfoResponseDto.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[ServerInfoResponseDto]: - 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[ServerInfoResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ServerInfoResponseDto] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[ServerInfoResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ServerInfoResponseDto - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ServerInfoResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ServerInfoResponseDto] - """ - - 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[ServerInfoResponseDto]: - """ - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ServerInfoResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/server_info/get_server_version.py b/immich_carddav_sync/immich_client/api/server_info/get_server_version.py deleted file mode 100644 index 58d6efc..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/get_server_version.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/server-info/version", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerVersionResponseDto]: - if response.status_code == HTTPStatus.OK: - 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_info/get_stats.py b/immich_carddav_sync/immich_client/api/server_info/get_stats.py deleted file mode 100644 index ded4e35..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/get_stats.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/server-info/stats", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerStatsResponseDto]: - if response.status_code == HTTPStatus.OK: - 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_info/get_supported_media_types.py b/immich_carddav_sync/immich_client/api/server_info/get_supported_media_types.py deleted file mode 100644 index 599bf47..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/get_supported_media_types.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/server-info/media-types", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerMediaTypesResponseDto]: - if response.status_code == HTTPStatus.OK: - 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_info/ping_server.py b/immich_carddav_sync/immich_client/api/server_info/ping_server.py deleted file mode 100644 index e9e93ba..0000000 --- a/immich_carddav_sync/immich_client/api/server_info/ping_server.py +++ /dev/null @@ -1,122 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/server-info/ping", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ServerPingResponse]: - if response.status_code == HTTPStatus.OK: - 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/shared_link/__init__.py b/immich_carddav_sync/immich_client/api/shared_link/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/shared_link/add_shared_link_assets.py b/immich_carddav_sync/immich_client/api/shared_link/add_shared_link_assets.py deleted file mode 100644 index 291a9d9..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/add_shared_link_assets.py +++ /dev/null @@ -1,190 +0,0 @@ -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_ids_dto import AssetIdsDto -from ...models.asset_ids_response_dto import AssetIdsResponseDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - id: str, - *, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/shared-link/{id}/assets".format( - id=id, - ), - "json": json_json_body, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetIdsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_link/create_shared_link.py b/immich_carddav_sync/immich_client/api/shared_link/create_shared_link.py deleted file mode 100644 index 1d605a7..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/create_shared_link.py +++ /dev/null @@ -1,151 +0,0 @@ -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( - *, - json_body: SharedLinkCreateDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/shared-link", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SharedLinkResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - json_body: SharedLinkCreateDto, -) -> Response[SharedLinkResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: SharedLinkCreateDto, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: SharedLinkCreateDto, -) -> Response[SharedLinkResponseDto]: - """ - Args: - json_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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: SharedLinkCreateDto, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_link/get_all_shared_links.py b/immich_carddav_sync/immich_client/api/shared_link/get_all_shared_links.py deleted file mode 100644 index f4bb7af..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/get_all_shared_links.py +++ /dev/null @@ -1,127 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/shared-link", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["SharedLinkResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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_link/get_my_shared_link.py b/immich_carddav_sync/immich_client/api/shared_link/get_my_shared_link.py deleted file mode 100644 index 828dde9..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/get_my_shared_link.py +++ /dev/null @@ -1,153 +0,0 @@ -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, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - return { - "method": "get", - "url": "/shared-link/me", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SharedLinkResponseDto]: - if response.status_code == HTTPStatus.OK: - 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, None, str] = UNSET, -) -> Response[SharedLinkResponseDto]: - """ - Args: - key (Union[Unset, None, 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - key (Union[Unset, None, 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, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Response[SharedLinkResponseDto]: - """ - Args: - key (Union[Unset, None, 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, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - key: Union[Unset, None, str] = UNSET, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - key (Union[Unset, None, 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, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_link/get_shared_link_by_id.py b/immich_carddav_sync/immich_client/api/shared_link/get_shared_link_by_id.py deleted file mode 100644 index eb5f5ed..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/get_shared_link_by_id.py +++ /dev/null @@ -1,148 +0,0 @@ -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 Response - - -def _get_kwargs( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/shared-link/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SharedLinkResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[SharedLinkResponseDto]: - """ - Args: - 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[SharedLinkResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - 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: - SharedLinkResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[SharedLinkResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - 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: - SharedLinkResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_link/remove_shared_link.py b/immich_carddav_sync/immich_client/api/shared_link/remove_shared_link.py deleted file mode 100644 index 7678568..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/remove_shared_link.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/shared-link/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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_link/remove_shared_link_assets.py b/immich_carddav_sync/immich_client/api/shared_link/remove_shared_link_assets.py deleted file mode 100644 index 4c88d8a..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/remove_shared_link_assets.py +++ /dev/null @@ -1,190 +0,0 @@ -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_ids_dto import AssetIdsDto -from ...models.asset_ids_response_dto import AssetIdsResponseDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - id: str, - *, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - pass - - 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} - - json_json_body = json_body.to_dict() - - return { - "method": "delete", - "url": "/shared-link/{id}/assets".format( - id=id, - ), - "json": json_json_body, - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetIdsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, - key: Union[Unset, None, str] = UNSET, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - key (Union[Unset, None, str]): - json_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, - json_body=json_body, - key=key, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/shared_link/update_shared_link.py b/immich_carddav_sync/immich_client/api/shared_link/update_shared_link.py deleted file mode 100644 index 7aa78bf..0000000 --- a/immich_carddav_sync/immich_client/api/shared_link/update_shared_link.py +++ /dev/null @@ -1,166 +0,0 @@ -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_edit_dto import SharedLinkEditDto -from ...models.shared_link_response_dto import SharedLinkResponseDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: SharedLinkEditDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "patch", - "url": "/shared-link/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SharedLinkResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: SharedLinkEditDto, -) -> Response[SharedLinkResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: SharedLinkEditDto, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: SharedLinkEditDto, -) -> Response[SharedLinkResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: SharedLinkEditDto, -) -> Optional[SharedLinkResponseDto]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/system_config/get_config.py b/immich_carddav_sync/immich_client/api/system_config/get_config.py index a1f94bd..04e7fdc 100644 --- a/immich_carddav_sync/immich_client/api/system_config/get_config.py +++ b/immich_carddav_sync/immich_client/api/system_config/get_config.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/system-config", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[SystemConfigDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = SystemConfigDto.from_dict(response.json()) return response_200 diff --git a/immich_carddav_sync/immich_client/api/system_config/get_defaults.py b/immich_carddav_sync/immich_client/api/system_config/get_config_defaults.py similarity index 97% rename from immich_carddav_sync/immich_client/api/system_config/get_defaults.py rename to immich_carddav_sync/immich_client/api/system_config/get_config_defaults.py index 3998f57..02d9c59 100644 --- a/immich_carddav_sync/immich_client/api/system_config/get_defaults.py +++ b/immich_carddav_sync/immich_client/api/system_config/get_config_defaults.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/system-config/defaults", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[SystemConfigDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = SystemConfigDto.from_dict(response.json()) return response_200 diff --git a/immich_carddav_sync/immich_client/api/system_config/get_storage_template_options.py b/immich_carddav_sync/immich_client/api/system_config/get_storage_template_options.py index c7d13d3..4cddff7 100644 --- a/immich_carddav_sync/immich_client/api/system_config/get_storage_template_options.py +++ b/immich_carddav_sync/immich_client/api/system_config/get_storage_template_options.py @@ -10,18 +10,18 @@ def _get_kwargs() -> Dict[str, Any]: - pass - - return { + _kwargs: Dict[str, Any] = { "method": "get", "url": "/system-config/storage-template-options", } + return _kwargs + def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[SystemConfigTemplateStorageOptionDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = SystemConfigTemplateStorageOptionDto.from_dict(response.json()) return response_200 diff --git a/immich_carddav_sync/immich_client/api/system_config/update_config.py b/immich_carddav_sync/immich_client/api/system_config/update_config.py index d2ed800..af00404 100644 --- a/immich_carddav_sync/immich_client/api/system_config/update_config.py +++ b/immich_carddav_sync/immich_client/api/system_config/update_config.py @@ -11,23 +11,28 @@ def _get_kwargs( *, - json_body: SystemConfigDto, + body: SystemConfigDto, ) -> Dict[str, Any]: - pass + headers: Dict[str, Any] = {} - json_json_body = json_body.to_dict() - - return { + _kwargs: Dict[str, Any] = { "method": "put", "url": "/system-config", - "json": json_json_body, } + _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[SystemConfigDto]: - if response.status_code == HTTPStatus.OK: + if response.status_code == 200: response_200 = SystemConfigDto.from_dict(response.json()) return response_200 @@ -51,11 +56,11 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - json_body: SystemConfigDto, + body: SystemConfigDto, ) -> Response[SystemConfigDto]: """ Args: - json_body (SystemConfigDto): + body (SystemConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -66,7 +71,7 @@ def sync_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = client.get_httpx_client().request( @@ -79,11 +84,11 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - json_body: SystemConfigDto, + body: SystemConfigDto, ) -> Optional[SystemConfigDto]: """ Args: - json_body (SystemConfigDto): + body (SystemConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,18 +100,18 @@ def sync( return sync_detailed( client=client, - json_body=json_body, + body=body, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, - json_body: SystemConfigDto, + body: SystemConfigDto, ) -> Response[SystemConfigDto]: """ Args: - json_body (SystemConfigDto): + body (SystemConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -117,7 +122,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( - json_body=json_body, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -128,11 +133,11 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - json_body: SystemConfigDto, + body: SystemConfigDto, ) -> Optional[SystemConfigDto]: """ Args: - json_body (SystemConfigDto): + body (SystemConfigDto): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -145,6 +150,6 @@ async def asyncio( return ( await asyncio_detailed( client=client, - json_body=json_body, + body=body, ) ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/__init__.py b/immich_carddav_sync/immich_client/api/tag/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/tag/create_tag.py b/immich_carddav_sync/immich_client/api/tag/create_tag.py deleted file mode 100644 index 2295c7c..0000000 --- a/immich_carddav_sync/immich_client/api/tag/create_tag.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_tag_dto import CreateTagDto -from ...models.tag_response_dto import TagResponseDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: CreateTagDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/tag", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[TagResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - json_body: CreateTagDto, -) -> Response[TagResponseDto]: - """ - Args: - json_body (CreateTagDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: CreateTagDto, -) -> Optional[TagResponseDto]: - """ - Args: - json_body (CreateTagDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: CreateTagDto, -) -> Response[TagResponseDto]: - """ - Args: - json_body (CreateTagDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: CreateTagDto, -) -> Optional[TagResponseDto]: - """ - Args: - json_body (CreateTagDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/delete_tag.py b/immich_carddav_sync/immich_client/api/tag/delete_tag.py deleted file mode 100644 index 24bce34..0000000 --- a/immich_carddav_sync/immich_client/api/tag/delete_tag.py +++ /dev/null @@ -1,93 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/tag/{id}".format( - id=id, - ), - } - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[Any]: - """ - Args: - 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, - ) - - 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/tag/get_all_tags.py b/immich_carddav_sync/immich_client/api/tag/get_all_tags.py deleted file mode 100644 index 27c66c3..0000000 --- a/immich_carddav_sync/immich_client/api/tag/get_all_tags.py +++ /dev/null @@ -1,127 +0,0 @@ -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]: - pass - - return { - "method": "get", - "url": "/tag", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["TagResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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/tag/get_tag_assets.py b/immich_carddav_sync/immich_client/api/tag/get_tag_assets.py deleted file mode 100644 index 086246e..0000000 --- a/immich_carddav_sync/immich_client/api/tag/get_tag_assets.py +++ /dev/null @@ -1,153 +0,0 @@ -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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/tag/{id}/assets".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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( - id: str, - *, - client: AuthenticatedClient, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto']] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto'] - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto']] - """ - - 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: str, - *, - client: AuthenticatedClient, -) -> Optional[List["AssetResponseDto"]]: - """ - Args: - 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['AssetResponseDto'] - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/get_tag_by_id.py b/immich_carddav_sync/immich_client/api/tag/get_tag_by_id.py deleted file mode 100644 index c2834dd..0000000 --- a/immich_carddav_sync/immich_client/api/tag/get_tag_by_id.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/tag/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[TagResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[TagResponseDto]: - """ - Args: - 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[TagResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[TagResponseDto]: - """ - Args: - 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: - TagResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[TagResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[TagResponseDto]: - """ - Args: - 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: - TagResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/tag_assets.py b/immich_carddav_sync/immich_client/api/tag/tag_assets.py deleted file mode 100644 index c87059f..0000000 --- a/immich_carddav_sync/immich_client/api/tag/tag_assets.py +++ /dev/null @@ -1,171 +0,0 @@ -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_ids_dto import AssetIdsDto -from ...models.asset_ids_response_dto import AssetIdsResponseDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: AssetIdsDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/tag/{id}/assets".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetIdsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/untag_assets.py b/immich_carddav_sync/immich_client/api/tag/untag_assets.py deleted file mode 100644 index 8bb857f..0000000 --- a/immich_carddav_sync/immich_client/api/tag/untag_assets.py +++ /dev/null @@ -1,171 +0,0 @@ -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_ids_dto import AssetIdsDto -from ...models.asset_ids_response_dto import AssetIdsResponseDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: AssetIdsDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "delete", - "url": "/tag/{id}/assets".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["AssetIdsResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Response[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: AssetIdsDto, -) -> Optional[List["AssetIdsResponseDto"]]: - """ - Args: - id (str): - json_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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/tag/update_tag.py b/immich_carddav_sync/immich_client/api/tag/update_tag.py deleted file mode 100644 index dc7ed07..0000000 --- a/immich_carddav_sync/immich_client/api/tag/update_tag.py +++ /dev/null @@ -1,166 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.tag_response_dto import TagResponseDto -from ...models.update_tag_dto import UpdateTagDto -from ...types import Response - - -def _get_kwargs( - id: str, - *, - json_body: UpdateTagDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "patch", - "url": "/tag/{id}".format( - id=id, - ), - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[TagResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, - json_body: UpdateTagDto, -) -> Response[TagResponseDto]: - """ - Args: - id (str): - json_body (UpdateTagDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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, - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateTagDto, -) -> Optional[TagResponseDto]: - """ - Args: - id (str): - json_body (UpdateTagDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateTagDto, -) -> Response[TagResponseDto]: - """ - Args: - id (str): - json_body (UpdateTagDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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, - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - id: str, - *, - client: AuthenticatedClient, - json_body: UpdateTagDto, -) -> Optional[TagResponseDto]: - """ - Args: - id (str): - json_body (UpdateTagDto): - - Raises: - errors.UnexpectedStatus: If the server 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, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/__init__.py b/immich_carddav_sync/immich_client/api/user/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/immich_carddav_sync/immich_client/api/user/create_profile_image.py b/immich_carddav_sync/immich_client/api/user/create_profile_image.py deleted file mode 100644 index 08a2bb7..0000000 --- a/immich_carddav_sync/immich_client/api/user/create_profile_image.py +++ /dev/null @@ -1,151 +0,0 @@ -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( - *, - multipart_data: CreateProfileImageDto, -) -> Dict[str, Any]: - pass - - multipart_multipart_data = multipart_data.to_multipart() - - return { - "method": "post", - "url": "/user/profile-image", - "files": multipart_multipart_data, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateProfileImageResponseDto]: - if response.status_code == HTTPStatus.CREATED: - 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, - multipart_data: CreateProfileImageDto, -) -> Response[CreateProfileImageResponseDto]: - """ - Args: - multipart_data (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( - multipart_data=multipart_data, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - multipart_data: CreateProfileImageDto, -) -> Optional[CreateProfileImageResponseDto]: - """ - Args: - multipart_data (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, - multipart_data=multipart_data, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - multipart_data: CreateProfileImageDto, -) -> Response[CreateProfileImageResponseDto]: - """ - Args: - multipart_data (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( - multipart_data=multipart_data, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - multipart_data: CreateProfileImageDto, -) -> Optional[CreateProfileImageResponseDto]: - """ - Args: - multipart_data (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, - multipart_data=multipart_data, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/create_user.py b/immich_carddav_sync/immich_client/api/user/create_user.py deleted file mode 100644 index ddf9bcc..0000000 --- a/immich_carddav_sync/immich_client/api/user/create_user.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.create_user_dto import CreateUserDto -from ...models.user_response_dto import UserResponseDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: CreateUserDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "post", - "url": "/user", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = UserResponseDto.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[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, - json_body: CreateUserDto, -) -> Response[UserResponseDto]: - """ - Args: - json_body (CreateUserDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: CreateUserDto, -) -> Optional[UserResponseDto]: - """ - Args: - json_body (CreateUserDto): - - Raises: - errors.UnexpectedStatus: If the server 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( - client=client, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: CreateUserDto, -) -> Response[UserResponseDto]: - """ - Args: - json_body (CreateUserDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: CreateUserDto, -) -> Optional[UserResponseDto]: - """ - Args: - json_body (CreateUserDto): - - Raises: - errors.UnexpectedStatus: If the server 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( - client=client, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/delete_user.py b/immich_carddav_sync/immich_client/api/user/delete_user.py deleted file mode 100644 index 6c38d98..0000000 --- a/immich_carddav_sync/immich_client/api/user/delete_user.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "delete", - "url": "/user/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[UserResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/get_all_users.py b/immich_carddav_sync/immich_client/api/user/get_all_users.py deleted file mode 100644 index 52a140c..0000000 --- a/immich_carddav_sync/immich_client/api/user/get_all_users.py +++ /dev/null @@ -1,158 +0,0 @@ -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 UNSET, Response - - -def _get_kwargs( - *, - is_all: bool, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["isAll"] = is_all - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/user", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[List["UserResponseDto"]]: - if response.status_code == HTTPStatus.OK: - 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, - is_all: bool, -) -> Response[List["UserResponseDto"]]: - """ - Args: - is_all (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['UserResponseDto']] - """ - - kwargs = _get_kwargs( - is_all=is_all, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - is_all: bool, -) -> Optional[List["UserResponseDto"]]: - """ - Args: - is_all (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['UserResponseDto'] - """ - - return sync_detailed( - client=client, - is_all=is_all, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - is_all: bool, -) -> Response[List["UserResponseDto"]]: - """ - Args: - is_all (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['UserResponseDto']] - """ - - kwargs = _get_kwargs( - is_all=is_all, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - is_all: bool, -) -> Optional[List["UserResponseDto"]]: - """ - Args: - is_all (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['UserResponseDto'] - """ - - return ( - await asyncio_detailed( - client=client, - is_all=is_all, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/get_my_user_info.py b/immich_carddav_sync/immich_client/api/user/get_my_user_info.py deleted file mode 100644 index 5f36485..0000000 --- a/immich_carddav_sync/immich_client/api/user/get_my_user_info.py +++ /dev/null @@ -1,122 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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]: - pass - - return { - "method": "get", - "url": "/user/me", - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.OK: - 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( - *, - client: AuthenticatedClient, -) -> Response[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[UserResponseDto] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[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: - UserResponseDto - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[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[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[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: - UserResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/get_profile_image.py b/immich_carddav_sync/immich_client/api/user/get_profile_image.py deleted file mode 100644 index eb0b700..0000000 --- a/immich_carddav_sync/immich_client/api/user/get_profile_image.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.get_profile_image_response_200 import GetProfileImageResponse200 -from ...types import Response - - -def _get_kwargs( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/user/profile-image/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GetProfileImageResponse200]: - if response.status_code == HTTPStatus.OK: - response_200 = GetProfileImageResponse200.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[GetProfileImageResponse200]: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[GetProfileImageResponse200]: - """ - Args: - 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[GetProfileImageResponse200] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[GetProfileImageResponse200]: - """ - Args: - 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: - GetProfileImageResponse200 - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[GetProfileImageResponse200]: - """ - Args: - 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[GetProfileImageResponse200] - """ - - 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: str, - *, - client: AuthenticatedClient, -) -> Optional[GetProfileImageResponse200]: - """ - Args: - 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: - GetProfileImageResponse200 - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/get_user_by_id.py b/immich_carddav_sync/immich_client/api/user/get_user_by_id.py deleted file mode 100644 index 85c0246..0000000 --- a/immich_carddav_sync/immich_client/api/user/get_user_by_id.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "get", - "url": "/user/info/{id}".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.OK: - 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: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[UserResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/get_user_count.py b/immich_carddav_sync/immich_client/api/user/get_user_count.py deleted file mode 100644 index 2252fb7..0000000 --- a/immich_carddav_sync/immich_client/api/user/get_user_count.py +++ /dev/null @@ -1,153 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.user_count_response_dto import UserCountResponseDto -from ...types import UNSET, Response, Unset - - -def _get_kwargs( - *, - admin: Union[Unset, None, bool] = False, -) -> Dict[str, Any]: - pass - - params: Dict[str, Any] = {} - params["admin"] = admin - - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - - return { - "method": "get", - "url": "/user/count", - "params": params, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserCountResponseDto]: - if response.status_code == HTTPStatus.OK: - response_200 = UserCountResponseDto.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[UserCountResponseDto]: - 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], - admin: Union[Unset, None, bool] = False, -) -> Response[UserCountResponseDto]: - """ - Args: - admin (Union[Unset, None, 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[UserCountResponseDto] - """ - - kwargs = _get_kwargs( - admin=admin, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: Union[AuthenticatedClient, Client], - admin: Union[Unset, None, bool] = False, -) -> Optional[UserCountResponseDto]: - """ - Args: - admin (Union[Unset, None, 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: - UserCountResponseDto - """ - - return sync_detailed( - client=client, - admin=admin, - ).parsed - - -async def asyncio_detailed( - *, - client: Union[AuthenticatedClient, Client], - admin: Union[Unset, None, bool] = False, -) -> Response[UserCountResponseDto]: - """ - Args: - admin (Union[Unset, None, 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[UserCountResponseDto] - """ - - kwargs = _get_kwargs( - admin=admin, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: Union[AuthenticatedClient, Client], - admin: Union[Unset, None, bool] = False, -) -> Optional[UserCountResponseDto]: - """ - Args: - admin (Union[Unset, None, 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: - UserCountResponseDto - """ - - return ( - await asyncio_detailed( - client=client, - admin=admin, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/restore_user.py b/immich_carddav_sync/immich_client/api/user/restore_user.py deleted file mode 100644 index 8b197cf..0000000 --- a/immich_carddav_sync/immich_client/api/user/restore_user.py +++ /dev/null @@ -1,148 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, 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( - id: str, -) -> Dict[str, Any]: - pass - - return { - "method": "post", - "url": "/user/{id}/restore".format( - id=id, - ), - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.CREATED: - response_201 = UserResponseDto.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[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: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[UserResponseDto] - """ - - kwargs = _get_kwargs( - id=id, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - id: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return sync_detailed( - id=id, - client=client, - ).parsed - - -async def asyncio_detailed( - id: str, - *, - client: AuthenticatedClient, -) -> Response[UserResponseDto]: - """ - Args: - 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[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: str, - *, - client: AuthenticatedClient, -) -> Optional[UserResponseDto]: - """ - Args: - 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: - UserResponseDto - """ - - return ( - await asyncio_detailed( - id=id, - client=client, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/api/user/update_user.py b/immich_carddav_sync/immich_client/api/user/update_user.py deleted file mode 100644 index 921a05d..0000000 --- a/immich_carddav_sync/immich_client/api/user/update_user.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Dict, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.update_user_dto import UpdateUserDto -from ...models.user_response_dto import UserResponseDto -from ...types import Response - - -def _get_kwargs( - *, - json_body: UpdateUserDto, -) -> Dict[str, Any]: - pass - - json_json_body = json_body.to_dict() - - return { - "method": "put", - "url": "/user", - "json": json_json_body, - } - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UserResponseDto]: - if response.status_code == HTTPStatus.OK: - 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( - *, - client: AuthenticatedClient, - json_body: UpdateUserDto, -) -> Response[UserResponseDto]: - """ - Args: - json_body (UpdateUserDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - json_body: UpdateUserDto, -) -> Optional[UserResponseDto]: - """ - Args: - json_body (UpdateUserDto): - - Raises: - errors.UnexpectedStatus: If the server 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( - client=client, - json_body=json_body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - json_body: UpdateUserDto, -) -> Response[UserResponseDto]: - """ - Args: - json_body (UpdateUserDto): - - Raises: - errors.UnexpectedStatus: If the server returns 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( - json_body=json_body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - json_body: UpdateUserDto, -) -> Optional[UserResponseDto]: - """ - Args: - json_body (UpdateUserDto): - - Raises: - errors.UnexpectedStatus: If the server 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( - client=client, - json_body=json_body, - ) - ).parsed diff --git a/immich_carddav_sync/immich_client/client.py b/immich_carddav_sync/immich_client/client.py index 74b476c..0f6d15e 100644 --- a/immich_carddav_sync/immich_client/client.py +++ b/immich_carddav_sync/immich_client/client.py @@ -35,13 +35,13 @@ class Client: """ raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str - _cookies: Dict[str, str] = field(factory=dict, kw_only=True) - _headers: Dict[str, str] = field(factory=dict, kw_only=True) - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) - _follow_redirects: bool = field(default=False, kw_only=True) - _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -70,7 +70,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "Client": return evolve(self, timeout=timeout) def set_httpx_client(self, client: httpx.Client) -> "Client": - """Manually the underlying httpx.Client + """Manually set the underlying httpx.Client **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ @@ -165,13 +165,13 @@ class AuthenticatedClient: """ raise_on_unexpected_status: bool = field(default=False, kw_only=True) - _base_url: str - _cookies: Dict[str, str] = field(factory=dict, kw_only=True) - _headers: Dict[str, str] = field(factory=dict, kw_only=True) - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) - _follow_redirects: bool = field(default=False, kw_only=True) - _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -204,7 +204,7 @@ def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": return evolve(self, timeout=timeout) def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": - """Manually the underlying httpx.Client + """Manually set the underlying httpx.Client **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ diff --git a/immich_carddav_sync/immich_client/errors.py b/immich_carddav_sync/immich_client/errors.py index 426f8a2..5f92e76 100644 --- a/immich_carddav_sync/immich_client/errors.py +++ b/immich_carddav_sync/immich_client/errors.py @@ -1,4 +1,4 @@ -""" Contains shared errors types that can be raised from API functions """ +"""Contains shared errors types that can be raised from API functions""" class UnexpectedStatus(Exception): @@ -8,7 +8,9 @@ def __init__(self, status_code: int, content: bytes): self.status_code = status_code self.content = content - super().__init__(f"Unexpected status code: {status_code}") + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) __all__ = ["UnexpectedStatus"] diff --git a/immich_carddav_sync/immich_client/models/__init__.py b/immich_carddav_sync/immich_client/models/__init__.py index 12d7986..507edc9 100644 --- a/immich_carddav_sync/immich_client/models/__init__.py +++ b/immich_carddav_sync/immich_client/models/__init__.py @@ -1,14 +1,22 @@ -""" Contains all the data models used in inputs/outputs """ +"""Contains all the data models used in inputs/outputs""" +from .activity_create_dto import ActivityCreateDto +from .activity_response_dto import ActivityResponseDto +from .activity_statistics_response_dto import ActivityStatisticsResponseDto from .add_users_dto import AddUsersDto -from .admin_signup_response_dto import AdminSignupResponseDto -from .album_count_response_dto import AlbumCountResponseDto +from .admin_onboarding_update_dto import AdminOnboardingUpdateDto from .album_response_dto import AlbumResponseDto +from .album_statistics_response_dto import AlbumStatisticsResponseDto +from .album_user_add_dto import AlbumUserAddDto +from .album_user_create_dto import AlbumUserCreateDto +from .album_user_response_dto import AlbumUserResponseDto +from .album_user_role import AlbumUserRole from .all_job_status_response_dto import AllJobStatusResponseDto from .api_key_create_dto import APIKeyCreateDto from .api_key_create_response_dto import APIKeyCreateResponseDto from .api_key_response_dto import APIKeyResponseDto from .api_key_update_dto import APIKeyUpdateDto +from .asset_bulk_delete_dto import AssetBulkDeleteDto from .asset_bulk_update_dto import AssetBulkUpdateDto from .asset_bulk_upload_check_dto import AssetBulkUploadCheckDto from .asset_bulk_upload_check_item import AssetBulkUploadCheckItem @@ -16,122 +24,235 @@ from .asset_bulk_upload_check_result import AssetBulkUploadCheckResult from .asset_bulk_upload_check_result_action import AssetBulkUploadCheckResultAction from .asset_bulk_upload_check_result_reason import AssetBulkUploadCheckResultReason -from .asset_file_upload_response_dto import AssetFileUploadResponseDto +from .asset_delta_sync_dto import AssetDeltaSyncDto +from .asset_delta_sync_response_dto import AssetDeltaSyncResponseDto +from .asset_face_response_dto import AssetFaceResponseDto +from .asset_face_update_dto import AssetFaceUpdateDto +from .asset_face_update_item import AssetFaceUpdateItem +from .asset_face_without_person_response_dto import AssetFaceWithoutPersonResponseDto +from .asset_full_sync_dto import AssetFullSyncDto from .asset_ids_dto import AssetIdsDto from .asset_ids_response_dto import AssetIdsResponseDto from .asset_ids_response_dto_error import AssetIdsResponseDtoError from .asset_job_name import AssetJobName from .asset_jobs_dto import AssetJobsDto +from .asset_media_create_dto import AssetMediaCreateDto +from .asset_media_replace_dto import AssetMediaReplaceDto +from .asset_media_response_dto import AssetMediaResponseDto +from .asset_media_size import AssetMediaSize +from .asset_media_status import AssetMediaStatus +from .asset_order import AssetOrder from .asset_response_dto import AssetResponseDto +from .asset_stack_response_dto import AssetStackResponseDto from .asset_stats_response_dto import AssetStatsResponseDto from .asset_type_enum import AssetTypeEnum from .audio_codec import AudioCodec -from .auth_device_response_dto import AuthDeviceResponseDto +from .audit_deletes_response_dto import AuditDeletesResponseDto +from .avatar_response import AvatarResponse +from .avatar_update import AvatarUpdate from .bulk_id_response_dto import BulkIdResponseDto from .bulk_id_response_dto_error import BulkIdResponseDtoError from .bulk_ids_dto import BulkIdsDto from .change_password_dto import ChangePasswordDto -from .check_duplicate_asset_dto import CheckDuplicateAssetDto -from .check_duplicate_asset_response_dto import CheckDuplicateAssetResponseDto from .check_existing_assets_dto import CheckExistingAssetsDto from .check_existing_assets_response_dto import CheckExistingAssetsResponseDto +from .clip_config import CLIPConfig +from .colorspace import Colorspace +from .cq_mode import CQMode from .create_album_dto import CreateAlbumDto -from .create_asset_dto import CreateAssetDto +from .create_library_dto import CreateLibraryDto from .create_profile_image_dto import CreateProfileImageDto from .create_profile_image_response_dto import CreateProfileImageResponseDto -from .create_tag_dto import CreateTagDto -from .create_user_dto import CreateUserDto -from .curated_locations_response_dto import CuratedLocationsResponseDto -from .curated_objects_response_dto import CuratedObjectsResponseDto -from .delete_asset_dto import DeleteAssetDto -from .delete_asset_response_dto import DeleteAssetResponseDto -from .delete_asset_status import DeleteAssetStatus from .download_archive_info import DownloadArchiveInfo from .download_info_dto import DownloadInfoDto +from .download_response import DownloadResponse from .download_response_dto import DownloadResponseDto +from .download_update import DownloadUpdate +from .duplicate_detection_config import DuplicateDetectionConfig +from .duplicate_response_dto import DuplicateResponseDto +from .email_notifications_response import EmailNotificationsResponse +from .email_notifications_update import EmailNotificationsUpdate +from .entity_type import EntityType from .exif_response_dto import ExifResponseDto -from .get_partners_direction import GetPartnersDirection -from .get_profile_image_response_200 import GetProfileImageResponse200 -from .import_asset_dto import ImportAssetDto +from .face_dto import FaceDto +from .facial_recognition_config import FacialRecognitionConfig +from .file_checksum_dto import FileChecksumDto +from .file_checksum_response_dto import FileChecksumResponseDto +from .file_report_dto import FileReportDto +from .file_report_fix_dto import FileReportFixDto +from .file_report_item_dto import FileReportItemDto +from .folders_response import FoldersResponse +from .folders_update import FoldersUpdate +from .image_format import ImageFormat from .job_command import JobCommand from .job_command_dto import JobCommandDto from .job_counts_dto import JobCountsDto +from .job_create_dto import JobCreateDto from .job_name import JobName from .job_settings_dto import JobSettingsDto from .job_status_dto import JobStatusDto +from .library_response_dto import LibraryResponseDto +from .library_stats_response_dto import LibraryStatsResponseDto +from .license_key_dto import LicenseKeyDto +from .license_response_dto import LicenseResponseDto +from .log_level import LogLevel from .login_credential_dto import LoginCredentialDto from .login_response_dto import LoginResponseDto from .logout_response_dto import LogoutResponseDto +from .manual_job_name import ManualJobName from .map_marker_response_dto import MapMarkerResponseDto +from .map_reverse_geocode_response_dto import MapReverseGeocodeResponseDto +from .memories_response import MemoriesResponse +from .memories_update import MemoriesUpdate +from .memory_create_dto import MemoryCreateDto from .memory_lane_response_dto import MemoryLaneResponseDto +from .memory_response_dto import MemoryResponseDto +from .memory_type import MemoryType +from .memory_update_dto import MemoryUpdateDto from .merge_person_dto import MergePersonDto +from .metadata_search_dto import MetadataSearchDto +from .o_auth_authorize_response_dto import OAuthAuthorizeResponseDto from .o_auth_callback_dto import OAuthCallbackDto from .o_auth_config_dto import OAuthConfigDto -from .o_auth_config_response_dto import OAuthConfigResponseDto +from .on_this_day_dto import OnThisDayDto +from .partner_direction import PartnerDirection +from .partner_response_dto import PartnerResponseDto +from .path_entity_type import PathEntityType +from .path_type import PathType +from .people_response import PeopleResponse from .people_response_dto import PeopleResponseDto +from .people_update import PeopleUpdate from .people_update_dto import PeopleUpdateDto from .people_update_item import PeopleUpdateItem +from .permission import Permission +from .person_create_dto import PersonCreateDto from .person_response_dto import PersonResponseDto +from .person_statistics_response_dto import PersonStatisticsResponseDto from .person_update_dto import PersonUpdateDto +from .person_with_faces_response_dto import PersonWithFacesResponseDto +from .places_response_dto import PlacesResponseDto +from .purchase_response import PurchaseResponse +from .purchase_update import PurchaseUpdate from .queue_status_dto import QueueStatusDto +from .random_search_dto import RandomSearchDto +from .ratings_response import RatingsResponse +from .ratings_update import RatingsUpdate +from .reaction_level import ReactionLevel +from .reaction_type import ReactionType +from .reverse_geocoding_state_response_dto import ReverseGeocodingStateResponseDto from .search_album_response_dto import SearchAlbumResponseDto -from .search_asset_dto import SearchAssetDto from .search_asset_response_dto import SearchAssetResponseDto -from .search_config_response_dto import SearchConfigResponseDto from .search_explore_item import SearchExploreItem from .search_explore_response_dto import SearchExploreResponseDto from .search_facet_count_response_dto import SearchFacetCountResponseDto from .search_facet_response_dto import SearchFacetResponseDto from .search_response_dto import SearchResponseDto -from .search_type import SearchType +from .search_suggestion_type import SearchSuggestionType +from .server_about_response_dto import ServerAboutResponseDto +from .server_config_dto import ServerConfigDto from .server_features_dto import ServerFeaturesDto -from .server_info_response_dto import ServerInfoResponseDto from .server_media_types_response_dto import ServerMediaTypesResponseDto from .server_ping_response import ServerPingResponse from .server_stats_response_dto import ServerStatsResponseDto +from .server_storage_response_dto import ServerStorageResponseDto +from .server_theme_dto import ServerThemeDto +from .server_version_history_response_dto import ServerVersionHistoryResponseDto from .server_version_response_dto import ServerVersionResponseDto +from .session_response_dto import SessionResponseDto from .shared_link_create_dto import SharedLinkCreateDto from .shared_link_edit_dto import SharedLinkEditDto from .shared_link_response_dto import SharedLinkResponseDto from .shared_link_type import SharedLinkType from .sign_up_dto import SignUpDto from .smart_info_response_dto import SmartInfoResponseDto +from .smart_search_dto import SmartSearchDto +from .source_type import SourceType +from .stack_create_dto import StackCreateDto +from .stack_response_dto import StackResponseDto +from .stack_update_dto import StackUpdateDto from .system_config_dto import SystemConfigDto from .system_config_f_fmpeg_dto import SystemConfigFFmpegDto +from .system_config_faces_dto import SystemConfigFacesDto +from .system_config_generated_image_dto import SystemConfigGeneratedImageDto +from .system_config_image_dto import SystemConfigImageDto from .system_config_job_dto import SystemConfigJobDto +from .system_config_library_dto import SystemConfigLibraryDto +from .system_config_library_scan_dto import SystemConfigLibraryScanDto +from .system_config_library_watch_dto import SystemConfigLibraryWatchDto +from .system_config_logging_dto import SystemConfigLoggingDto +from .system_config_machine_learning_dto import SystemConfigMachineLearningDto +from .system_config_map_dto import SystemConfigMapDto +from .system_config_metadata_dto import SystemConfigMetadataDto +from .system_config_new_version_check_dto import SystemConfigNewVersionCheckDto +from .system_config_notifications_dto import SystemConfigNotificationsDto from .system_config_o_auth_dto import SystemConfigOAuthDto from .system_config_password_login_dto import SystemConfigPasswordLoginDto +from .system_config_reverse_geocoding_dto import SystemConfigReverseGeocodingDto +from .system_config_server_dto import SystemConfigServerDto +from .system_config_smtp_dto import SystemConfigSmtpDto +from .system_config_smtp_transport_dto import SystemConfigSmtpTransportDto from .system_config_storage_template_dto import SystemConfigStorageTemplateDto from .system_config_template_storage_option_dto import SystemConfigTemplateStorageOptionDto -from .system_config_thumbnail_dto import SystemConfigThumbnailDto +from .system_config_theme_dto import SystemConfigThemeDto +from .system_config_trash_dto import SystemConfigTrashDto +from .system_config_user_dto import SystemConfigUserDto +from .tag_bulk_assets_dto import TagBulkAssetsDto +from .tag_bulk_assets_response_dto import TagBulkAssetsResponseDto +from .tag_create_dto import TagCreateDto from .tag_response_dto import TagResponseDto -from .tag_type_enum import TagTypeEnum -from .thumbnail_format import ThumbnailFormat +from .tag_update_dto import TagUpdateDto +from .tag_upsert_dto import TagUpsertDto +from .tags_response import TagsResponse +from .tags_update import TagsUpdate +from .test_email_response_dto import TestEmailResponseDto from .time_bucket_response_dto import TimeBucketResponseDto from .time_bucket_size import TimeBucketSize from .tone_mapping import ToneMapping from .transcode_hw_accel import TranscodeHWAccel from .transcode_policy import TranscodePolicy +from .trash_response_dto import TrashResponseDto from .update_album_dto import UpdateAlbumDto +from .update_album_user_dto import UpdateAlbumUserDto from .update_asset_dto import UpdateAssetDto -from .update_tag_dto import UpdateTagDto -from .update_user_dto import UpdateUserDto +from .update_library_dto import UpdateLibraryDto +from .update_partner_dto import UpdatePartnerDto from .usage_by_user_dto import UsageByUserDto -from .user_count_response_dto import UserCountResponseDto +from .user_admin_create_dto import UserAdminCreateDto +from .user_admin_delete_dto import UserAdminDeleteDto +from .user_admin_response_dto import UserAdminResponseDto +from .user_admin_update_dto import UserAdminUpdateDto +from .user_avatar_color import UserAvatarColor +from .user_license import UserLicense +from .user_preferences_response_dto import UserPreferencesResponseDto +from .user_preferences_update_dto import UserPreferencesUpdateDto from .user_response_dto import UserResponseDto +from .user_status import UserStatus +from .user_update_me_dto import UserUpdateMeDto from .validate_access_token_response_dto import ValidateAccessTokenResponseDto +from .validate_library_dto import ValidateLibraryDto +from .validate_library_import_path_response_dto import ValidateLibraryImportPathResponseDto +from .validate_library_response_dto import ValidateLibraryResponseDto from .video_codec import VideoCodec +from .video_container import VideoContainer __all__ = ( + "ActivityCreateDto", + "ActivityResponseDto", + "ActivityStatisticsResponseDto", "AddUsersDto", - "AdminSignupResponseDto", - "AlbumCountResponseDto", + "AdminOnboardingUpdateDto", "AlbumResponseDto", + "AlbumStatisticsResponseDto", + "AlbumUserAddDto", + "AlbumUserCreateDto", + "AlbumUserResponseDto", + "AlbumUserRole", "AllJobStatusResponseDto", "APIKeyCreateDto", "APIKeyCreateResponseDto", "APIKeyResponseDto", "APIKeyUpdateDto", + "AssetBulkDeleteDto", "AssetBulkUpdateDto", "AssetBulkUploadCheckDto", "AssetBulkUploadCheckItem", @@ -139,109 +260,214 @@ "AssetBulkUploadCheckResult", "AssetBulkUploadCheckResultAction", "AssetBulkUploadCheckResultReason", - "AssetFileUploadResponseDto", + "AssetDeltaSyncDto", + "AssetDeltaSyncResponseDto", + "AssetFaceResponseDto", + "AssetFaceUpdateDto", + "AssetFaceUpdateItem", + "AssetFaceWithoutPersonResponseDto", + "AssetFullSyncDto", "AssetIdsDto", "AssetIdsResponseDto", "AssetIdsResponseDtoError", "AssetJobName", "AssetJobsDto", + "AssetMediaCreateDto", + "AssetMediaReplaceDto", + "AssetMediaResponseDto", + "AssetMediaSize", + "AssetMediaStatus", + "AssetOrder", "AssetResponseDto", + "AssetStackResponseDto", "AssetStatsResponseDto", "AssetTypeEnum", "AudioCodec", - "AuthDeviceResponseDto", + "AuditDeletesResponseDto", + "AvatarResponse", + "AvatarUpdate", "BulkIdResponseDto", "BulkIdResponseDtoError", "BulkIdsDto", "ChangePasswordDto", - "CheckDuplicateAssetDto", - "CheckDuplicateAssetResponseDto", "CheckExistingAssetsDto", "CheckExistingAssetsResponseDto", + "CLIPConfig", + "Colorspace", + "CQMode", "CreateAlbumDto", - "CreateAssetDto", + "CreateLibraryDto", "CreateProfileImageDto", "CreateProfileImageResponseDto", - "CreateTagDto", - "CreateUserDto", - "CuratedLocationsResponseDto", - "CuratedObjectsResponseDto", - "DeleteAssetDto", - "DeleteAssetResponseDto", - "DeleteAssetStatus", "DownloadArchiveInfo", "DownloadInfoDto", + "DownloadResponse", "DownloadResponseDto", + "DownloadUpdate", + "DuplicateDetectionConfig", + "DuplicateResponseDto", + "EmailNotificationsResponse", + "EmailNotificationsUpdate", + "EntityType", "ExifResponseDto", - "GetPartnersDirection", - "GetProfileImageResponse200", - "ImportAssetDto", + "FaceDto", + "FacialRecognitionConfig", + "FileChecksumDto", + "FileChecksumResponseDto", + "FileReportDto", + "FileReportFixDto", + "FileReportItemDto", + "FoldersResponse", + "FoldersUpdate", + "ImageFormat", "JobCommand", "JobCommandDto", "JobCountsDto", + "JobCreateDto", "JobName", "JobSettingsDto", "JobStatusDto", + "LibraryResponseDto", + "LibraryStatsResponseDto", + "LicenseKeyDto", + "LicenseResponseDto", "LoginCredentialDto", "LoginResponseDto", + "LogLevel", "LogoutResponseDto", + "ManualJobName", "MapMarkerResponseDto", + "MapReverseGeocodeResponseDto", + "MemoriesResponse", + "MemoriesUpdate", + "MemoryCreateDto", "MemoryLaneResponseDto", + "MemoryResponseDto", + "MemoryType", + "MemoryUpdateDto", "MergePersonDto", + "MetadataSearchDto", + "OAuthAuthorizeResponseDto", "OAuthCallbackDto", "OAuthConfigDto", - "OAuthConfigResponseDto", + "OnThisDayDto", + "PartnerDirection", + "PartnerResponseDto", + "PathEntityType", + "PathType", + "PeopleResponse", "PeopleResponseDto", + "PeopleUpdate", "PeopleUpdateDto", "PeopleUpdateItem", + "Permission", + "PersonCreateDto", "PersonResponseDto", + "PersonStatisticsResponseDto", "PersonUpdateDto", + "PersonWithFacesResponseDto", + "PlacesResponseDto", + "PurchaseResponse", + "PurchaseUpdate", "QueueStatusDto", + "RandomSearchDto", + "RatingsResponse", + "RatingsUpdate", + "ReactionLevel", + "ReactionType", + "ReverseGeocodingStateResponseDto", "SearchAlbumResponseDto", - "SearchAssetDto", "SearchAssetResponseDto", - "SearchConfigResponseDto", "SearchExploreItem", "SearchExploreResponseDto", "SearchFacetCountResponseDto", "SearchFacetResponseDto", "SearchResponseDto", - "SearchType", + "SearchSuggestionType", + "ServerAboutResponseDto", + "ServerConfigDto", "ServerFeaturesDto", - "ServerInfoResponseDto", "ServerMediaTypesResponseDto", "ServerPingResponse", "ServerStatsResponseDto", + "ServerStorageResponseDto", + "ServerThemeDto", + "ServerVersionHistoryResponseDto", "ServerVersionResponseDto", + "SessionResponseDto", "SharedLinkCreateDto", "SharedLinkEditDto", "SharedLinkResponseDto", "SharedLinkType", "SignUpDto", "SmartInfoResponseDto", + "SmartSearchDto", + "SourceType", + "StackCreateDto", + "StackResponseDto", + "StackUpdateDto", "SystemConfigDto", + "SystemConfigFacesDto", "SystemConfigFFmpegDto", + "SystemConfigGeneratedImageDto", + "SystemConfigImageDto", "SystemConfigJobDto", + "SystemConfigLibraryDto", + "SystemConfigLibraryScanDto", + "SystemConfigLibraryWatchDto", + "SystemConfigLoggingDto", + "SystemConfigMachineLearningDto", + "SystemConfigMapDto", + "SystemConfigMetadataDto", + "SystemConfigNewVersionCheckDto", + "SystemConfigNotificationsDto", "SystemConfigOAuthDto", "SystemConfigPasswordLoginDto", + "SystemConfigReverseGeocodingDto", + "SystemConfigServerDto", + "SystemConfigSmtpDto", + "SystemConfigSmtpTransportDto", "SystemConfigStorageTemplateDto", "SystemConfigTemplateStorageOptionDto", - "SystemConfigThumbnailDto", + "SystemConfigThemeDto", + "SystemConfigTrashDto", + "SystemConfigUserDto", + "TagBulkAssetsDto", + "TagBulkAssetsResponseDto", + "TagCreateDto", "TagResponseDto", - "TagTypeEnum", - "ThumbnailFormat", + "TagsResponse", + "TagsUpdate", + "TagUpdateDto", + "TagUpsertDto", + "TestEmailResponseDto", "TimeBucketResponseDto", "TimeBucketSize", "ToneMapping", "TranscodeHWAccel", "TranscodePolicy", + "TrashResponseDto", "UpdateAlbumDto", + "UpdateAlbumUserDto", "UpdateAssetDto", - "UpdateTagDto", - "UpdateUserDto", + "UpdateLibraryDto", + "UpdatePartnerDto", "UsageByUserDto", - "UserCountResponseDto", + "UserAdminCreateDto", + "UserAdminDeleteDto", + "UserAdminResponseDto", + "UserAdminUpdateDto", + "UserAvatarColor", + "UserLicense", + "UserPreferencesResponseDto", + "UserPreferencesUpdateDto", "UserResponseDto", + "UserStatus", + "UserUpdateMeDto", "ValidateAccessTokenResponseDto", + "ValidateLibraryDto", + "ValidateLibraryImportPathResponseDto", + "ValidateLibraryResponseDto", "VideoCodec", + "VideoContainer", ) diff --git a/immich_carddav_sync/immich_client/models/activity_create_dto.py b/immich_carddav_sync/immich_client/models/activity_create_dto.py new file mode 100644 index 0000000..9245899 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/activity_create_dto.py @@ -0,0 +1,95 @@ +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.reaction_type import ReactionType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ActivityCreateDto") + + +@_attrs_define +class ActivityCreateDto: + """ + Attributes: + album_id (UUID): + type (ReactionType): + asset_id (Union[Unset, UUID]): + comment (Union[Unset, str]): + """ + + album_id: UUID + type: ReactionType + asset_id: Union[Unset, UUID] = UNSET + comment: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + album_id = str(self.album_id) + + type = self.type.value + + asset_id: Union[Unset, str] = UNSET + if not isinstance(self.asset_id, Unset): + asset_id = str(self.asset_id) + + comment = self.comment + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "albumId": album_id, + "type": type, + } + ) + if asset_id is not UNSET: + field_dict["assetId"] = asset_id + if comment is not UNSET: + field_dict["comment"] = comment + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + album_id = UUID(d.pop("albumId")) + + type = ReactionType(d.pop("type")) + + _asset_id = d.pop("assetId", UNSET) + asset_id: Union[Unset, UUID] + if isinstance(_asset_id, Unset): + asset_id = UNSET + else: + asset_id = UUID(_asset_id) + + comment = d.pop("comment", UNSET) + + activity_create_dto = cls( + album_id=album_id, + type=type, + asset_id=asset_id, + comment=comment, + ) + + activity_create_dto.additional_properties = d + return activity_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/activity_response_dto.py b/immich_carddav_sync/immich_client/models/activity_response_dto.py new file mode 100644 index 0000000..995cc3c --- /dev/null +++ b/immich_carddav_sync/immich_client/models/activity_response_dto.py @@ -0,0 +1,128 @@ +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.reaction_type import ReactionType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user_response_dto import UserResponseDto + + +T = TypeVar("T", bound="ActivityResponseDto") + + +@_attrs_define +class ActivityResponseDto: + """ + Attributes: + asset_id (Union[None, str]): + created_at (datetime.datetime): + id (str): + type (ReactionType): + user (UserResponseDto): + comment (Union[None, Unset, str]): + """ + + asset_id: Union[None, str] + created_at: datetime.datetime + id: str + type: ReactionType + user: "UserResponseDto" + comment: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_id: Union[None, str] + asset_id = self.asset_id + + created_at = self.created_at.isoformat() + + id = self.id + + type = self.type.value + + user = self.user.to_dict() + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetId": asset_id, + "createdAt": created_at, + "id": id, + "type": type, + "user": user, + } + ) + if comment is not UNSET: + field_dict["comment"] = comment + + 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() + + def _parse_asset_id(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + asset_id = _parse_asset_id(d.pop("assetId")) + + created_at = isoparse(d.pop("createdAt")) + + id = d.pop("id") + + type = ReactionType(d.pop("type")) + + user = UserResponseDto.from_dict(d.pop("user")) + + def _parse_comment(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) + + comment = _parse_comment(d.pop("comment", UNSET)) + + activity_response_dto = cls( + asset_id=asset_id, + created_at=created_at, + id=id, + type=type, + user=user, + comment=comment, + ) + + activity_response_dto.additional_properties = d + return activity_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/activity_statistics_response_dto.py b/immich_carddav_sync/immich_client/models/activity_statistics_response_dto.py new file mode 100644 index 0000000..03e34b3 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/activity_statistics_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="ActivityStatisticsResponseDto") + + +@_attrs_define +class ActivityStatisticsResponseDto: + """ + Attributes: + comments (int): + """ + + comments: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + comments = self.comments + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "comments": comments, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + comments = d.pop("comments") + + activity_statistics_response_dto = cls( + comments=comments, + ) + + activity_statistics_response_dto.additional_properties = d + return activity_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/add_users_dto.py b/immich_carddav_sync/immich_client/models/add_users_dto.py index 21b7bb1..22d0a4f 100644 --- a/immich_carddav_sync/immich_client/models/add_users_dto.py +++ b/immich_carddav_sync/immich_client/models/add_users_dto.py @@ -1,8 +1,12 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +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.album_user_add_dto import AlbumUserAddDto + + T = TypeVar("T", bound="AddUsersDto") @@ -10,20 +14,23 @@ class AddUsersDto: """ Attributes: - shared_user_ids (List[str]): + album_users (List['AlbumUserAddDto']): """ - shared_user_ids: List[str] + album_users: List["AlbumUserAddDto"] additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - shared_user_ids = self.shared_user_ids + album_users = [] + for album_users_item_data in self.album_users: + album_users_item = album_users_item_data.to_dict() + album_users.append(album_users_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "sharedUserIds": shared_user_ids, + "albumUsers": album_users, } ) @@ -31,11 +38,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.album_user_add_dto import AlbumUserAddDto + d = src_dict.copy() - shared_user_ids = cast(List[str], d.pop("sharedUserIds")) + album_users = [] + _album_users = d.pop("albumUsers") + for album_users_item_data in _album_users: + album_users_item = AlbumUserAddDto.from_dict(album_users_item_data) + + album_users.append(album_users_item) add_users_dto = cls( - shared_user_ids=shared_user_ids, + album_users=album_users, ) add_users_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/admin_signup_response_dto.py b/immich_carddav_sync/immich_client/models/admin_signup_response_dto.py deleted file mode 100644 index 143d245..0000000 --- a/immich_carddav_sync/immich_client/models/admin_signup_response_dto.py +++ /dev/null @@ -1,89 +0,0 @@ -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="AdminSignupResponseDto") - - -@_attrs_define -class AdminSignupResponseDto: - """ - Attributes: - created_at (datetime.datetime): - email (str): - first_name (str): - id (str): - last_name (str): - """ - - created_at: datetime.datetime - email: str - first_name: str - id: str - last_name: 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() - - email = self.email - first_name = self.first_name - id = self.id - last_name = self.last_name - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "createdAt": created_at, - "email": email, - "firstName": first_name, - "id": id, - "lastName": last_name, - } - ) - - 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")) - - email = d.pop("email") - - first_name = d.pop("firstName") - - id = d.pop("id") - - last_name = d.pop("lastName") - - admin_signup_response_dto = cls( - created_at=created_at, - email=email, - first_name=first_name, - id=id, - last_name=last_name, - ) - - admin_signup_response_dto.additional_properties = d - return admin_signup_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_response_dto.py b/immich_carddav_sync/immich_client/models/album_response_dto.py index 0ff36ed..c31b6c3 100644 --- a/immich_carddav_sync/immich_client/models/album_response_dto.py +++ b/immich_carddav_sync/immich_client/models/album_response_dto.py @@ -1,13 +1,15 @@ import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, TypeVar, Union +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.asset_order import AssetOrder from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.album_user_response_dto import AlbumUserResponseDto from ..models.asset_response_dto import AssetResponseDto from ..models.user_response_dto import UserResponseDto @@ -20,68 +22,81 @@ class AlbumResponseDto: """ Attributes: album_name (str): + album_thumbnail_asset_id (Union[None, str]): + album_users (List['AlbumUserResponseDto']): asset_count (int): assets (List['AssetResponseDto']): created_at (datetime.datetime): description (str): has_shared_link (bool): id (str): + is_activity_enabled (bool): owner (UserResponseDto): owner_id (str): shared (bool): - shared_users (List['UserResponseDto']): updated_at (datetime.datetime): - album_thumbnail_asset_id (Optional[str]): end_date (Union[Unset, datetime.datetime]): last_modified_asset_timestamp (Union[Unset, datetime.datetime]): + order (Union[Unset, AssetOrder]): start_date (Union[Unset, datetime.datetime]): """ album_name: str + album_thumbnail_asset_id: Union[None, str] + album_users: List["AlbumUserResponseDto"] asset_count: int assets: List["AssetResponseDto"] created_at: datetime.datetime description: str has_shared_link: bool id: str + is_activity_enabled: bool owner: "UserResponseDto" owner_id: str shared: bool - shared_users: List["UserResponseDto"] updated_at: datetime.datetime - album_thumbnail_asset_id: Optional[str] end_date: Union[Unset, datetime.datetime] = UNSET last_modified_asset_timestamp: Union[Unset, datetime.datetime] = UNSET + order: Union[Unset, AssetOrder] = UNSET start_date: Union[Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: album_name = self.album_name + + album_thumbnail_asset_id: Union[None, str] + album_thumbnail_asset_id = self.album_thumbnail_asset_id + + album_users = [] + for album_users_item_data in self.album_users: + album_users_item = album_users_item_data.to_dict() + album_users.append(album_users_item) + asset_count = self.asset_count + 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() description = self.description + has_shared_link = self.has_shared_link + id = self.id + + is_activity_enabled = self.is_activity_enabled + owner = self.owner.to_dict() owner_id = self.owner_id - shared = self.shared - shared_users = [] - for shared_users_item_data in self.shared_users: - shared_users_item = shared_users_item_data.to_dict() - shared_users.append(shared_users_item) + shared = self.shared updated_at = self.updated_at.isoformat() - album_thumbnail_asset_id = self.album_thumbnail_asset_id end_date: Union[Unset, str] = UNSET if not isinstance(self.end_date, Unset): end_date = self.end_date.isoformat() @@ -90,6 +105,10 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.last_modified_asset_timestamp, Unset): last_modified_asset_timestamp = self.last_modified_asset_timestamp.isoformat() + order: Union[Unset, str] = UNSET + if not isinstance(self.order, Unset): + order = self.order.value + start_date: Union[Unset, str] = UNSET if not isinstance(self.start_date, Unset): start_date = self.start_date.isoformat() @@ -99,24 +118,27 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "albumName": album_name, + "albumThumbnailAssetId": album_thumbnail_asset_id, + "albumUsers": album_users, "assetCount": asset_count, "assets": assets, "createdAt": created_at, "description": description, "hasSharedLink": has_shared_link, "id": id, + "isActivityEnabled": is_activity_enabled, "owner": owner, "ownerId": owner_id, "shared": shared, - "sharedUsers": shared_users, "updatedAt": updated_at, - "albumThumbnailAssetId": album_thumbnail_asset_id, } ) if end_date is not UNSET: field_dict["endDate"] = end_date if last_modified_asset_timestamp is not UNSET: field_dict["lastModifiedAssetTimestamp"] = last_modified_asset_timestamp + if order is not UNSET: + field_dict["order"] = order if start_date is not UNSET: field_dict["startDate"] = start_date @@ -124,12 +146,27 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.album_user_response_dto import AlbumUserResponseDto from ..models.asset_response_dto import AssetResponseDto from ..models.user_response_dto import UserResponseDto d = src_dict.copy() album_name = d.pop("albumName") + def _parse_album_thumbnail_asset_id(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + album_thumbnail_asset_id = _parse_album_thumbnail_asset_id(d.pop("albumThumbnailAssetId")) + + album_users = [] + _album_users = d.pop("albumUsers") + for album_users_item_data in _album_users: + album_users_item = AlbumUserResponseDto.from_dict(album_users_item_data) + + album_users.append(album_users_item) + asset_count = d.pop("assetCount") assets = [] @@ -147,23 +184,16 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: id = d.pop("id") + is_activity_enabled = d.pop("isActivityEnabled") + owner = UserResponseDto.from_dict(d.pop("owner")) owner_id = d.pop("ownerId") shared = d.pop("shared") - shared_users = [] - _shared_users = d.pop("sharedUsers") - for shared_users_item_data in _shared_users: - shared_users_item = UserResponseDto.from_dict(shared_users_item_data) - - shared_users.append(shared_users_item) - updated_at = isoparse(d.pop("updatedAt")) - album_thumbnail_asset_id = d.pop("albumThumbnailAssetId") - _end_date = d.pop("endDate", UNSET) end_date: Union[Unset, datetime.datetime] if isinstance(_end_date, Unset): @@ -178,6 +208,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: last_modified_asset_timestamp = isoparse(_last_modified_asset_timestamp) + _order = d.pop("order", UNSET) + order: Union[Unset, AssetOrder] + if isinstance(_order, Unset): + order = UNSET + else: + order = AssetOrder(_order) + _start_date = d.pop("startDate", UNSET) start_date: Union[Unset, datetime.datetime] if isinstance(_start_date, Unset): @@ -187,20 +224,22 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: album_response_dto = cls( album_name=album_name, + album_thumbnail_asset_id=album_thumbnail_asset_id, + album_users=album_users, asset_count=asset_count, assets=assets, created_at=created_at, description=description, has_shared_link=has_shared_link, id=id, + is_activity_enabled=is_activity_enabled, owner=owner, owner_id=owner_id, shared=shared, - shared_users=shared_users, updated_at=updated_at, - album_thumbnail_asset_id=album_thumbnail_asset_id, end_date=end_date, last_modified_asset_timestamp=last_modified_asset_timestamp, + order=order, start_date=start_date, ) diff --git a/immich_carddav_sync/immich_client/models/all_job_status_response_dto.py b/immich_carddav_sync/immich_client/models/all_job_status_response_dto.py index 0ff5fc1..6df6423 100644 --- a/immich_carddav_sync/immich_client/models/all_job_status_response_dto.py +++ b/immich_carddav_sync/immich_client/models/all_job_status_response_dto.py @@ -15,24 +15,32 @@ class AllJobStatusResponseDto: """ Attributes: background_task (JobStatusDto): - clip_encoding (JobStatusDto): + duplicate_detection (JobStatusDto): + face_detection (JobStatusDto): + facial_recognition (JobStatusDto): + library (JobStatusDto): metadata_extraction (JobStatusDto): - object_tagging (JobStatusDto): - recognize_faces (JobStatusDto): + migration (JobStatusDto): + notifications (JobStatusDto): search (JobStatusDto): sidecar (JobStatusDto): + smart_search (JobStatusDto): storage_template_migration (JobStatusDto): thumbnail_generation (JobStatusDto): video_conversion (JobStatusDto): """ background_task: "JobStatusDto" - clip_encoding: "JobStatusDto" + duplicate_detection: "JobStatusDto" + face_detection: "JobStatusDto" + facial_recognition: "JobStatusDto" + library: "JobStatusDto" metadata_extraction: "JobStatusDto" - object_tagging: "JobStatusDto" - recognize_faces: "JobStatusDto" + migration: "JobStatusDto" + notifications: "JobStatusDto" search: "JobStatusDto" sidecar: "JobStatusDto" + smart_search: "JobStatusDto" storage_template_migration: "JobStatusDto" thumbnail_generation: "JobStatusDto" video_conversion: "JobStatusDto" @@ -41,18 +49,26 @@ class AllJobStatusResponseDto: def to_dict(self) -> Dict[str, Any]: background_task = self.background_task.to_dict() - clip_encoding = self.clip_encoding.to_dict() + duplicate_detection = self.duplicate_detection.to_dict() + + face_detection = self.face_detection.to_dict() + + facial_recognition = self.facial_recognition.to_dict() + + library = self.library.to_dict() metadata_extraction = self.metadata_extraction.to_dict() - object_tagging = self.object_tagging.to_dict() + migration = self.migration.to_dict() - recognize_faces = self.recognize_faces.to_dict() + notifications = self.notifications.to_dict() search = self.search.to_dict() sidecar = self.sidecar.to_dict() + smart_search = self.smart_search.to_dict() + storage_template_migration = self.storage_template_migration.to_dict() thumbnail_generation = self.thumbnail_generation.to_dict() @@ -64,12 +80,16 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "backgroundTask": background_task, - "clipEncoding": clip_encoding, + "duplicateDetection": duplicate_detection, + "faceDetection": face_detection, + "facialRecognition": facial_recognition, + "library": library, "metadataExtraction": metadata_extraction, - "objectTagging": object_tagging, - "recognizeFaces": recognize_faces, + "migration": migration, + "notifications": notifications, "search": search, "sidecar": sidecar, + "smartSearch": smart_search, "storageTemplateMigration": storage_template_migration, "thumbnailGeneration": thumbnail_generation, "videoConversion": video_conversion, @@ -85,18 +105,26 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() background_task = JobStatusDto.from_dict(d.pop("backgroundTask")) - clip_encoding = JobStatusDto.from_dict(d.pop("clipEncoding")) + duplicate_detection = JobStatusDto.from_dict(d.pop("duplicateDetection")) + + face_detection = JobStatusDto.from_dict(d.pop("faceDetection")) + + facial_recognition = JobStatusDto.from_dict(d.pop("facialRecognition")) + + library = JobStatusDto.from_dict(d.pop("library")) metadata_extraction = JobStatusDto.from_dict(d.pop("metadataExtraction")) - object_tagging = JobStatusDto.from_dict(d.pop("objectTagging")) + migration = JobStatusDto.from_dict(d.pop("migration")) - recognize_faces = JobStatusDto.from_dict(d.pop("recognizeFaces")) + notifications = JobStatusDto.from_dict(d.pop("notifications")) search = JobStatusDto.from_dict(d.pop("search")) sidecar = JobStatusDto.from_dict(d.pop("sidecar")) + smart_search = JobStatusDto.from_dict(d.pop("smartSearch")) + storage_template_migration = JobStatusDto.from_dict(d.pop("storageTemplateMigration")) thumbnail_generation = JobStatusDto.from_dict(d.pop("thumbnailGeneration")) @@ -105,12 +133,16 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: all_job_status_response_dto = cls( background_task=background_task, - clip_encoding=clip_encoding, + duplicate_detection=duplicate_detection, + face_detection=face_detection, + facial_recognition=facial_recognition, + library=library, metadata_extraction=metadata_extraction, - object_tagging=object_tagging, - recognize_faces=recognize_faces, + migration=migration, + notifications=notifications, search=search, sidecar=sidecar, + smart_search=smart_search, storage_template_migration=storage_template_migration, thumbnail_generation=thumbnail_generation, video_conversion=video_conversion, diff --git a/immich_carddav_sync/immich_client/models/api_key_create_dto.py b/immich_carddav_sync/immich_client/models/api_key_create_dto.py index 6ea927f..4fc6eb3 100644 --- a/immich_carddav_sync/immich_client/models/api_key_create_dto.py +++ b/immich_carddav_sync/immich_client/models/api_key_create_dto.py @@ -3,6 +3,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.permission import Permission from ..types import UNSET, Unset T = TypeVar("T", bound="APIKeyCreateDto") @@ -12,18 +13,29 @@ class APIKeyCreateDto: """ Attributes: + permissions (List[Permission]): name (Union[Unset, str]): """ + permissions: List[Permission] name: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + permissions = [] + for permissions_item_data in self.permissions: + permissions_item = permissions_item_data.value + permissions.append(permissions_item) + name = self.name field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) + field_dict.update( + { + "permissions": permissions, + } + ) if name is not UNSET: field_dict["name"] = name @@ -32,9 +44,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + permissions = [] + _permissions = d.pop("permissions") + for permissions_item_data in _permissions: + permissions_item = Permission(permissions_item_data) + + permissions.append(permissions_item) + name = d.pop("name", UNSET) api_key_create_dto = cls( + permissions=permissions, name=name, ) diff --git a/immich_carddav_sync/immich_client/models/api_key_response_dto.py b/immich_carddav_sync/immich_client/models/api_key_response_dto.py index 035fc3f..66572af 100644 --- a/immich_carddav_sync/immich_client/models/api_key_response_dto.py +++ b/immich_carddav_sync/immich_client/models/api_key_response_dto.py @@ -5,6 +5,8 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse +from ..models.permission import Permission + T = TypeVar("T", bound="APIKeyResponseDto") @@ -15,12 +17,14 @@ class APIKeyResponseDto: created_at (datetime.datetime): id (str): name (str): + permissions (List[Permission]): updated_at (datetime.datetime): """ created_at: datetime.datetime id: str name: str + permissions: List[Permission] updated_at: datetime.datetime additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -28,7 +32,14 @@ def to_dict(self) -> Dict[str, Any]: created_at = self.created_at.isoformat() id = self.id + name = self.name + + permissions = [] + for permissions_item_data in self.permissions: + permissions_item = permissions_item_data.value + permissions.append(permissions_item) + updated_at = self.updated_at.isoformat() field_dict: Dict[str, Any] = {} @@ -38,6 +49,7 @@ def to_dict(self) -> Dict[str, Any]: "createdAt": created_at, "id": id, "name": name, + "permissions": permissions, "updatedAt": updated_at, } ) @@ -53,12 +65,20 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: name = d.pop("name") + permissions = [] + _permissions = d.pop("permissions") + for permissions_item_data in _permissions: + permissions_item = Permission(permissions_item_data) + + permissions.append(permissions_item) + updated_at = isoparse(d.pop("updatedAt")) api_key_response_dto = cls( created_at=created_at, id=id, name=name, + permissions=permissions, updated_at=updated_at, ) diff --git a/immich_carddav_sync/immich_client/models/check_duplicate_asset_response_dto.py b/immich_carddav_sync/immich_client/models/asset_bulk_delete_dto.py similarity index 57% rename from immich_carddav_sync/immich_client/models/check_duplicate_asset_response_dto.py rename to immich_carddav_sync/immich_client/models/asset_bulk_delete_dto.py index 8f77f7b..9acbf2e 100644 --- a/immich_carddav_sync/immich_client/models/check_duplicate_asset_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_delete_dto.py @@ -1,55 +1,65 @@ 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="CheckDuplicateAssetResponseDto") +T = TypeVar("T", bound="AssetBulkDeleteDto") @_attrs_define -class CheckDuplicateAssetResponseDto: +class AssetBulkDeleteDto: """ Attributes: - is_exist (bool): - id (Union[Unset, str]): + ids (List[UUID]): + force (Union[Unset, bool]): """ - is_exist: bool - id: Union[Unset, str] = UNSET + ids: List[UUID] + force: Union[Unset, bool] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - is_exist = self.is_exist - id = self.id + ids = [] + for ids_item_data in self.ids: + ids_item = str(ids_item_data) + ids.append(ids_item) + + force = self.force field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "isExist": is_exist, + "ids": ids, } ) - if id is not UNSET: - field_dict["id"] = id + 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() - is_exist = d.pop("isExist") + ids = [] + _ids = d.pop("ids") + for ids_item_data in _ids: + ids_item = UUID(ids_item_data) + + ids.append(ids_item) - id = d.pop("id", UNSET) + force = d.pop("force", UNSET) - check_duplicate_asset_response_dto = cls( - is_exist=is_exist, - id=id, + asset_bulk_delete_dto = cls( + ids=ids, + force=force, ) - check_duplicate_asset_response_dto.additional_properties = d - return check_duplicate_asset_response_dto + asset_bulk_delete_dto.additional_properties = d + return asset_bulk_delete_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/asset_bulk_update_dto.py b/immich_carddav_sync/immich_client/models/asset_bulk_update_dto.py index 5287d44..ad1192c 100644 --- a/immich_carddav_sync/immich_client/models/asset_bulk_update_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_update_dto.py @@ -1,4 +1,5 @@ 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 @@ -12,22 +13,50 @@ class AssetBulkUpdateDto: """ Attributes: - ids (List[str]): + ids (List[UUID]): + date_time_original (Union[Unset, str]): + duplicate_id (Union[None, Unset, str]): is_archived (Union[Unset, bool]): is_favorite (Union[Unset, bool]): + latitude (Union[Unset, float]): + longitude (Union[Unset, float]): + rating (Union[Unset, float]): """ - ids: List[str] + ids: List[UUID] + date_time_original: Union[Unset, str] = UNSET + duplicate_id: Union[None, Unset, str] = UNSET is_archived: Union[Unset, bool] = UNSET is_favorite: Union[Unset, bool] = UNSET + latitude: Union[Unset, float] = UNSET + longitude: Union[Unset, float] = UNSET + rating: Union[Unset, float] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - ids = self.ids + ids = [] + for ids_item_data in self.ids: + ids_item = str(ids_item_data) + ids.append(ids_item) + + date_time_original = self.date_time_original + + duplicate_id: Union[None, Unset, str] + if isinstance(self.duplicate_id, Unset): + duplicate_id = UNSET + else: + duplicate_id = self.duplicate_id is_archived = self.is_archived + is_favorite = self.is_favorite + latitude = self.latitude + + longitude = self.longitude + + rating = self.rating + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -35,26 +64,63 @@ def to_dict(self) -> Dict[str, Any]: "ids": ids, } ) + if date_time_original is not UNSET: + field_dict["dateTimeOriginal"] = date_time_original + if duplicate_id is not UNSET: + field_dict["duplicateId"] = duplicate_id if is_archived is not UNSET: field_dict["isArchived"] = is_archived if is_favorite is not UNSET: field_dict["isFavorite"] = is_favorite + if latitude is not UNSET: + field_dict["latitude"] = latitude + if longitude is not UNSET: + field_dict["longitude"] = longitude + if rating is not UNSET: + field_dict["rating"] = rating return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - ids = cast(List[str], d.pop("ids")) + ids = [] + _ids = d.pop("ids") + for ids_item_data in _ids: + ids_item = UUID(ids_item_data) + + ids.append(ids_item) + + date_time_original = d.pop("dateTimeOriginal", UNSET) + + def _parse_duplicate_id(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) + + duplicate_id = _parse_duplicate_id(d.pop("duplicateId", UNSET)) is_archived = d.pop("isArchived", UNSET) is_favorite = d.pop("isFavorite", UNSET) + latitude = d.pop("latitude", UNSET) + + longitude = d.pop("longitude", UNSET) + + rating = d.pop("rating", UNSET) + asset_bulk_update_dto = cls( ids=ids, + date_time_original=date_time_original, + duplicate_id=duplicate_id, is_archived=is_archived, is_favorite=is_favorite, + latitude=latitude, + longitude=longitude, + rating=rating, ) asset_bulk_update_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_dto.py b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_dto.py index 908f0c8..cb4571f 100644 --- a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_dto.py @@ -24,7 +24,6 @@ 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) field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_item.py b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_item.py index c54b74a..11a1640 100644 --- a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_item.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_item.py @@ -20,6 +20,7 @@ class AssetBulkUploadCheckItem: def to_dict(self) -> Dict[str, Any]: checksum = self.checksum + id = self.id field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_response_dto.py b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_response_dto.py index 91bdffd..5f6f53d 100644 --- a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_response_dto.py @@ -24,7 +24,6 @@ def to_dict(self) -> Dict[str, Any]: results = [] for results_item_data in self.results: results_item = results_item_data.to_dict() - results.append(results_item) field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_result.py b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_result.py index 3de271c..47672b8 100644 --- a/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_result.py +++ b/immich_carddav_sync/immich_client/models/asset_bulk_upload_check_result.py @@ -17,12 +17,14 @@ class AssetBulkUploadCheckResult: action (AssetBulkUploadCheckResultAction): id (str): asset_id (Union[Unset, str]): + is_trashed (Union[Unset, bool]): reason (Union[Unset, AssetBulkUploadCheckResultReason]): """ action: AssetBulkUploadCheckResultAction id: str asset_id: Union[Unset, str] = UNSET + is_trashed: Union[Unset, bool] = UNSET reason: Union[Unset, AssetBulkUploadCheckResultReason] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -30,7 +32,11 @@ def to_dict(self) -> Dict[str, Any]: action = self.action.value id = self.id + asset_id = self.asset_id + + is_trashed = self.is_trashed + reason: Union[Unset, str] = UNSET if not isinstance(self.reason, Unset): reason = self.reason.value @@ -45,6 +51,8 @@ def to_dict(self) -> Dict[str, Any]: ) if asset_id is not UNSET: field_dict["assetId"] = asset_id + if is_trashed is not UNSET: + field_dict["isTrashed"] = is_trashed if reason is not UNSET: field_dict["reason"] = reason @@ -59,6 +67,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: asset_id = d.pop("assetId", UNSET) + is_trashed = d.pop("isTrashed", UNSET) + _reason = d.pop("reason", UNSET) reason: Union[Unset, AssetBulkUploadCheckResultReason] if isinstance(_reason, Unset): @@ -70,6 +80,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: action=action, id=id, asset_id=asset_id, + is_trashed=is_trashed, reason=reason, ) diff --git a/immich_carddav_sync/immich_client/models/asset_face_response_dto.py b/immich_carddav_sync/immich_client/models/asset_face_response_dto.py new file mode 100644 index 0000000..0531f10 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_face_response_dto.py @@ -0,0 +1,159 @@ +from typing import TYPE_CHECKING, 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 ..models.source_type import SourceType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.person_response_dto import PersonResponseDto + + +T = TypeVar("T", bound="AssetFaceResponseDto") + + +@_attrs_define +class AssetFaceResponseDto: + """ + Attributes: + bounding_box_x1 (int): + bounding_box_x2 (int): + bounding_box_y1 (int): + bounding_box_y2 (int): + id (UUID): + image_height (int): + image_width (int): + person (Union['PersonResponseDto', None]): + source_type (Union[Unset, SourceType]): + """ + + bounding_box_x1: int + bounding_box_x2: int + bounding_box_y1: int + bounding_box_y2: int + id: UUID + image_height: int + image_width: int + person: Union["PersonResponseDto", None] + source_type: Union[Unset, SourceType] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.person_response_dto import PersonResponseDto + + bounding_box_x1 = self.bounding_box_x1 + + bounding_box_x2 = self.bounding_box_x2 + + bounding_box_y1 = self.bounding_box_y1 + + bounding_box_y2 = self.bounding_box_y2 + + id = str(self.id) + + image_height = self.image_height + + image_width = self.image_width + + person: Union[Dict[str, Any], None] + if isinstance(self.person, PersonResponseDto): + person = self.person.to_dict() + else: + person = self.person + + source_type: Union[Unset, str] = UNSET + if not isinstance(self.source_type, Unset): + source_type = self.source_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "boundingBoxX1": bounding_box_x1, + "boundingBoxX2": bounding_box_x2, + "boundingBoxY1": bounding_box_y1, + "boundingBoxY2": bounding_box_y2, + "id": id, + "imageHeight": image_height, + "imageWidth": image_width, + "person": person, + } + ) + if source_type is not UNSET: + field_dict["sourceType"] = source_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.person_response_dto import PersonResponseDto + + d = src_dict.copy() + bounding_box_x1 = d.pop("boundingBoxX1") + + bounding_box_x2 = d.pop("boundingBoxX2") + + bounding_box_y1 = d.pop("boundingBoxY1") + + bounding_box_y2 = d.pop("boundingBoxY2") + + id = UUID(d.pop("id")) + + image_height = d.pop("imageHeight") + + image_width = d.pop("imageWidth") + + def _parse_person(data: object) -> Union["PersonResponseDto", None]: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + person_type_1 = PersonResponseDto.from_dict(data) + + return person_type_1 + except: # noqa: E722 + pass + return cast(Union["PersonResponseDto", None], data) + + person = _parse_person(d.pop("person")) + + _source_type = d.pop("sourceType", UNSET) + source_type: Union[Unset, SourceType] + if isinstance(_source_type, Unset): + source_type = UNSET + else: + source_type = SourceType(_source_type) + + asset_face_response_dto = cls( + bounding_box_x1=bounding_box_x1, + bounding_box_x2=bounding_box_x2, + bounding_box_y1=bounding_box_y1, + bounding_box_y2=bounding_box_y2, + id=id, + image_height=image_height, + image_width=image_width, + person=person, + source_type=source_type, + ) + + asset_face_response_dto.additional_properties = d + return asset_face_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_face_update_dto.py b/immich_carddav_sync/immich_client/models/asset_face_update_dto.py new file mode 100644 index 0000000..1c781ac --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_face_update_dto.py @@ -0,0 +1,72 @@ +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_face_update_item import AssetFaceUpdateItem + + +T = TypeVar("T", bound="AssetFaceUpdateDto") + + +@_attrs_define +class AssetFaceUpdateDto: + """ + Attributes: + data (List['AssetFaceUpdateItem']): + """ + + data: List["AssetFaceUpdateItem"] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_face_update_item import AssetFaceUpdateItem + + d = src_dict.copy() + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = AssetFaceUpdateItem.from_dict(data_item_data) + + data.append(data_item) + + asset_face_update_dto = cls( + data=data, + ) + + asset_face_update_dto.additional_properties = d + return asset_face_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/delete_asset_response_dto.py b/immich_carddav_sync/immich_client/models/asset_face_update_item.py similarity index 64% rename from immich_carddav_sync/immich_client/models/delete_asset_response_dto.py rename to immich_carddav_sync/immich_client/models/asset_face_update_item.py index d74d550..4043fa6 100644 --- a/immich_carddav_sync/immich_client/models/delete_asset_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_face_update_item.py @@ -1,35 +1,35 @@ 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.delete_asset_status import DeleteAssetStatus - -T = TypeVar("T", bound="DeleteAssetResponseDto") +T = TypeVar("T", bound="AssetFaceUpdateItem") @_attrs_define -class DeleteAssetResponseDto: +class AssetFaceUpdateItem: """ Attributes: - id (str): - status (DeleteAssetStatus): + asset_id (UUID): + person_id (UUID): """ - id: str - status: DeleteAssetStatus + asset_id: UUID + person_id: UUID 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 + asset_id = str(self.asset_id) + + person_id = str(self.person_id) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "id": id, - "status": status, + "assetId": asset_id, + "personId": person_id, } ) @@ -38,17 +38,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - id = d.pop("id") + asset_id = UUID(d.pop("assetId")) - status = DeleteAssetStatus(d.pop("status")) + person_id = UUID(d.pop("personId")) - delete_asset_response_dto = cls( - id=id, - status=status, + asset_face_update_item = cls( + asset_id=asset_id, + person_id=person_id, ) - delete_asset_response_dto.additional_properties = d - return delete_asset_response_dto + asset_face_update_item.additional_properties = d + return asset_face_update_item @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/asset_face_without_person_response_dto.py b/immich_carddav_sync/immich_client/models/asset_face_without_person_response_dto.py new file mode 100644 index 0000000..1c0b1eb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/asset_face_without_person_response_dto.py @@ -0,0 +1,126 @@ +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.source_type import SourceType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AssetFaceWithoutPersonResponseDto") + + +@_attrs_define +class AssetFaceWithoutPersonResponseDto: + """ + Attributes: + bounding_box_x1 (int): + bounding_box_x2 (int): + bounding_box_y1 (int): + bounding_box_y2 (int): + id (UUID): + image_height (int): + image_width (int): + source_type (Union[Unset, SourceType]): + """ + + bounding_box_x1: int + bounding_box_x2: int + bounding_box_y1: int + bounding_box_y2: int + id: UUID + image_height: int + image_width: int + source_type: Union[Unset, SourceType] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + bounding_box_x1 = self.bounding_box_x1 + + bounding_box_x2 = self.bounding_box_x2 + + bounding_box_y1 = self.bounding_box_y1 + + bounding_box_y2 = self.bounding_box_y2 + + id = str(self.id) + + image_height = self.image_height + + image_width = self.image_width + + source_type: Union[Unset, str] = UNSET + if not isinstance(self.source_type, Unset): + source_type = self.source_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "boundingBoxX1": bounding_box_x1, + "boundingBoxX2": bounding_box_x2, + "boundingBoxY1": bounding_box_y1, + "boundingBoxY2": bounding_box_y2, + "id": id, + "imageHeight": image_height, + "imageWidth": image_width, + } + ) + if source_type is not UNSET: + field_dict["sourceType"] = source_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + bounding_box_x1 = d.pop("boundingBoxX1") + + bounding_box_x2 = d.pop("boundingBoxX2") + + bounding_box_y1 = d.pop("boundingBoxY1") + + bounding_box_y2 = d.pop("boundingBoxY2") + + id = UUID(d.pop("id")) + + image_height = d.pop("imageHeight") + + image_width = d.pop("imageWidth") + + _source_type = d.pop("sourceType", UNSET) + source_type: Union[Unset, SourceType] + if isinstance(_source_type, Unset): + source_type = UNSET + else: + source_type = SourceType(_source_type) + + asset_face_without_person_response_dto = cls( + bounding_box_x1=bounding_box_x1, + bounding_box_x2=bounding_box_x2, + bounding_box_y1=bounding_box_y1, + bounding_box_y2=bounding_box_y2, + id=id, + image_height=image_height, + image_width=image_width, + source_type=source_type, + ) + + asset_face_without_person_response_dto.additional_properties = d + return asset_face_without_person_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_ids_dto.py b/immich_carddav_sync/immich_client/models/asset_ids_dto.py index 99e3a8e..735d7cb 100644 --- a/immich_carddav_sync/immich_client/models/asset_ids_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_ids_dto.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +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 @@ -10,14 +11,17 @@ class AssetIdsDto: """ Attributes: - asset_ids (List[str]): + asset_ids (List[UUID]): """ - asset_ids: List[str] + asset_ids: List[UUID] additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - asset_ids = self.asset_ids + 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) @@ -32,7 +36,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - asset_ids = cast(List[str], d.pop("assetIds")) + 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) asset_ids_dto = cls( asset_ids=asset_ids, diff --git a/immich_carddav_sync/immich_client/models/asset_ids_response_dto.py b/immich_carddav_sync/immich_client/models/asset_ids_response_dto.py index fa5ab3d..2ea4138 100644 --- a/immich_carddav_sync/immich_client/models/asset_ids_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_ids_response_dto.py @@ -25,7 +25,9 @@ class AssetIdsResponseDto: def to_dict(self) -> Dict[str, Any]: asset_id = self.asset_id + success = self.success + error: Union[Unset, str] = UNSET if not isinstance(self.error, Unset): error = self.error.value diff --git a/immich_carddav_sync/immich_client/models/asset_job_name.py b/immich_carddav_sync/immich_client/models/asset_job_name.py index d0df73d..18a8740 100644 --- a/immich_carddav_sync/immich_client/models/asset_job_name.py +++ b/immich_carddav_sync/immich_client/models/asset_job_name.py @@ -2,6 +2,7 @@ class AssetJobName(str, Enum): + REFRESH_FACES = "refresh-faces" REFRESH_METADATA = "refresh-metadata" REGENERATE_THUMBNAIL = "regenerate-thumbnail" TRANSCODE_VIDEO = "transcode-video" diff --git a/immich_carddav_sync/immich_client/models/asset_jobs_dto.py b/immich_carddav_sync/immich_client/models/asset_jobs_dto.py index 75a648b..6859022 100644 --- a/immich_carddav_sync/immich_client/models/asset_jobs_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_jobs_dto.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +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 @@ -12,16 +13,19 @@ class AssetJobsDto: """ Attributes: - asset_ids (List[str]): + asset_ids (List[UUID]): name (AssetJobName): """ - asset_ids: List[str] + asset_ids: List[UUID] name: AssetJobName additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - asset_ids = self.asset_ids + 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) name = self.name.value @@ -39,7 +43,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - asset_ids = cast(List[str], d.pop("assetIds")) + 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) name = AssetJobName(d.pop("name")) diff --git a/immich_carddav_sync/immich_client/models/thumbnail_format.py b/immich_carddav_sync/immich_client/models/asset_order.py similarity index 55% rename from immich_carddav_sync/immich_client/models/thumbnail_format.py rename to immich_carddav_sync/immich_client/models/asset_order.py index a34596d..a28bedb 100644 --- a/immich_carddav_sync/immich_client/models/thumbnail_format.py +++ b/immich_carddav_sync/immich_client/models/asset_order.py @@ -1,9 +1,9 @@ from enum import Enum -class ThumbnailFormat(str, Enum): - JPEG = "JPEG" - WEBP = "WEBP" +class AssetOrder(str, Enum): + ASC = "asc" + DESC = "desc" def __str__(self) -> str: return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/asset_response_dto.py b/immich_carddav_sync/immich_client/models/asset_response_dto.py index ec571fe..8d0c720 100644 --- a/immich_carddav_sync/immich_client/models/asset_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_response_dto.py @@ -1,5 +1,5 @@ import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, TypeVar, Union +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 @@ -9,10 +9,13 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.asset_face_without_person_response_dto import AssetFaceWithoutPersonResponseDto + from ..models.asset_stack_response_dto import AssetStackResponseDto from ..models.exif_response_dto import ExifResponseDto - from ..models.person_response_dto import PersonResponseDto + from ..models.person_with_faces_response_dto import PersonWithFacesResponseDto from ..models.smart_info_response_dto import SmartInfoResponseDto from ..models.tag_response_dto import TagResponseDto + from ..models.user_response_dto import UserResponseDto T = TypeVar("T", bound="AssetResponseDto") @@ -28,21 +31,31 @@ class AssetResponseDto: duration (str): file_created_at (datetime.datetime): file_modified_at (datetime.datetime): + has_metadata (bool): id (str): is_archived (bool): is_favorite (bool): + is_offline (bool): + is_trashed (bool): + local_date_time (datetime.datetime): original_file_name (str): original_path (str): owner_id (str): - resized (bool): + thumbhash (Union[None, str]): type (AssetTypeEnum): updated_at (datetime.datetime): + duplicate_id (Union[None, Unset, str]): exif_info (Union[Unset, ExifResponseDto]): - live_photo_video_id (Union[Unset, None, str]): - people (Union[Unset, List['PersonResponseDto']]): + library_id (Union[None, Unset, str]): This property was deprecated in v1.106.0 + live_photo_video_id (Union[None, Unset, str]): + original_mime_type (Union[Unset, str]): + owner (Union[Unset, UserResponseDto]): + people (Union[Unset, List['PersonWithFacesResponseDto']]): + resized (Union[Unset, bool]): This property was deprecated in v1.113.0 smart_info (Union[Unset, SmartInfoResponseDto]): + stack (Union['AssetStackResponseDto', None, Unset]): tags (Union[Unset, List['TagResponseDto']]): - thumbhash (Optional[str]): base64 encoded thumbhash + unassigned_faces (Union[Unset, List['AssetFaceWithoutPersonResponseDto']]): """ checksum: str @@ -51,69 +64,137 @@ class AssetResponseDto: duration: str file_created_at: datetime.datetime file_modified_at: datetime.datetime + has_metadata: bool id: str is_archived: bool is_favorite: bool + is_offline: bool + is_trashed: bool + local_date_time: datetime.datetime original_file_name: str original_path: str owner_id: str - resized: bool + thumbhash: Union[None, str] type: AssetTypeEnum updated_at: datetime.datetime - thumbhash: Optional[str] + duplicate_id: Union[None, Unset, str] = UNSET exif_info: Union[Unset, "ExifResponseDto"] = UNSET - live_photo_video_id: Union[Unset, None, str] = UNSET - people: Union[Unset, List["PersonResponseDto"]] = UNSET + library_id: Union[None, Unset, str] = UNSET + live_photo_video_id: Union[None, Unset, str] = UNSET + original_mime_type: Union[Unset, str] = UNSET + owner: Union[Unset, "UserResponseDto"] = UNSET + people: Union[Unset, List["PersonWithFacesResponseDto"]] = UNSET + resized: Union[Unset, bool] = UNSET smart_info: Union[Unset, "SmartInfoResponseDto"] = UNSET + stack: Union["AssetStackResponseDto", None, Unset] = UNSET tags: Union[Unset, List["TagResponseDto"]] = UNSET + unassigned_faces: Union[Unset, List["AssetFaceWithoutPersonResponseDto"]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ..models.asset_stack_response_dto import AssetStackResponseDto + checksum = self.checksum + device_asset_id = self.device_asset_id + device_id = self.device_id + duration = self.duration + file_created_at = self.file_created_at.isoformat() file_modified_at = self.file_modified_at.isoformat() + has_metadata = self.has_metadata + id = self.id + is_archived = self.is_archived + is_favorite = self.is_favorite + + is_offline = self.is_offline + + is_trashed = self.is_trashed + + local_date_time = self.local_date_time.isoformat() + original_file_name = self.original_file_name + original_path = self.original_path + owner_id = self.owner_id - resized = self.resized + + thumbhash: Union[None, str] + thumbhash = self.thumbhash + type = self.type.value updated_at = self.updated_at.isoformat() + duplicate_id: Union[None, Unset, str] + if isinstance(self.duplicate_id, Unset): + duplicate_id = UNSET + else: + duplicate_id = self.duplicate_id + exif_info: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.exif_info, Unset): exif_info = self.exif_info.to_dict() - live_photo_video_id = self.live_photo_video_id + library_id: Union[None, Unset, str] + if isinstance(self.library_id, Unset): + library_id = UNSET + else: + library_id = self.library_id + + live_photo_video_id: Union[None, Unset, str] + if isinstance(self.live_photo_video_id, Unset): + live_photo_video_id = UNSET + else: + live_photo_video_id = self.live_photo_video_id + + original_mime_type = self.original_mime_type + + owner: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.owner, Unset): + owner = self.owner.to_dict() + people: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.people, Unset): people = [] for people_item_data in self.people: people_item = people_item_data.to_dict() - people.append(people_item) + resized = self.resized + smart_info: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.smart_info, Unset): smart_info = self.smart_info.to_dict() + stack: Union[Dict[str, Any], None, Unset] + if isinstance(self.stack, Unset): + stack = UNSET + elif isinstance(self.stack, AssetStackResponseDto): + stack = self.stack.to_dict() + else: + stack = self.stack + tags: Union[Unset, List[Dict[str, Any]]] = UNSET if not isinstance(self.tags, Unset): tags = [] for tags_item_data in self.tags: tags_item = tags_item_data.to_dict() - tags.append(tags_item) - thumbhash = self.thumbhash + unassigned_faces: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.unassigned_faces, Unset): + unassigned_faces = [] + for unassigned_faces_item_data in self.unassigned_faces: + unassigned_faces_item = unassigned_faces_item_data.to_dict() + unassigned_faces.append(unassigned_faces_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -125,37 +206,57 @@ def to_dict(self) -> Dict[str, Any]: "duration": duration, "fileCreatedAt": file_created_at, "fileModifiedAt": file_modified_at, + "hasMetadata": has_metadata, "id": id, "isArchived": is_archived, "isFavorite": is_favorite, + "isOffline": is_offline, + "isTrashed": is_trashed, + "localDateTime": local_date_time, "originalFileName": original_file_name, "originalPath": original_path, "ownerId": owner_id, - "resized": resized, + "thumbhash": thumbhash, "type": type, "updatedAt": updated_at, - "thumbhash": thumbhash, } ) + if duplicate_id is not UNSET: + field_dict["duplicateId"] = duplicate_id if exif_info is not UNSET: field_dict["exifInfo"] = exif_info + if library_id is not UNSET: + field_dict["libraryId"] = library_id if live_photo_video_id is not UNSET: field_dict["livePhotoVideoId"] = live_photo_video_id + if original_mime_type is not UNSET: + field_dict["originalMimeType"] = original_mime_type + if owner is not UNSET: + field_dict["owner"] = owner if people is not UNSET: field_dict["people"] = people + if resized is not UNSET: + field_dict["resized"] = resized if smart_info is not UNSET: field_dict["smartInfo"] = smart_info + if stack is not UNSET: + field_dict["stack"] = stack if tags is not UNSET: field_dict["tags"] = tags + if unassigned_faces is not UNSET: + field_dict["unassignedFaces"] = unassigned_faces return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_face_without_person_response_dto import AssetFaceWithoutPersonResponseDto + from ..models.asset_stack_response_dto import AssetStackResponseDto from ..models.exif_response_dto import ExifResponseDto - from ..models.person_response_dto import PersonResponseDto + from ..models.person_with_faces_response_dto import PersonWithFacesResponseDto from ..models.smart_info_response_dto import SmartInfoResponseDto from ..models.tag_response_dto import TagResponseDto + from ..models.user_response_dto import UserResponseDto d = src_dict.copy() checksum = d.pop("checksum") @@ -170,24 +271,46 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: file_modified_at = isoparse(d.pop("fileModifiedAt")) + has_metadata = d.pop("hasMetadata") + id = d.pop("id") is_archived = d.pop("isArchived") is_favorite = d.pop("isFavorite") + is_offline = d.pop("isOffline") + + is_trashed = d.pop("isTrashed") + + local_date_time = isoparse(d.pop("localDateTime")) + original_file_name = d.pop("originalFileName") original_path = d.pop("originalPath") owner_id = d.pop("ownerId") - resized = d.pop("resized") + def _parse_thumbhash(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + thumbhash = _parse_thumbhash(d.pop("thumbhash")) type = AssetTypeEnum(d.pop("type")) updated_at = isoparse(d.pop("updatedAt")) + def _parse_duplicate_id(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) + + duplicate_id = _parse_duplicate_id(d.pop("duplicateId", UNSET)) + _exif_info = d.pop("exifInfo", UNSET) exif_info: Union[Unset, ExifResponseDto] if isinstance(_exif_info, Unset): @@ -195,15 +318,42 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: exif_info = ExifResponseDto.from_dict(_exif_info) - live_photo_video_id = d.pop("livePhotoVideoId", UNSET) + def _parse_library_id(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) + + library_id = _parse_library_id(d.pop("libraryId", UNSET)) + + def _parse_live_photo_video_id(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) + + live_photo_video_id = _parse_live_photo_video_id(d.pop("livePhotoVideoId", UNSET)) + + original_mime_type = d.pop("originalMimeType", UNSET) + + _owner = d.pop("owner", UNSET) + owner: Union[Unset, UserResponseDto] + if isinstance(_owner, Unset): + owner = UNSET + else: + owner = UserResponseDto.from_dict(_owner) people = [] _people = d.pop("people", UNSET) for people_item_data in _people or []: - people_item = PersonResponseDto.from_dict(people_item_data) + people_item = PersonWithFacesResponseDto.from_dict(people_item_data) people.append(people_item) + resized = d.pop("resized", UNSET) + _smart_info = d.pop("smartInfo", UNSET) smart_info: Union[Unset, SmartInfoResponseDto] if isinstance(_smart_info, Unset): @@ -211,6 +361,23 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: smart_info = SmartInfoResponseDto.from_dict(_smart_info) + def _parse_stack(data: object) -> Union["AssetStackResponseDto", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + stack_type_1 = AssetStackResponseDto.from_dict(data) + + return stack_type_1 + except: # noqa: E722 + pass + return cast(Union["AssetStackResponseDto", None, Unset], data) + + stack = _parse_stack(d.pop("stack", UNSET)) + tags = [] _tags = d.pop("tags", UNSET) for tags_item_data in _tags or []: @@ -218,7 +385,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: tags.append(tags_item) - thumbhash = d.pop("thumbhash") + unassigned_faces = [] + _unassigned_faces = d.pop("unassignedFaces", UNSET) + for unassigned_faces_item_data in _unassigned_faces or []: + unassigned_faces_item = AssetFaceWithoutPersonResponseDto.from_dict(unassigned_faces_item_data) + + unassigned_faces.append(unassigned_faces_item) asset_response_dto = cls( checksum=checksum, @@ -227,21 +399,31 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: duration=duration, file_created_at=file_created_at, file_modified_at=file_modified_at, + has_metadata=has_metadata, id=id, is_archived=is_archived, is_favorite=is_favorite, + is_offline=is_offline, + is_trashed=is_trashed, + local_date_time=local_date_time, original_file_name=original_file_name, original_path=original_path, owner_id=owner_id, - resized=resized, + thumbhash=thumbhash, type=type, updated_at=updated_at, + duplicate_id=duplicate_id, exif_info=exif_info, + library_id=library_id, live_photo_video_id=live_photo_video_id, + original_mime_type=original_mime_type, + owner=owner, people=people, + resized=resized, smart_info=smart_info, + stack=stack, tags=tags, - thumbhash=thumbhash, + unassigned_faces=unassigned_faces, ) asset_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/asset_stats_response_dto.py b/immich_carddav_sync/immich_client/models/asset_stats_response_dto.py index afb9db9..2a35670 100644 --- a/immich_carddav_sync/immich_client/models/asset_stats_response_dto.py +++ b/immich_carddav_sync/immich_client/models/asset_stats_response_dto.py @@ -22,7 +22,9 @@ class AssetStatsResponseDto: def to_dict(self) -> Dict[str, Any]: images = self.images + total = self.total + videos = self.videos field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/audio_codec.py b/immich_carddav_sync/immich_client/models/audio_codec.py index 942939a..60dd866 100644 --- a/immich_carddav_sync/immich_client/models/audio_codec.py +++ b/immich_carddav_sync/immich_client/models/audio_codec.py @@ -3,8 +3,8 @@ class AudioCodec(str, Enum): AAC = "aac" + LIBOPUS = "libopus" MP3 = "mp3" - OPUS = "opus" def __str__(self) -> str: return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/delete_asset_dto.py b/immich_carddav_sync/immich_client/models/audit_deletes_response_dto.py similarity index 71% rename from immich_carddav_sync/immich_client/models/delete_asset_dto.py rename to immich_carddav_sync/immich_client/models/audit_deletes_response_dto.py index a49c2ec..784b5fe 100644 --- a/immich_carddav_sync/immich_client/models/delete_asset_dto.py +++ b/immich_carddav_sync/immich_client/models/audit_deletes_response_dto.py @@ -3,28 +3,32 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="DeleteAssetDto") +T = TypeVar("T", bound="AuditDeletesResponseDto") @_attrs_define -class DeleteAssetDto: +class AuditDeletesResponseDto: """ Attributes: - ids (List[str]): Example: ['bf973405-3f2a-48d2-a687-2ed4167164be', 'dd41870b-5d00-46d2-924e-1d8489a0aa0f', - 'fad77c3f-deef-4e7e-9608-14c1aa4e559a']. + ids (List[str]): + needs_full_sync (bool): """ ids: List[str] + needs_full_sync: bool additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: ids = self.ids + needs_full_sync = self.needs_full_sync + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "ids": ids, + "needsFullSync": needs_full_sync, } ) @@ -35,12 +39,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() ids = cast(List[str], d.pop("ids")) - delete_asset_dto = cls( + needs_full_sync = d.pop("needsFullSync") + + audit_deletes_response_dto = cls( ids=ids, + needs_full_sync=needs_full_sync, ) - delete_asset_dto.additional_properties = d - return delete_asset_dto + audit_deletes_response_dto.additional_properties = d + return audit_deletes_response_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/auth_device_response_dto.py b/immich_carddav_sync/immich_client/models/auth_device_response_dto.py deleted file mode 100644 index 353850d..0000000 --- a/immich_carddav_sync/immich_client/models/auth_device_response_dto.py +++ /dev/null @@ -1,93 +0,0 @@ -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="AuthDeviceResponseDto") - - -@_attrs_define -class AuthDeviceResponseDto: - """ - 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") - - auth_device_response_dto = cls( - created_at=created_at, - current=current, - device_os=device_os, - device_type=device_type, - id=id, - updated_at=updated_at, - ) - - auth_device_response_dto.additional_properties = d - return auth_device_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/bulk_id_response_dto.py b/immich_carddav_sync/immich_client/models/bulk_id_response_dto.py index 5a2100f..ccc9bcd 100644 --- a/immich_carddav_sync/immich_client/models/bulk_id_response_dto.py +++ b/immich_carddav_sync/immich_client/models/bulk_id_response_dto.py @@ -25,7 +25,9 @@ class BulkIdResponseDto: def to_dict(self) -> Dict[str, Any]: id = self.id + success = self.success + error: Union[Unset, str] = UNSET if not isinstance(self.error, Unset): error = self.error.value diff --git a/immich_carddav_sync/immich_client/models/bulk_ids_dto.py b/immich_carddav_sync/immich_client/models/bulk_ids_dto.py index 8f5b8d5..2c1da0d 100644 --- a/immich_carddav_sync/immich_client/models/bulk_ids_dto.py +++ b/immich_carddav_sync/immich_client/models/bulk_ids_dto.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +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 @@ -10,14 +11,17 @@ class BulkIdsDto: """ Attributes: - ids (List[str]): + ids (List[UUID]): """ - ids: List[str] + ids: List[UUID] additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - ids = self.ids + ids = [] + for ids_item_data in self.ids: + ids_item = str(ids_item_data) + ids.append(ids_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -32,7 +36,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - ids = cast(List[str], d.pop("ids")) + ids = [] + _ids = d.pop("ids") + for ids_item_data in _ids: + ids_item = UUID(ids_item_data) + + ids.append(ids_item) bulk_ids_dto = cls( ids=ids, diff --git a/immich_carddav_sync/immich_client/models/change_password_dto.py b/immich_carddav_sync/immich_client/models/change_password_dto.py index 3f8d5ef..ba7042c 100644 --- a/immich_carddav_sync/immich_client/models/change_password_dto.py +++ b/immich_carddav_sync/immich_client/models/change_password_dto.py @@ -20,6 +20,7 @@ class ChangePasswordDto: def to_dict(self) -> Dict[str, Any]: new_password = self.new_password + password = self.password field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/check_duplicate_asset_dto.py b/immich_carddav_sync/immich_client/models/check_duplicate_asset_dto.py deleted file mode 100644 index 83b4895..0000000 --- a/immich_carddav_sync/immich_client/models/check_duplicate_asset_dto.py +++ /dev/null @@ -1,65 +0,0 @@ -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="CheckDuplicateAssetDto") - - -@_attrs_define -class CheckDuplicateAssetDto: - """ - Attributes: - device_asset_id (str): - device_id (str): - """ - - device_asset_id: str - device_id: str - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - device_asset_id = self.device_asset_id - device_id = self.device_id - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "deviceAssetId": device_asset_id, - "deviceId": device_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - device_asset_id = d.pop("deviceAssetId") - - device_id = d.pop("deviceId") - - check_duplicate_asset_dto = cls( - device_asset_id=device_asset_id, - device_id=device_id, - ) - - check_duplicate_asset_dto.additional_properties = d - return check_duplicate_asset_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/create_tag_dto.py b/immich_carddav_sync/immich_client/models/clip_config.py similarity index 67% rename from immich_carddav_sync/immich_client/models/create_tag_dto.py rename to immich_carddav_sync/immich_client/models/clip_config.py index 216d38d..eaa0526 100644 --- a/immich_carddav_sync/immich_client/models/create_tag_dto.py +++ b/immich_carddav_sync/immich_client/models/clip_config.py @@ -3,33 +3,32 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.tag_type_enum import TagTypeEnum - -T = TypeVar("T", bound="CreateTagDto") +T = TypeVar("T", bound="CLIPConfig") @_attrs_define -class CreateTagDto: +class CLIPConfig: """ Attributes: - name (str): - type (TagTypeEnum): + enabled (bool): + model_name (str): """ - name: str - type: TagTypeEnum + enabled: bool + model_name: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - name = self.name - type = self.type.value + enabled = self.enabled + + model_name = self.model_name field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "name": name, - "type": type, + "enabled": enabled, + "modelName": model_name, } ) @@ -38,17 +37,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - name = d.pop("name") + enabled = d.pop("enabled") - type = TagTypeEnum(d.pop("type")) + model_name = d.pop("modelName") - create_tag_dto = cls( - name=name, - type=type, + clip_config = cls( + enabled=enabled, + model_name=model_name, ) - create_tag_dto.additional_properties = d - return create_tag_dto + clip_config.additional_properties = d + return clip_config @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/delete_asset_status.py b/immich_carddav_sync/immich_client/models/colorspace.py similarity index 51% rename from immich_carddav_sync/immich_client/models/delete_asset_status.py rename to immich_carddav_sync/immich_client/models/colorspace.py index 1ab65b4..c88823e 100644 --- a/immich_carddav_sync/immich_client/models/delete_asset_status.py +++ b/immich_carddav_sync/immich_client/models/colorspace.py @@ -1,9 +1,9 @@ from enum import Enum -class DeleteAssetStatus(str, Enum): - FAILED = "FAILED" - SUCCESS = "SUCCESS" +class Colorspace(str, Enum): + P3 = "p3" + SRGB = "srgb" def __str__(self) -> str: return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/cq_mode.py b/immich_carddav_sync/immich_client/models/cq_mode.py new file mode 100644 index 0000000..991d0eb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/cq_mode.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class CQMode(str, Enum): + AUTO = "auto" + CQP = "cqp" + ICQ = "icq" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/create_album_dto.py b/immich_carddav_sync/immich_client/models/create_album_dto.py index e2a67c3..a66fa7c 100644 --- a/immich_carddav_sync/immich_client/models/create_album_dto.py +++ b/immich_carddav_sync/immich_client/models/create_album_dto.py @@ -1,10 +1,15 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +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 ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.album_user_create_dto import AlbumUserCreateDto + + T = TypeVar("T", bound="CreateAlbumDto") @@ -13,27 +18,35 @@ class CreateAlbumDto: """ Attributes: album_name (str): - asset_ids (Union[Unset, List[str]]): + album_users (Union[Unset, List['AlbumUserCreateDto']]): + asset_ids (Union[Unset, List[UUID]]): description (Union[Unset, str]): - shared_with_user_ids (Union[Unset, List[str]]): """ album_name: str - asset_ids: Union[Unset, List[str]] = UNSET + album_users: Union[Unset, List["AlbumUserCreateDto"]] = UNSET + asset_ids: Union[Unset, List[UUID]] = UNSET description: Union[Unset, str] = UNSET - shared_with_user_ids: Union[Unset, List[str]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: album_name = self.album_name + + album_users: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.album_users, Unset): + album_users = [] + for album_users_item_data in self.album_users: + album_users_item = album_users_item_data.to_dict() + album_users.append(album_users_item) + asset_ids: Union[Unset, List[str]] = UNSET if not isinstance(self.asset_ids, Unset): - asset_ids = self.asset_ids + 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) description = self.description - shared_with_user_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.shared_with_user_ids, Unset): - shared_with_user_ids = self.shared_with_user_ids field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -42,31 +55,43 @@ def to_dict(self) -> Dict[str, Any]: "albumName": album_name, } ) + if album_users is not UNSET: + field_dict["albumUsers"] = album_users if asset_ids is not UNSET: field_dict["assetIds"] = asset_ids if description is not UNSET: field_dict["description"] = description - if shared_with_user_ids is not UNSET: - field_dict["sharedWithUserIds"] = shared_with_user_ids return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.album_user_create_dto import AlbumUserCreateDto + d = src_dict.copy() album_name = d.pop("albumName") - asset_ids = cast(List[str], d.pop("assetIds", UNSET)) + album_users = [] + _album_users = d.pop("albumUsers", UNSET) + for album_users_item_data in _album_users or []: + album_users_item = AlbumUserCreateDto.from_dict(album_users_item_data) - description = d.pop("description", UNSET) + album_users.append(album_users_item) + + 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) - shared_with_user_ids = cast(List[str], d.pop("sharedWithUserIds", UNSET)) + asset_ids.append(asset_ids_item) + + description = d.pop("description", UNSET) create_album_dto = cls( album_name=album_name, + album_users=album_users, asset_ids=asset_ids, description=description, - shared_with_user_ids=shared_with_user_ids, ) create_album_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/create_asset_dto.py b/immich_carddav_sync/immich_client/models/create_asset_dto.py deleted file mode 100644 index d70859e..0000000 --- a/immich_carddav_sync/immich_client/models/create_asset_dto.py +++ /dev/null @@ -1,239 +0,0 @@ -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, FileJsonType, Unset - -T = TypeVar("T", bound="CreateAssetDto") - - -@_attrs_define -class CreateAssetDto: - """ - Attributes: - asset_data (File): - device_asset_id (str): - device_id (str): - file_created_at (datetime.datetime): - file_modified_at (datetime.datetime): - is_favorite (bool): - duration (Union[Unset, str]): - is_archived (Union[Unset, bool]): - is_read_only (Union[Unset, bool]): - is_visible (Union[Unset, bool]): - live_photo_data (Union[Unset, File]): - 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 - is_favorite: bool - duration: Union[Unset, str] = UNSET - is_archived: Union[Unset, bool] = UNSET - is_read_only: Union[Unset, bool] = False - is_visible: Union[Unset, bool] = UNSET - live_photo_data: Union[Unset, File] = 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() - - is_favorite = self.is_favorite - duration = self.duration - is_archived = self.is_archived - is_read_only = self.is_read_only - is_visible = self.is_visible - live_photo_data: Union[Unset, FileJsonType] = UNSET - if not isinstance(self.live_photo_data, Unset): - live_photo_data = self.live_photo_data.to_tuple() - - 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, - "isFavorite": is_favorite, - } - ) - if duration is not UNSET: - field_dict["duration"] = duration - if is_archived is not UNSET: - field_dict["isArchived"] = is_archived - if is_read_only is not UNSET: - field_dict["isReadOnly"] = is_read_only - if is_visible is not UNSET: - field_dict["isVisible"] = is_visible - if live_photo_data is not UNSET: - field_dict["livePhotoData"] = live_photo_data - 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 = ( - self.device_asset_id - if isinstance(self.device_asset_id, Unset) - else (None, str(self.device_asset_id).encode(), "text/plain") - ) - device_id = ( - self.device_id if isinstance(self.device_id, Unset) else (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() - - is_favorite = ( - self.is_favorite - if isinstance(self.is_favorite, Unset) - else (None, str(self.is_favorite).encode(), "text/plain") - ) - 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_read_only = ( - self.is_read_only - if isinstance(self.is_read_only, Unset) - else (None, str(self.is_read_only).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_data: Union[Unset, FileJsonType] = UNSET - if not isinstance(self.live_photo_data, Unset): - live_photo_data = self.live_photo_data.to_tuple() - - 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( - {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} - ) - field_dict.update( - { - "assetData": asset_data, - "deviceAssetId": device_asset_id, - "deviceId": device_id, - "fileCreatedAt": file_created_at, - "fileModifiedAt": file_modified_at, - "isFavorite": is_favorite, - } - ) - if duration is not UNSET: - field_dict["duration"] = duration - if is_archived is not UNSET: - field_dict["isArchived"] = is_archived - if is_read_only is not UNSET: - field_dict["isReadOnly"] = is_read_only - if is_visible is not UNSET: - field_dict["isVisible"] = is_visible - if live_photo_data is not UNSET: - field_dict["livePhotoData"] = live_photo_data - 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")) - - is_favorite = d.pop("isFavorite") - - duration = d.pop("duration", UNSET) - - is_archived = d.pop("isArchived", UNSET) - - is_read_only = d.pop("isReadOnly", UNSET) - - is_visible = d.pop("isVisible", UNSET) - - _live_photo_data = d.pop("livePhotoData", UNSET) - live_photo_data: Union[Unset, File] - if isinstance(_live_photo_data, Unset): - live_photo_data = UNSET - else: - live_photo_data = File(payload=BytesIO(_live_photo_data)) - - _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)) - - create_asset_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, - is_favorite=is_favorite, - duration=duration, - is_archived=is_archived, - is_read_only=is_read_only, - is_visible=is_visible, - live_photo_data=live_photo_data, - sidecar_data=sidecar_data, - ) - - create_asset_dto.additional_properties = d - return create_asset_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/create_library_dto.py b/immich_carddav_sync/immich_client/models/create_library_dto.py new file mode 100644 index 0000000..c8f8abc --- /dev/null +++ b/immich_carddav_sync/immich_client/models/create_library_dto.py @@ -0,0 +1,92 @@ +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="CreateLibraryDto") + + +@_attrs_define +class CreateLibraryDto: + """ + Attributes: + owner_id (UUID): + exclusion_patterns (Union[Unset, List[str]]): + import_paths (Union[Unset, List[str]]): + name (Union[Unset, str]): + """ + + owner_id: UUID + exclusion_patterns: Union[Unset, List[str]] = UNSET + import_paths: Union[Unset, List[str]] = UNSET + name: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + owner_id = str(self.owner_id) + + 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 + + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "ownerId": owner_id, + } + ) + if exclusion_patterns is not UNSET: + field_dict["exclusionPatterns"] = exclusion_patterns + if import_paths is not UNSET: + field_dict["importPaths"] = import_paths + 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() + owner_id = UUID(d.pop("ownerId")) + + exclusion_patterns = cast(List[str], d.pop("exclusionPatterns", UNSET)) + + import_paths = cast(List[str], d.pop("importPaths", UNSET)) + + name = d.pop("name", UNSET) + + create_library_dto = cls( + owner_id=owner_id, + exclusion_patterns=exclusion_patterns, + import_paths=import_paths, + name=name, + ) + + create_library_dto.additional_properties = d + return create_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/create_profile_image_dto.py b/immich_carddav_sync/immich_client/models/create_profile_image_dto.py index b1c5dc9..5d95a86 100644 --- a/immich_carddav_sync/immich_client/models/create_profile_image_dto.py +++ b/immich_carddav_sync/immich_client/models/create_profile_image_dto.py @@ -36,9 +36,9 @@ def to_multipart(self) -> Dict[str, Any]: file = self.file.to_tuple() field_dict: Dict[str, Any] = {} - field_dict.update( - {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} - ) + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + field_dict.update( { "file": file, diff --git a/immich_carddav_sync/immich_client/models/create_profile_image_response_dto.py b/immich_carddav_sync/immich_client/models/create_profile_image_response_dto.py index a0b46ba..f86e544 100644 --- a/immich_carddav_sync/immich_client/models/create_profile_image_response_dto.py +++ b/immich_carddav_sync/immich_client/models/create_profile_image_response_dto.py @@ -1,7 +1,9 @@ +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="CreateProfileImageResponseDto") @@ -10,22 +12,28 @@ class CreateProfileImageResponseDto: """ Attributes: + profile_changed_at (datetime.datetime): profile_image_path (str): user_id (str): """ + profile_changed_at: datetime.datetime profile_image_path: str user_id: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + profile_changed_at = self.profile_changed_at.isoformat() + profile_image_path = self.profile_image_path + user_id = self.user_id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "profileChangedAt": profile_changed_at, "profileImagePath": profile_image_path, "userId": user_id, } @@ -36,11 +44,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + profile_changed_at = isoparse(d.pop("profileChangedAt")) + profile_image_path = d.pop("profileImagePath") user_id = d.pop("userId") create_profile_image_response_dto = cls( + profile_changed_at=profile_changed_at, profile_image_path=profile_image_path, user_id=user_id, ) diff --git a/immich_carddav_sync/immich_client/models/create_user_dto.py b/immich_carddav_sync/immich_client/models/create_user_dto.py deleted file mode 100644 index 229ad67..0000000 --- a/immich_carddav_sync/immich_client/models/create_user_dto.py +++ /dev/null @@ -1,105 +0,0 @@ -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="CreateUserDto") - - -@_attrs_define -class CreateUserDto: - """ - Attributes: - email (str): - first_name (str): - last_name (str): - password (str): - external_path (Union[Unset, None, str]): - memories_enabled (Union[Unset, bool]): - storage_label (Union[Unset, None, str]): - """ - - email: str - first_name: str - last_name: str - password: str - external_path: Union[Unset, None, str] = UNSET - memories_enabled: Union[Unset, bool] = UNSET - storage_label: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - email = self.email - first_name = self.first_name - last_name = self.last_name - password = self.password - external_path = self.external_path - memories_enabled = self.memories_enabled - storage_label = self.storage_label - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "email": email, - "firstName": first_name, - "lastName": last_name, - "password": password, - } - ) - if external_path is not UNSET: - field_dict["externalPath"] = external_path - if memories_enabled is not UNSET: - field_dict["memoriesEnabled"] = memories_enabled - 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") - - first_name = d.pop("firstName") - - last_name = d.pop("lastName") - - password = d.pop("password") - - external_path = d.pop("externalPath", UNSET) - - memories_enabled = d.pop("memoriesEnabled", UNSET) - - storage_label = d.pop("storageLabel", UNSET) - - create_user_dto = cls( - email=email, - first_name=first_name, - last_name=last_name, - password=password, - external_path=external_path, - memories_enabled=memories_enabled, - storage_label=storage_label, - ) - - create_user_dto.additional_properties = d - return create_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/curated_locations_response_dto.py b/immich_carddav_sync/immich_client/models/curated_locations_response_dto.py deleted file mode 100644 index 9bec7f8..0000000 --- a/immich_carddav_sync/immich_client/models/curated_locations_response_dto.py +++ /dev/null @@ -1,86 +0,0 @@ -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="CuratedLocationsResponseDto") - - -@_attrs_define -class CuratedLocationsResponseDto: - """ - Attributes: - city (str): - device_asset_id (str): - device_id (str): - id (str): - resize_path (str): - """ - - city: str - device_asset_id: str - device_id: str - id: str - resize_path: str - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - city = self.city - device_asset_id = self.device_asset_id - device_id = self.device_id - id = self.id - resize_path = self.resize_path - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "city": city, - "deviceAssetId": device_asset_id, - "deviceId": device_id, - "id": id, - "resizePath": resize_path, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - city = d.pop("city") - - device_asset_id = d.pop("deviceAssetId") - - device_id = d.pop("deviceId") - - id = d.pop("id") - - resize_path = d.pop("resizePath") - - curated_locations_response_dto = cls( - city=city, - device_asset_id=device_asset_id, - device_id=device_id, - id=id, - resize_path=resize_path, - ) - - curated_locations_response_dto.additional_properties = d - return curated_locations_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/curated_objects_response_dto.py b/immich_carddav_sync/immich_client/models/curated_objects_response_dto.py deleted file mode 100644 index e3a7889..0000000 --- a/immich_carddav_sync/immich_client/models/curated_objects_response_dto.py +++ /dev/null @@ -1,86 +0,0 @@ -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="CuratedObjectsResponseDto") - - -@_attrs_define -class CuratedObjectsResponseDto: - """ - Attributes: - device_asset_id (str): - device_id (str): - id (str): - object_ (str): - resize_path (str): - """ - - device_asset_id: str - device_id: str - id: str - object_: str - resize_path: str - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - device_asset_id = self.device_asset_id - device_id = self.device_id - id = self.id - object_ = self.object_ - resize_path = self.resize_path - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "deviceAssetId": device_asset_id, - "deviceId": device_id, - "id": id, - "object": object_, - "resizePath": resize_path, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - device_asset_id = d.pop("deviceAssetId") - - device_id = d.pop("deviceId") - - id = d.pop("id") - - object_ = d.pop("object") - - resize_path = d.pop("resizePath") - - curated_objects_response_dto = cls( - device_asset_id=device_asset_id, - device_id=device_id, - id=id, - object_=object_, - resize_path=resize_path, - ) - - curated_objects_response_dto.additional_properties = d - return curated_objects_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/download_info_dto.py b/immich_carddav_sync/immich_client/models/download_info_dto.py index 60794fb..3908dde 100644 --- a/immich_carddav_sync/immich_client/models/download_info_dto.py +++ b/immich_carddav_sync/immich_client/models/download_info_dto.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, List, Type, TypeVar, Union, cast +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 @@ -12,26 +13,35 @@ class DownloadInfoDto: """ Attributes: - album_id (Union[Unset, str]): + album_id (Union[Unset, UUID]): archive_size (Union[Unset, int]): - asset_ids (Union[Unset, List[str]]): - user_id (Union[Unset, str]): + asset_ids (Union[Unset, List[UUID]]): + user_id (Union[Unset, UUID]): """ - album_id: Union[Unset, str] = UNSET + album_id: Union[Unset, UUID] = UNSET archive_size: Union[Unset, int] = UNSET - asset_ids: Union[Unset, List[str]] = UNSET - user_id: Union[Unset, str] = UNSET + asset_ids: Union[Unset, List[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]: - album_id = self.album_id + album_id: Union[Unset, str] = UNSET + if not isinstance(self.album_id, Unset): + album_id = str(self.album_id) + archive_size = self.archive_size + asset_ids: Union[Unset, List[str]] = UNSET if not isinstance(self.asset_ids, Unset): - asset_ids = self.asset_ids + 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) - user_id = self.user_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) @@ -50,13 +60,28 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - album_id = d.pop("albumId", UNSET) + _album_id = d.pop("albumId", UNSET) + album_id: Union[Unset, UUID] + if isinstance(_album_id, Unset): + album_id = UNSET + else: + album_id = UUID(_album_id) archive_size = d.pop("archiveSize", UNSET) - asset_ids = cast(List[str], d.pop("assetIds", UNSET)) + 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) - user_id = d.pop("userId", UNSET) + _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) download_info_dto = cls( album_id=album_id, diff --git a/immich_carddav_sync/immich_client/models/download_response_dto.py b/immich_carddav_sync/immich_client/models/download_response_dto.py index 245e469..7be79f3 100644 --- a/immich_carddav_sync/immich_client/models/download_response_dto.py +++ b/immich_carddav_sync/immich_client/models/download_response_dto.py @@ -26,7 +26,6 @@ def to_dict(self) -> Dict[str, Any]: archives = [] for archives_item_data in self.archives: archives_item = archives_item_data.to_dict() - archives.append(archives_item) total_size = self.total_size diff --git a/immich_carddav_sync/immich_client/models/entity_type.py b/immich_carddav_sync/immich_client/models/entity_type.py new file mode 100644 index 0000000..63ff4db --- /dev/null +++ b/immich_carddav_sync/immich_client/models/entity_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class EntityType(str, Enum): + ALBUM = "ALBUM" + ASSET = "ASSET" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/exif_response_dto.py b/immich_carddav_sync/immich_client/models/exif_response_dto.py index b38079b..9f99498 100644 --- a/immich_carddav_sync/immich_client/models/exif_response_dto.py +++ b/immich_carddav_sync/immich_client/models/exif_response_dto.py @@ -1,5 +1,5 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,80 +14,190 @@ class ExifResponseDto: """ Attributes: - city (Union[Unset, None, str]): - country (Union[Unset, None, str]): - date_time_original (Union[Unset, None, datetime.datetime]): - description (Union[Unset, None, str]): - exif_image_height (Union[Unset, None, float]): - exif_image_width (Union[Unset, None, float]): - exposure_time (Union[Unset, None, str]): - f_number (Union[Unset, None, float]): - file_size_in_byte (Union[Unset, None, int]): - focal_length (Union[Unset, None, float]): - iso (Union[Unset, None, float]): - latitude (Union[Unset, None, float]): - lens_model (Union[Unset, None, str]): - longitude (Union[Unset, None, float]): - make (Union[Unset, None, str]): - model (Union[Unset, None, str]): - modify_date (Union[Unset, None, datetime.datetime]): - orientation (Union[Unset, None, str]): - projection_type (Union[Unset, None, str]): - state (Union[Unset, None, str]): - time_zone (Union[Unset, None, str]): + city (Union[None, Unset, str]): + country (Union[None, Unset, str]): + date_time_original (Union[None, Unset, datetime.datetime]): + description (Union[None, Unset, str]): + exif_image_height (Union[None, Unset, float]): + exif_image_width (Union[None, Unset, float]): + exposure_time (Union[None, Unset, str]): + f_number (Union[None, Unset, float]): + file_size_in_byte (Union[None, Unset, int]): + focal_length (Union[None, Unset, float]): + iso (Union[None, Unset, float]): + latitude (Union[None, Unset, float]): + lens_model (Union[None, Unset, str]): + longitude (Union[None, Unset, float]): + make (Union[None, Unset, str]): + model (Union[None, Unset, str]): + modify_date (Union[None, Unset, datetime.datetime]): + orientation (Union[None, Unset, str]): + projection_type (Union[None, Unset, str]): + rating (Union[None, Unset, float]): + state (Union[None, Unset, str]): + time_zone (Union[None, Unset, str]): """ - city: Union[Unset, None, str] = UNSET - country: Union[Unset, None, str] = UNSET - date_time_original: Union[Unset, None, datetime.datetime] = UNSET - description: Union[Unset, None, str] = UNSET - exif_image_height: Union[Unset, None, float] = UNSET - exif_image_width: Union[Unset, None, float] = UNSET - exposure_time: Union[Unset, None, str] = UNSET - f_number: Union[Unset, None, float] = UNSET - file_size_in_byte: Union[Unset, None, int] = UNSET - focal_length: Union[Unset, None, float] = UNSET - iso: Union[Unset, None, float] = UNSET - latitude: Union[Unset, None, float] = UNSET - lens_model: Union[Unset, None, str] = UNSET - longitude: Union[Unset, None, float] = UNSET - make: Union[Unset, None, str] = UNSET - model: Union[Unset, None, str] = UNSET - modify_date: Union[Unset, None, datetime.datetime] = UNSET - orientation: Union[Unset, None, str] = UNSET - projection_type: Union[Unset, None, str] = UNSET - state: Union[Unset, None, str] = UNSET - time_zone: Union[Unset, None, str] = UNSET + city: Union[None, Unset, str] = UNSET + country: Union[None, Unset, str] = UNSET + date_time_original: Union[None, Unset, datetime.datetime] = UNSET + description: Union[None, Unset, str] = UNSET + exif_image_height: Union[None, Unset, float] = UNSET + exif_image_width: Union[None, Unset, float] = UNSET + exposure_time: Union[None, Unset, str] = UNSET + f_number: Union[None, Unset, float] = UNSET + file_size_in_byte: Union[None, Unset, int] = UNSET + focal_length: Union[None, Unset, float] = UNSET + iso: Union[None, Unset, float] = UNSET + latitude: Union[None, Unset, float] = UNSET + lens_model: Union[None, Unset, str] = UNSET + longitude: Union[None, Unset, float] = UNSET + make: Union[None, Unset, str] = UNSET + model: Union[None, Unset, str] = UNSET + modify_date: Union[None, Unset, datetime.datetime] = UNSET + orientation: Union[None, Unset, str] = UNSET + projection_type: Union[None, Unset, str] = UNSET + rating: Union[None, Unset, float] = UNSET + state: Union[None, Unset, str] = UNSET + time_zone: Union[None, Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - city = self.city - country = self.country - date_time_original: Union[Unset, None, str] = UNSET - if not isinstance(self.date_time_original, Unset): - date_time_original = self.date_time_original.isoformat() if self.date_time_original else None - - description = self.description - exif_image_height = self.exif_image_height - exif_image_width = self.exif_image_width - exposure_time = self.exposure_time - f_number = self.f_number - file_size_in_byte = self.file_size_in_byte - focal_length = self.focal_length - iso = self.iso - latitude = self.latitude - lens_model = self.lens_model - longitude = self.longitude - make = self.make - model = self.model - modify_date: Union[Unset, None, str] = UNSET - if not isinstance(self.modify_date, Unset): - modify_date = self.modify_date.isoformat() if self.modify_date else None - - orientation = self.orientation - projection_type = self.projection_type - state = self.state - time_zone = self.time_zone + 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 + + date_time_original: Union[None, Unset, str] + if isinstance(self.date_time_original, Unset): + date_time_original = UNSET + elif isinstance(self.date_time_original, datetime.datetime): + date_time_original = self.date_time_original.isoformat() + else: + date_time_original = self.date_time_original + + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + exif_image_height: Union[None, Unset, float] + if isinstance(self.exif_image_height, Unset): + exif_image_height = UNSET + else: + exif_image_height = self.exif_image_height + + exif_image_width: Union[None, Unset, float] + if isinstance(self.exif_image_width, Unset): + exif_image_width = UNSET + else: + exif_image_width = self.exif_image_width + + exposure_time: Union[None, Unset, str] + if isinstance(self.exposure_time, Unset): + exposure_time = UNSET + else: + exposure_time = self.exposure_time + + f_number: Union[None, Unset, float] + if isinstance(self.f_number, Unset): + f_number = UNSET + else: + f_number = self.f_number + + file_size_in_byte: Union[None, Unset, int] + if isinstance(self.file_size_in_byte, Unset): + file_size_in_byte = UNSET + else: + file_size_in_byte = self.file_size_in_byte + + focal_length: Union[None, Unset, float] + if isinstance(self.focal_length, Unset): + focal_length = UNSET + else: + focal_length = self.focal_length + + iso: Union[None, Unset, float] + if isinstance(self.iso, Unset): + iso = UNSET + else: + iso = self.iso + + latitude: Union[None, Unset, float] + if isinstance(self.latitude, Unset): + latitude = UNSET + else: + latitude = self.latitude + + lens_model: Union[None, Unset, str] + if isinstance(self.lens_model, Unset): + lens_model = UNSET + else: + lens_model = self.lens_model + + longitude: Union[None, Unset, float] + if isinstance(self.longitude, Unset): + longitude = UNSET + else: + longitude = self.longitude + + make: Union[None, Unset, str] + if isinstance(self.make, Unset): + make = UNSET + else: + make = self.make + + model: Union[None, Unset, str] + if isinstance(self.model, Unset): + model = UNSET + else: + model = self.model + + modify_date: Union[None, Unset, str] + if isinstance(self.modify_date, Unset): + modify_date = UNSET + elif isinstance(self.modify_date, datetime.datetime): + modify_date = self.modify_date.isoformat() + else: + modify_date = self.modify_date + + orientation: Union[None, Unset, str] + if isinstance(self.orientation, Unset): + orientation = UNSET + else: + orientation = self.orientation + + projection_type: Union[None, Unset, str] + if isinstance(self.projection_type, Unset): + projection_type = UNSET + else: + projection_type = self.projection_type + + rating: Union[None, Unset, float] + if isinstance(self.rating, Unset): + rating = UNSET + else: + rating = self.rating + + state: Union[None, Unset, str] + if isinstance(self.state, Unset): + state = UNSET + else: + state = self.state + + time_zone: Union[None, Unset, str] + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -130,6 +240,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["orientation"] = orientation if projection_type is not UNSET: field_dict["projectionType"] = projection_type + if rating is not UNSET: + field_dict["rating"] = rating if state is not UNSET: field_dict["state"] = state if time_zone is not UNSET: @@ -140,61 +252,220 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - city = d.pop("city", UNSET) - - country = d.pop("country", UNSET) - - _date_time_original = d.pop("dateTimeOriginal", UNSET) - date_time_original: Union[Unset, None, datetime.datetime] - if _date_time_original is None: - date_time_original = None - elif isinstance(_date_time_original, Unset): - date_time_original = UNSET - else: - date_time_original = isoparse(_date_time_original) - - description = d.pop("description", UNSET) - - exif_image_height = d.pop("exifImageHeight", UNSET) - - exif_image_width = d.pop("exifImageWidth", UNSET) - - exposure_time = d.pop("exposureTime", UNSET) - - f_number = d.pop("fNumber", UNSET) - - file_size_in_byte = d.pop("fileSizeInByte", UNSET) - - focal_length = d.pop("focalLength", UNSET) - - iso = d.pop("iso", UNSET) - - latitude = d.pop("latitude", UNSET) - - lens_model = d.pop("lensModel", UNSET) - - longitude = d.pop("longitude", UNSET) - - make = d.pop("make", UNSET) - - model = d.pop("model", UNSET) - - _modify_date = d.pop("modifyDate", UNSET) - modify_date: Union[Unset, None, datetime.datetime] - if _modify_date is None: - modify_date = None - elif isinstance(_modify_date, Unset): - modify_date = UNSET - else: - modify_date = isoparse(_modify_date) - - orientation = d.pop("orientation", UNSET) - - projection_type = d.pop("projectionType", UNSET) - - state = d.pop("state", UNSET) - time_zone = d.pop("timeZone", 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)) + + def _parse_date_time_original(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + date_time_original_type_0 = isoparse(data) + + return date_time_original_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + date_time_original = _parse_date_time_original(d.pop("dateTimeOriginal", UNSET)) + + def _parse_description(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) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_exif_image_height(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + exif_image_height = _parse_exif_image_height(d.pop("exifImageHeight", UNSET)) + + def _parse_exif_image_width(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + exif_image_width = _parse_exif_image_width(d.pop("exifImageWidth", UNSET)) + + def _parse_exposure_time(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) + + exposure_time = _parse_exposure_time(d.pop("exposureTime", UNSET)) + + def _parse_f_number(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + f_number = _parse_f_number(d.pop("fNumber", UNSET)) + + def _parse_file_size_in_byte(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) + + file_size_in_byte = _parse_file_size_in_byte(d.pop("fileSizeInByte", UNSET)) + + def _parse_focal_length(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + focal_length = _parse_focal_length(d.pop("focalLength", UNSET)) + + def _parse_iso(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + iso = _parse_iso(d.pop("iso", UNSET)) + + def _parse_latitude(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + latitude = _parse_latitude(d.pop("latitude", 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_longitude(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + longitude = _parse_longitude(d.pop("longitude", UNSET)) + + def _parse_make(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) + + make = _parse_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)) + + def _parse_modify_date(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + modify_date_type_0 = isoparse(data) + + return modify_date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + modify_date = _parse_modify_date(d.pop("modifyDate", UNSET)) + + def _parse_orientation(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) + + orientation = _parse_orientation(d.pop("orientation", UNSET)) + + def _parse_projection_type(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) + + projection_type = _parse_projection_type(d.pop("projectionType", UNSET)) + + def _parse_rating(data: object) -> Union[None, Unset, float]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, float], data) + + rating = _parse_rating(d.pop("rating", 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)) + + def _parse_time_zone(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) + + time_zone = _parse_time_zone(d.pop("timeZone", UNSET)) exif_response_dto = cls( city=city, @@ -216,6 +487,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: modify_date=modify_date, orientation=orientation, projection_type=projection_type, + rating=rating, state=state, time_zone=time_zone, ) diff --git a/immich_carddav_sync/immich_client/models/search_asset_dto.py b/immich_carddav_sync/immich_client/models/face_dto.py similarity index 74% rename from immich_carddav_sync/immich_client/models/search_asset_dto.py rename to immich_carddav_sync/immich_client/models/face_dto.py index 8939b5b..990b3d8 100644 --- a/immich_carddav_sync/immich_client/models/search_asset_dto.py +++ b/immich_carddav_sync/immich_client/models/face_dto.py @@ -1,29 +1,30 @@ 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="SearchAssetDto") +T = TypeVar("T", bound="FaceDto") @_attrs_define -class SearchAssetDto: +class FaceDto: """ Attributes: - search_term (str): + id (UUID): """ - search_term: str + id: UUID additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - search_term = self.search_term + id = str(self.id) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "searchTerm": search_term, + "id": id, } ) @@ -32,14 +33,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - search_term = d.pop("searchTerm") + id = UUID(d.pop("id")) - search_asset_dto = cls( - search_term=search_term, + face_dto = cls( + id=id, ) - search_asset_dto.additional_properties = d - return search_asset_dto + face_dto.additional_properties = d + return face_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/file_checksum_dto.py b/immich_carddav_sync/immich_client/models/file_checksum_dto.py new file mode 100644 index 0000000..ea25dd9 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/file_checksum_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="FileChecksumDto") + + +@_attrs_define +class FileChecksumDto: + """ + Attributes: + filenames (List[str]): + """ + + filenames: List[str] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + filenames = self.filenames + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "filenames": filenames, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + filenames = cast(List[str], d.pop("filenames")) + + file_checksum_dto = cls( + filenames=filenames, + ) + + file_checksum_dto.additional_properties = d + return file_checksum_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_file_upload_response_dto.py b/immich_carddav_sync/immich_client/models/file_checksum_response_dto.py similarity index 65% rename from immich_carddav_sync/immich_client/models/asset_file_upload_response_dto.py rename to immich_carddav_sync/immich_client/models/file_checksum_response_dto.py index ee2f0ad..16f59b2 100644 --- a/immich_carddav_sync/immich_client/models/asset_file_upload_response_dto.py +++ b/immich_carddav_sync/immich_client/models/file_checksum_response_dto.py @@ -3,31 +3,32 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AssetFileUploadResponseDto") +T = TypeVar("T", bound="FileChecksumResponseDto") @_attrs_define -class AssetFileUploadResponseDto: +class FileChecksumResponseDto: """ Attributes: - duplicate (bool): - id (str): + checksum (str): + filename (str): """ - duplicate: bool - id: str + checksum: str + filename: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - duplicate = self.duplicate - id = self.id + checksum = self.checksum + + filename = self.filename field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "duplicate": duplicate, - "id": id, + "checksum": checksum, + "filename": filename, } ) @@ -36,17 +37,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - duplicate = d.pop("duplicate") + checksum = d.pop("checksum") - id = d.pop("id") + filename = d.pop("filename") - asset_file_upload_response_dto = cls( - duplicate=duplicate, - id=id, + file_checksum_response_dto = cls( + checksum=checksum, + filename=filename, ) - asset_file_upload_response_dto.additional_properties = d - return asset_file_upload_response_dto + file_checksum_response_dto.additional_properties = d + return file_checksum_response_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/file_report_dto.py b/immich_carddav_sync/immich_client/models/file_report_dto.py new file mode 100644 index 0000000..5fda0e7 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/file_report_dto.py @@ -0,0 +1,80 @@ +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.file_report_item_dto import FileReportItemDto + + +T = TypeVar("T", bound="FileReportDto") + + +@_attrs_define +class FileReportDto: + """ + Attributes: + extras (List[str]): + orphans (List['FileReportItemDto']): + """ + + extras: List[str] + orphans: List["FileReportItemDto"] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + extras = self.extras + + orphans = [] + for orphans_item_data in self.orphans: + orphans_item = orphans_item_data.to_dict() + orphans.append(orphans_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "extras": extras, + "orphans": orphans, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.file_report_item_dto import FileReportItemDto + + d = src_dict.copy() + extras = cast(List[str], d.pop("extras")) + + orphans = [] + _orphans = d.pop("orphans") + for orphans_item_data in _orphans: + orphans_item = FileReportItemDto.from_dict(orphans_item_data) + + orphans.append(orphans_item) + + file_report_dto = cls( + extras=extras, + orphans=orphans, + ) + + file_report_dto.additional_properties = d + return file_report_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/file_report_fix_dto.py b/immich_carddav_sync/immich_client/models/file_report_fix_dto.py new file mode 100644 index 0000000..493b045 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/file_report_fix_dto.py @@ -0,0 +1,72 @@ +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.file_report_item_dto import FileReportItemDto + + +T = TypeVar("T", bound="FileReportFixDto") + + +@_attrs_define +class FileReportFixDto: + """ + Attributes: + items (List['FileReportItemDto']): + """ + + items: List["FileReportItemDto"] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "items": items, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.file_report_item_dto import FileReportItemDto + + d = src_dict.copy() + items = [] + _items = d.pop("items") + for items_item_data in _items: + items_item = FileReportItemDto.from_dict(items_item_data) + + items.append(items_item) + + file_report_fix_dto = cls( + items=items, + ) + + file_report_fix_dto.additional_properties = d + return file_report_fix_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/file_report_item_dto.py b/immich_carddav_sync/immich_client/models/file_report_item_dto.py new file mode 100644 index 0000000..a41aec0 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/file_report_item_dto.py @@ -0,0 +1,96 @@ +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.path_entity_type import PathEntityType +from ..models.path_type import PathType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FileReportItemDto") + + +@_attrs_define +class FileReportItemDto: + """ + Attributes: + entity_id (UUID): + entity_type (PathEntityType): + path_type (PathType): + path_value (str): + checksum (Union[Unset, str]): + """ + + entity_id: UUID + entity_type: PathEntityType + path_type: PathType + path_value: str + checksum: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entity_id = str(self.entity_id) + + entity_type = self.entity_type.value + + path_type = self.path_type.value + + path_value = self.path_value + + checksum = self.checksum + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entityId": entity_id, + "entityType": entity_type, + "pathType": path_type, + "pathValue": path_value, + } + ) + if checksum is not UNSET: + field_dict["checksum"] = checksum + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + entity_id = UUID(d.pop("entityId")) + + entity_type = PathEntityType(d.pop("entityType")) + + path_type = PathType(d.pop("pathType")) + + path_value = d.pop("pathValue") + + checksum = d.pop("checksum", UNSET) + + file_report_item_dto = cls( + entity_id=entity_id, + entity_type=entity_type, + path_type=path_type, + path_value=path_value, + checksum=checksum, + ) + + file_report_item_dto.additional_properties = d + return file_report_item_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/get_partners_direction.py b/immich_carddav_sync/immich_client/models/get_partners_direction.py deleted file mode 100644 index 152d079..0000000 --- a/immich_carddav_sync/immich_client/models/get_partners_direction.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class GetPartnersDirection(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/get_profile_image_response_200.py b/immich_carddav_sync/immich_client/models/get_profile_image_response_200.py deleted file mode 100644 index 4c3f27d..0000000 --- a/immich_carddav_sync/immich_client/models/get_profile_image_response_200.py +++ /dev/null @@ -1,44 +0,0 @@ -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="GetProfileImageResponse200") - - -@_attrs_define -class GetProfileImageResponse200: - """ """ - - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - get_profile_image_response_200 = cls() - - get_profile_image_response_200.additional_properties = d - return get_profile_image_response_200 - - @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/import_asset_dto.py b/immich_carddav_sync/immich_client/models/import_asset_dto.py deleted file mode 100644 index 64e4bcb..0000000 --- a/immich_carddav_sync/immich_client/models/import_asset_dto.py +++ /dev/null @@ -1,139 +0,0 @@ -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="ImportAssetDto") - - -@_attrs_define -class ImportAssetDto: - """ - Attributes: - asset_path (str): - device_asset_id (str): - device_id (str): - file_created_at (datetime.datetime): - file_modified_at (datetime.datetime): - is_favorite (bool): - duration (Union[Unset, str]): - is_archived (Union[Unset, bool]): - is_read_only (Union[Unset, bool]): Default: True. - is_visible (Union[Unset, bool]): - sidecar_path (Union[Unset, str]): - """ - - asset_path: str - device_asset_id: str - device_id: str - file_created_at: datetime.datetime - file_modified_at: datetime.datetime - is_favorite: bool - duration: Union[Unset, str] = UNSET - is_archived: Union[Unset, bool] = UNSET - is_read_only: Union[Unset, bool] = True - is_visible: Union[Unset, bool] = UNSET - sidecar_path: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - asset_path = self.asset_path - 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() - - is_favorite = self.is_favorite - duration = self.duration - is_archived = self.is_archived - is_read_only = self.is_read_only - is_visible = self.is_visible - sidecar_path = self.sidecar_path - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assetPath": asset_path, - "deviceAssetId": device_asset_id, - "deviceId": device_id, - "fileCreatedAt": file_created_at, - "fileModifiedAt": file_modified_at, - "isFavorite": is_favorite, - } - ) - if duration is not UNSET: - field_dict["duration"] = duration - if is_archived is not UNSET: - field_dict["isArchived"] = is_archived - if is_read_only is not UNSET: - field_dict["isReadOnly"] = is_read_only - if is_visible is not UNSET: - field_dict["isVisible"] = is_visible - if sidecar_path is not UNSET: - field_dict["sidecarPath"] = sidecar_path - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - asset_path = d.pop("assetPath") - - 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")) - - is_favorite = d.pop("isFavorite") - - duration = d.pop("duration", UNSET) - - is_archived = d.pop("isArchived", UNSET) - - is_read_only = d.pop("isReadOnly", UNSET) - - is_visible = d.pop("isVisible", UNSET) - - sidecar_path = d.pop("sidecarPath", UNSET) - - import_asset_dto = cls( - asset_path=asset_path, - device_asset_id=device_asset_id, - device_id=device_id, - file_created_at=file_created_at, - file_modified_at=file_modified_at, - is_favorite=is_favorite, - duration=duration, - is_archived=is_archived, - is_read_only=is_read_only, - is_visible=is_visible, - sidecar_path=sidecar_path, - ) - - import_asset_dto.additional_properties = d - return import_asset_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/job_command.py b/immich_carddav_sync/immich_client/models/job_command.py index e537d4c..b510019 100644 --- a/immich_carddav_sync/immich_client/models/job_command.py +++ b/immich_carddav_sync/immich_client/models/job_command.py @@ -2,6 +2,7 @@ class JobCommand(str, Enum): + CLEAR_FAILED = "clear-failed" EMPTY = "empty" PAUSE = "pause" RESUME = "resume" diff --git a/immich_carddav_sync/immich_client/models/job_command_dto.py b/immich_carddav_sync/immich_client/models/job_command_dto.py index d7258e6..a7165c4 100644 --- a/immich_carddav_sync/immich_client/models/job_command_dto.py +++ b/immich_carddav_sync/immich_client/models/job_command_dto.py @@ -1,9 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar +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.job_command import JobCommand +from ..types import UNSET, Unset T = TypeVar("T", bound="JobCommandDto") @@ -13,11 +14,11 @@ class JobCommandDto: """ Attributes: command (JobCommand): - force (bool): + force (Union[Unset, bool]): """ command: JobCommand - force: bool + force: Union[Unset, bool] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -30,9 +31,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "command": command, - "force": force, } ) + if force is not UNSET: + field_dict["force"] = force return field_dict @@ -41,7 +43,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() command = JobCommand(d.pop("command")) - force = d.pop("force") + force = d.pop("force", UNSET) job_command_dto = cls( command=command, diff --git a/immich_carddav_sync/immich_client/models/job_counts_dto.py b/immich_carddav_sync/immich_client/models/job_counts_dto.py index 1464322..791c071 100644 --- a/immich_carddav_sync/immich_client/models/job_counts_dto.py +++ b/immich_carddav_sync/immich_client/models/job_counts_dto.py @@ -28,10 +28,15 @@ class JobCountsDto: def to_dict(self) -> Dict[str, Any]: active = self.active + completed = self.completed + delayed = self.delayed + failed = self.failed + paused = self.paused + waiting = self.waiting field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/job_name.py b/immich_carddav_sync/immich_client/models/job_name.py index fd8ea8e..831fee9 100644 --- a/immich_carddav_sync/immich_client/models/job_name.py +++ b/immich_carddav_sync/immich_client/models/job_name.py @@ -3,12 +3,16 @@ class JobName(str, Enum): BACKGROUNDTASK = "backgroundTask" - CLIPENCODING = "clipEncoding" + DUPLICATEDETECTION = "duplicateDetection" + FACEDETECTION = "faceDetection" + FACIALRECOGNITION = "facialRecognition" + LIBRARY = "library" METADATAEXTRACTION = "metadataExtraction" - OBJECTTAGGING = "objectTagging" - RECOGNIZEFACES = "recognizeFaces" + MIGRATION = "migration" + NOTIFICATIONS = "notifications" SEARCH = "search" SIDECAR = "sidecar" + SMARTSEARCH = "smartSearch" STORAGETEMPLATEMIGRATION = "storageTemplateMigration" THUMBNAILGENERATION = "thumbnailGeneration" VIDEOCONVERSION = "videoConversion" diff --git a/immich_carddav_sync/immich_client/models/library_response_dto.py b/immich_carddav_sync/immich_client/models/library_response_dto.py new file mode 100644 index 0000000..16fc675 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/library_response_dto.py @@ -0,0 +1,141 @@ +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 + +T = TypeVar("T", bound="LibraryResponseDto") + + +@_attrs_define +class LibraryResponseDto: + """ + Attributes: + asset_count (int): + created_at (datetime.datetime): + exclusion_patterns (List[str]): + id (str): + import_paths (List[str]): + name (str): + owner_id (str): + refreshed_at (Union[None, datetime.datetime]): + updated_at (datetime.datetime): + """ + + asset_count: int + created_at: datetime.datetime + exclusion_patterns: List[str] + id: str + import_paths: List[str] + name: str + owner_id: str + refreshed_at: Union[None, datetime.datetime] + updated_at: datetime.datetime + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + asset_count = self.asset_count + + created_at = self.created_at.isoformat() + + exclusion_patterns = self.exclusion_patterns + + id = self.id + + import_paths = self.import_paths + + name = self.name + + owner_id = self.owner_id + + refreshed_at: Union[None, str] + if isinstance(self.refreshed_at, datetime.datetime): + refreshed_at = self.refreshed_at.isoformat() + else: + refreshed_at = self.refreshed_at + + updated_at = self.updated_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assetCount": asset_count, + "createdAt": created_at, + "exclusionPatterns": exclusion_patterns, + "id": id, + "importPaths": import_paths, + "name": name, + "ownerId": owner_id, + "refreshedAt": refreshed_at, + "updatedAt": updated_at, + } + ) + + 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") + + created_at = isoparse(d.pop("createdAt")) + + exclusion_patterns = cast(List[str], d.pop("exclusionPatterns")) + + id = d.pop("id") + + import_paths = cast(List[str], d.pop("importPaths")) + + name = d.pop("name") + + owner_id = d.pop("ownerId") + + def _parse_refreshed_at(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + refreshed_at_type_0 = isoparse(data) + + return refreshed_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + refreshed_at = _parse_refreshed_at(d.pop("refreshedAt")) + + updated_at = isoparse(d.pop("updatedAt")) + + library_response_dto = cls( + asset_count=asset_count, + created_at=created_at, + exclusion_patterns=exclusion_patterns, + id=id, + import_paths=import_paths, + name=name, + owner_id=owner_id, + refreshed_at=refreshed_at, + updated_at=updated_at, + ) + + library_response_dto.additional_properties = d + return 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/library_stats_response_dto.py b/immich_carddav_sync/immich_client/models/library_stats_response_dto.py new file mode 100644 index 0000000..8b72645 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/library_stats_response_dto.py @@ -0,0 +1,82 @@ +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="LibraryStatsResponseDto") + + +@_attrs_define +class LibraryStatsResponseDto: + """ + Attributes: + photos (int): Default: 0. + total (int): Default: 0. + usage (int): Default: 0. + videos (int): Default: 0. + """ + + photos: int = 0 + total: int = 0 + usage: int = 0 + videos: int = 0 + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + photos = self.photos + + total = self.total + + usage = self.usage + + videos = self.videos + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "photos": photos, + "total": total, + "usage": usage, + "videos": videos, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + photos = d.pop("photos") + + total = d.pop("total") + + usage = d.pop("usage") + + videos = d.pop("videos") + + library_stats_response_dto = cls( + photos=photos, + total=total, + usage=usage, + videos=videos, + ) + + library_stats_response_dto.additional_properties = d + return library_stats_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/log_level.py b/immich_carddav_sync/immich_client/models/log_level.py new file mode 100644 index 0000000..559340c --- /dev/null +++ b/immich_carddav_sync/immich_client/models/log_level.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class LogLevel(str, Enum): + DEBUG = "debug" + ERROR = "error" + FATAL = "fatal" + LOG = "log" + VERBOSE = "verbose" + WARN = "warn" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/login_credential_dto.py b/immich_carddav_sync/immich_client/models/login_credential_dto.py index e8be36f..546b276 100644 --- a/immich_carddav_sync/immich_client/models/login_credential_dto.py +++ b/immich_carddav_sync/immich_client/models/login_credential_dto.py @@ -20,6 +20,7 @@ class LoginCredentialDto: def to_dict(self) -> Dict[str, Any]: email = self.email + password = self.password field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/login_response_dto.py b/immich_carddav_sync/immich_client/models/login_response_dto.py index ad85a73..61c0964 100644 --- a/immich_carddav_sync/immich_client/models/login_response_dto.py +++ b/immich_carddav_sync/immich_client/models/login_response_dto.py @@ -11,9 +11,8 @@ class LoginResponseDto: """ Attributes: access_token (str): - first_name (str): is_admin (bool): - last_name (str): + name (str): profile_image_path (str): should_change_password (bool): user_email (str): @@ -21,9 +20,8 @@ class LoginResponseDto: """ access_token: str - first_name: str is_admin: bool - last_name: str + name: str profile_image_path: str should_change_password: bool user_email: str @@ -32,12 +30,17 @@ class LoginResponseDto: def to_dict(self) -> Dict[str, Any]: access_token = self.access_token - first_name = self.first_name + is_admin = self.is_admin - last_name = self.last_name + + name = self.name + profile_image_path = self.profile_image_path + should_change_password = self.should_change_password + user_email = self.user_email + user_id = self.user_id field_dict: Dict[str, Any] = {} @@ -45,9 +48,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "accessToken": access_token, - "firstName": first_name, "isAdmin": is_admin, - "lastName": last_name, + "name": name, "profileImagePath": profile_image_path, "shouldChangePassword": should_change_password, "userEmail": user_email, @@ -62,11 +64,9 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() access_token = d.pop("accessToken") - first_name = d.pop("firstName") - is_admin = d.pop("isAdmin") - last_name = d.pop("lastName") + name = d.pop("name") profile_image_path = d.pop("profileImagePath") @@ -78,9 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: login_response_dto = cls( access_token=access_token, - first_name=first_name, is_admin=is_admin, - last_name=last_name, + name=name, profile_image_path=profile_image_path, should_change_password=should_change_password, user_email=user_email, diff --git a/immich_carddav_sync/immich_client/models/logout_response_dto.py b/immich_carddav_sync/immich_client/models/logout_response_dto.py index b766266..d56287a 100644 --- a/immich_carddav_sync/immich_client/models/logout_response_dto.py +++ b/immich_carddav_sync/immich_client/models/logout_response_dto.py @@ -20,6 +20,7 @@ class LogoutResponseDto: def to_dict(self) -> Dict[str, Any]: redirect_uri = self.redirect_uri + successful = self.successful field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/map_marker_response_dto.py b/immich_carddav_sync/immich_client/models/map_marker_response_dto.py index c2b2253..83073bd 100644 --- a/immich_carddav_sync/immich_client/models/map_marker_response_dto.py +++ b/immich_carddav_sync/immich_client/models/map_marker_response_dto.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -10,28 +10,48 @@ class MapMarkerResponseDto: """ Attributes: + city (Union[None, str]): + country (Union[None, str]): id (str): lat (float): lon (float): + state (Union[None, str]): """ + city: Union[None, str] + country: Union[None, str] id: str lat: float lon: float + 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 + id = self.id + lat = self.lat + lon = self.lon + 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, "id": id, "lat": lat, "lon": lon, + "state": state, } ) @@ -40,16 +60,41 @@ def to_dict(self) -> Dict[str, Any]: @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")) + id = d.pop("id") lat = d.pop("lat") lon = d.pop("lon") + 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_marker_response_dto = cls( + city=city, + country=country, id=id, lat=lat, lon=lon, + state=state, ) map_marker_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/memory_lane_response_dto.py b/immich_carddav_sync/immich_client/models/memory_lane_response_dto.py index 22f28d8..fe3c2ba 100644 --- a/immich_carddav_sync/immich_client/models/memory_lane_response_dto.py +++ b/immich_carddav_sync/immich_client/models/memory_lane_response_dto.py @@ -15,28 +15,27 @@ class MemoryLaneResponseDto: """ Attributes: assets (List['AssetResponseDto']): - title (str): + years_ago (int): """ assets: List["AssetResponseDto"] - title: str + years_ago: int 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) - title = self.title + years_ago = self.years_ago field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "assets": assets, - "title": title, + "yearsAgo": years_ago, } ) @@ -54,11 +53,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: assets.append(assets_item) - title = d.pop("title") + years_ago = d.pop("yearsAgo") memory_lane_response_dto = cls( assets=assets, - title=title, + years_ago=years_ago, ) memory_lane_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/merge_person_dto.py b/immich_carddav_sync/immich_client/models/merge_person_dto.py index 68dcb38..98e3c3d 100644 --- a/immich_carddav_sync/immich_client/models/merge_person_dto.py +++ b/immich_carddav_sync/immich_client/models/merge_person_dto.py @@ -1,4 +1,5 @@ -from typing import Any, Dict, List, Type, TypeVar, cast +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 @@ -10,14 +11,17 @@ class MergePersonDto: """ Attributes: - ids (List[str]): + ids (List[UUID]): """ - ids: List[str] + ids: List[UUID] additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - ids = self.ids + ids = [] + for ids_item_data in self.ids: + ids_item = str(ids_item_data) + ids.append(ids_item) field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -32,7 +36,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - ids = cast(List[str], d.pop("ids")) + ids = [] + _ids = d.pop("ids") + for ids_item_data in _ids: + ids_item = UUID(ids_item_data) + + ids.append(ids_item) merge_person_dto = cls( ids=ids, diff --git a/immich_carddav_sync/immich_client/models/user_count_response_dto.py b/immich_carddav_sync/immich_client/models/o_auth_authorize_response_dto.py similarity index 73% rename from immich_carddav_sync/immich_client/models/user_count_response_dto.py rename to immich_carddav_sync/immich_client/models/o_auth_authorize_response_dto.py index 9348565..74d45c5 100644 --- a/immich_carddav_sync/immich_client/models/user_count_response_dto.py +++ b/immich_carddav_sync/immich_client/models/o_auth_authorize_response_dto.py @@ -3,27 +3,27 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="UserCountResponseDto") +T = TypeVar("T", bound="OAuthAuthorizeResponseDto") @_attrs_define -class UserCountResponseDto: +class OAuthAuthorizeResponseDto: """ Attributes: - user_count (int): + url (str): """ - user_count: int + url: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - user_count = self.user_count + url = self.url field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "userCount": user_count, + "url": url, } ) @@ -32,14 +32,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - user_count = d.pop("userCount") + url = d.pop("url") - user_count_response_dto = cls( - user_count=user_count, + o_auth_authorize_response_dto = cls( + url=url, ) - user_count_response_dto.additional_properties = d - return user_count_response_dto + o_auth_authorize_response_dto.additional_properties = d + return o_auth_authorize_response_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/o_auth_config_response_dto.py b/immich_carddav_sync/immich_client/models/o_auth_config_response_dto.py deleted file mode 100644 index dc67271..0000000 --- a/immich_carddav_sync/immich_client/models/o_auth_config_response_dto.py +++ /dev/null @@ -1,91 +0,0 @@ -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="OAuthConfigResponseDto") - - -@_attrs_define -class OAuthConfigResponseDto: - """ - Attributes: - enabled (bool): - password_login_enabled (bool): - auto_launch (Union[Unset, bool]): - button_text (Union[Unset, str]): - url (Union[Unset, str]): - """ - - enabled: bool - password_login_enabled: bool - auto_launch: Union[Unset, bool] = UNSET - button_text: Union[Unset, str] = UNSET - url: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - enabled = self.enabled - password_login_enabled = self.password_login_enabled - auto_launch = self.auto_launch - button_text = self.button_text - url = self.url - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "enabled": enabled, - "passwordLoginEnabled": password_login_enabled, - } - ) - if auto_launch is not UNSET: - field_dict["autoLaunch"] = auto_launch - if button_text is not UNSET: - field_dict["buttonText"] = button_text - if url is not UNSET: - field_dict["url"] = url - - return field_dict - - @classmethod - def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - d = src_dict.copy() - enabled = d.pop("enabled") - - password_login_enabled = d.pop("passwordLoginEnabled") - - auto_launch = d.pop("autoLaunch", UNSET) - - button_text = d.pop("buttonText", UNSET) - - url = d.pop("url", UNSET) - - o_auth_config_response_dto = cls( - enabled=enabled, - password_login_enabled=password_login_enabled, - auto_launch=auto_launch, - button_text=button_text, - url=url, - ) - - o_auth_config_response_dto.additional_properties = d - return o_auth_config_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/partner_response_dto.py b/immich_carddav_sync/immich_client/models/partner_response_dto.py new file mode 100644 index 0000000..ad070bb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/partner_response_dto.py @@ -0,0 +1,112 @@ +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 ..models.user_avatar_color import UserAvatarColor +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PartnerResponseDto") + + +@_attrs_define +class PartnerResponseDto: + """ + Attributes: + avatar_color (UserAvatarColor): + email (str): + id (str): + name (str): + profile_changed_at (datetime.datetime): + profile_image_path (str): + in_timeline (Union[Unset, bool]): + """ + + avatar_color: UserAvatarColor + email: str + id: str + name: str + profile_changed_at: datetime.datetime + profile_image_path: str + in_timeline: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + avatar_color = self.avatar_color.value + + email = self.email + + id = self.id + + name = self.name + + profile_changed_at = self.profile_changed_at.isoformat() + + profile_image_path = self.profile_image_path + + in_timeline = self.in_timeline + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "avatarColor": avatar_color, + "email": email, + "id": id, + "name": name, + "profileChangedAt": profile_changed_at, + "profileImagePath": profile_image_path, + } + ) + if in_timeline is not UNSET: + field_dict["inTimeline"] = in_timeline + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + avatar_color = UserAvatarColor(d.pop("avatarColor")) + + email = d.pop("email") + + id = d.pop("id") + + name = d.pop("name") + + profile_changed_at = isoparse(d.pop("profileChangedAt")) + + profile_image_path = d.pop("profileImagePath") + + in_timeline = d.pop("inTimeline", UNSET) + + partner_response_dto = cls( + avatar_color=avatar_color, + email=email, + id=id, + name=name, + profile_changed_at=profile_changed_at, + profile_image_path=profile_image_path, + in_timeline=in_timeline, + ) + + partner_response_dto.additional_properties = d + return partner_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/path_entity_type.py b/immich_carddav_sync/immich_client/models/path_entity_type.py new file mode 100644 index 0000000..2d8a96d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/path_entity_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class PathEntityType(str, Enum): + ASSET = "asset" + PERSON = "person" + USER = "user" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/path_type.py b/immich_carddav_sync/immich_client/models/path_type.py new file mode 100644 index 0000000..96da89f --- /dev/null +++ b/immich_carddav_sync/immich_client/models/path_type.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class PathType(str, Enum): + ENCODED_VIDEO = "encoded_video" + FACE = "face" + ORIGINAL = "original" + PREVIEW = "preview" + PROFILE = "profile" + SIDECAR = "sidecar" + THUMBNAIL = "thumbnail" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/people_response_dto.py b/immich_carddav_sync/immich_client/models/people_response_dto.py index c79eec4..dfe9e7c 100644 --- a/immich_carddav_sync/immich_client/models/people_response_dto.py +++ b/immich_carddav_sync/immich_client/models/people_response_dto.py @@ -1,8 +1,10 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar +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.person_response_dto import PersonResponseDto @@ -14,35 +16,41 @@ class PeopleResponseDto: """ Attributes: + hidden (int): people (List['PersonResponseDto']): total (int): - visible (int): + has_next_page (Union[Unset, bool]): This property was added in v1.110.0 """ + hidden: int people: List["PersonResponseDto"] total: int - visible: int + has_next_page: Union[Unset, bool] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + hidden = self.hidden + people = [] for people_item_data in self.people: people_item = people_item_data.to_dict() - people.append(people_item) total = self.total - visible = self.visible + + has_next_page = self.has_next_page field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "hidden": hidden, "people": people, "total": total, - "visible": visible, } ) + if has_next_page is not UNSET: + field_dict["hasNextPage"] = has_next_page return field_dict @@ -51,6 +59,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.person_response_dto import PersonResponseDto d = src_dict.copy() + hidden = d.pop("hidden") + people = [] _people = d.pop("people") for people_item_data in _people: @@ -60,12 +70,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: total = d.pop("total") - visible = d.pop("visible") + has_next_page = d.pop("hasNextPage", UNSET) people_response_dto = cls( + hidden=hidden, people=people, total=total, - visible=visible, + has_next_page=has_next_page, ) people_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/people_update_dto.py b/immich_carddav_sync/immich_client/models/people_update_dto.py index a57d35e..ecaa924 100644 --- a/immich_carddav_sync/immich_client/models/people_update_dto.py +++ b/immich_carddav_sync/immich_client/models/people_update_dto.py @@ -24,7 +24,6 @@ def to_dict(self) -> Dict[str, Any]: people = [] for people_item_data in self.people: people_item = people_item_data.to_dict() - people.append(people_item) field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/people_update_item.py b/immich_carddav_sync/immich_client/models/people_update_item.py index 7c04af0..24cf954 100644 --- a/immich_carddav_sync/immich_client/models/people_update_item.py +++ b/immich_carddav_sync/immich_client/models/people_update_item.py @@ -1,5 +1,5 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -15,14 +15,15 @@ class PeopleUpdateItem: """ Attributes: id (str): Person id. - birth_date (Union[Unset, None, datetime.date]): Person date of birth. + birth_date (Union[None, Unset, datetime.date]): Person date of birth. + Note: the mobile app cannot currently set the birth date to null. feature_face_asset_id (Union[Unset, str]): Asset is used to get the feature face thumbnail. is_hidden (Union[Unset, bool]): Person visibility name (Union[Unset, str]): Person name. """ id: str - birth_date: Union[Unset, None, datetime.date] = UNSET + birth_date: Union[None, Unset, datetime.date] = UNSET feature_face_asset_id: Union[Unset, str] = UNSET is_hidden: Union[Unset, bool] = UNSET name: Union[Unset, str] = UNSET @@ -30,12 +31,19 @@ class PeopleUpdateItem: def to_dict(self) -> Dict[str, Any]: id = self.id - birth_date: Union[Unset, None, str] = UNSET - if not isinstance(self.birth_date, Unset): - birth_date = self.birth_date.isoformat() if self.birth_date else None + + 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 feature_face_asset_id = self.feature_face_asset_id + is_hidden = self.is_hidden + name = self.name field_dict: Dict[str, Any] = {} @@ -61,14 +69,22 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() id = d.pop("id") - _birth_date = d.pop("birthDate", UNSET) - birth_date: Union[Unset, None, datetime.date] - if _birth_date is None: - birth_date = None - elif isinstance(_birth_date, Unset): - birth_date = UNSET - else: - birth_date = isoparse(_birth_date).date() + 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)) feature_face_asset_id = d.pop("featureFaceAssetId", UNSET) diff --git a/immich_carddav_sync/immich_client/models/person_response_dto.py b/immich_carddav_sync/immich_client/models/person_response_dto.py index 28af929..5e8ce86 100644 --- a/immich_carddav_sync/immich_client/models/person_response_dto.py +++ b/immich_carddav_sync/immich_client/models/person_response_dto.py @@ -1,10 +1,12 @@ import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar +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="PersonResponseDto") @@ -12,44 +14,76 @@ class PersonResponseDto: """ Attributes: + birth_date (Union[None, datetime.date]): id (str): is_hidden (bool): name (str): thumbnail_path (str): - birth_date (Optional[datetime.date]): + updated_at (Union[Unset, datetime.datetime]): This property was added in v1.107.0 """ + birth_date: Union[None, datetime.date] id: str is_hidden: bool name: str thumbnail_path: str - birth_date: Optional[datetime.date] + updated_at: Union[Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + birth_date: Union[None, str] + if isinstance(self.birth_date, datetime.date): + birth_date = self.birth_date.isoformat() + else: + birth_date = self.birth_date + id = self.id + is_hidden = self.is_hidden + name = self.name + thumbnail_path = self.thumbnail_path - birth_date = self.birth_date.isoformat() if self.birth_date else None + + updated_at: Union[Unset, str] = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "birthDate": birth_date, "id": id, "isHidden": is_hidden, "name": name, "thumbnailPath": thumbnail_path, - "birthDate": birth_date, } ) + if updated_at is not UNSET: + field_dict["updatedAt"] = updated_at 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, datetime.date]: + if data is None: + 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, datetime.date], data) + + birth_date = _parse_birth_date(d.pop("birthDate")) + id = d.pop("id") is_hidden = d.pop("isHidden") @@ -58,19 +92,20 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: thumbnail_path = d.pop("thumbnailPath") - _birth_date = d.pop("birthDate") - birth_date: Optional[datetime.date] - if _birth_date is None: - birth_date = None + _updated_at = d.pop("updatedAt", UNSET) + updated_at: Union[Unset, datetime.datetime] + if isinstance(_updated_at, Unset): + updated_at = UNSET else: - birth_date = isoparse(_birth_date).date() + updated_at = isoparse(_updated_at) person_response_dto = cls( + birth_date=birth_date, id=id, is_hidden=is_hidden, name=name, thumbnail_path=thumbnail_path, - birth_date=birth_date, + updated_at=updated_at, ) person_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/person_statistics_response_dto.py b/immich_carddav_sync/immich_client/models/person_statistics_response_dto.py new file mode 100644 index 0000000..476d15b --- /dev/null +++ b/immich_carddav_sync/immich_client/models/person_statistics_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="PersonStatisticsResponseDto") + + +@_attrs_define +class PersonStatisticsResponseDto: + """ + Attributes: + assets (int): + """ + + assets: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + assets = self.assets + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "assets": assets, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + assets = d.pop("assets") + + person_statistics_response_dto = cls( + assets=assets, + ) + + person_statistics_response_dto.additional_properties = d + return person_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/person_update_dto.py b/immich_carddav_sync/immich_client/models/person_update_dto.py index d27e0b9..d79a609 100644 --- a/immich_carddav_sync/immich_client/models/person_update_dto.py +++ b/immich_carddav_sync/immich_client/models/person_update_dto.py @@ -1,5 +1,5 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -14,25 +14,32 @@ class PersonUpdateDto: """ Attributes: - birth_date (Union[Unset, None, datetime.date]): Person date of birth. + birth_date (Union[None, Unset, datetime.date]): Person date of birth. + Note: the mobile app cannot currently set the birth date to null. feature_face_asset_id (Union[Unset, str]): Asset is used to get the feature face thumbnail. is_hidden (Union[Unset, bool]): Person visibility name (Union[Unset, str]): Person name. """ - birth_date: Union[Unset, None, datetime.date] = UNSET + birth_date: Union[None, Unset, datetime.date] = UNSET feature_face_asset_id: Union[Unset, str] = 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[Unset, None, str] = UNSET - if not isinstance(self.birth_date, Unset): - birth_date = self.birth_date.isoformat() if self.birth_date else None + 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 feature_face_asset_id = self.feature_face_asset_id + is_hidden = self.is_hidden + name = self.name field_dict: Dict[str, Any] = {} @@ -52,14 +59,23 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - _birth_date = d.pop("birthDate", UNSET) - birth_date: Union[Unset, None, datetime.date] - if _birth_date is None: - birth_date = None - elif isinstance(_birth_date, Unset): - birth_date = UNSET - else: - birth_date = isoparse(_birth_date).date() + + 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)) feature_face_asset_id = d.pop("featureFaceAssetId", UNSET) diff --git a/immich_carddav_sync/immich_client/models/person_with_faces_response_dto.py b/immich_carddav_sync/immich_client/models/person_with_faces_response_dto.py new file mode 100644 index 0000000..845e6e2 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/person_with_faces_response_dto.py @@ -0,0 +1,150 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.asset_face_without_person_response_dto import AssetFaceWithoutPersonResponseDto + + +T = TypeVar("T", bound="PersonWithFacesResponseDto") + + +@_attrs_define +class PersonWithFacesResponseDto: + """ + Attributes: + birth_date (Union[None, datetime.date]): + faces (List['AssetFaceWithoutPersonResponseDto']): + id (str): + is_hidden (bool): + name (str): + thumbnail_path (str): + updated_at (Union[Unset, datetime.datetime]): This property was added in v1.107.0 + """ + + birth_date: Union[None, datetime.date] + faces: List["AssetFaceWithoutPersonResponseDto"] + id: str + is_hidden: bool + name: str + thumbnail_path: str + updated_at: Union[Unset, datetime.datetime] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + birth_date: Union[None, str] + if isinstance(self.birth_date, datetime.date): + birth_date = self.birth_date.isoformat() + else: + birth_date = self.birth_date + + faces = [] + for faces_item_data in self.faces: + faces_item = faces_item_data.to_dict() + faces.append(faces_item) + + id = self.id + + is_hidden = self.is_hidden + + name = self.name + + thumbnail_path = self.thumbnail_path + + updated_at: Union[Unset, str] = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "birthDate": birth_date, + "faces": faces, + "id": id, + "isHidden": is_hidden, + "name": name, + "thumbnailPath": thumbnail_path, + } + ) + if updated_at is not UNSET: + field_dict["updatedAt"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.asset_face_without_person_response_dto import AssetFaceWithoutPersonResponseDto + + d = src_dict.copy() + + def _parse_birth_date(data: object) -> Union[None, datetime.date]: + if data is None: + 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, datetime.date], data) + + birth_date = _parse_birth_date(d.pop("birthDate")) + + faces = [] + _faces = d.pop("faces") + for faces_item_data in _faces: + faces_item = AssetFaceWithoutPersonResponseDto.from_dict(faces_item_data) + + faces.append(faces_item) + + id = d.pop("id") + + is_hidden = d.pop("isHidden") + + name = d.pop("name") + + thumbnail_path = d.pop("thumbnailPath") + + _updated_at = d.pop("updatedAt", UNSET) + updated_at: Union[Unset, datetime.datetime] + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = isoparse(_updated_at) + + person_with_faces_response_dto = cls( + birth_date=birth_date, + faces=faces, + id=id, + is_hidden=is_hidden, + name=name, + thumbnail_path=thumbnail_path, + updated_at=updated_at, + ) + + person_with_faces_response_dto.additional_properties = d + return person_with_faces_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/queue_status_dto.py b/immich_carddav_sync/immich_client/models/queue_status_dto.py index 6f9f588..3e2d011 100644 --- a/immich_carddav_sync/immich_client/models/queue_status_dto.py +++ b/immich_carddav_sync/immich_client/models/queue_status_dto.py @@ -20,6 +20,7 @@ class QueueStatusDto: def to_dict(self) -> Dict[str, Any]: is_active = self.is_active + is_paused = self.is_paused field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/reaction_level.py b/immich_carddav_sync/immich_client/models/reaction_level.py new file mode 100644 index 0000000..34db8e8 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/reaction_level.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ReactionLevel(str, Enum): + ALBUM = "album" + ASSET = "asset" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/reaction_type.py b/immich_carddav_sync/immich_client/models/reaction_type.py new file mode 100644 index 0000000..19fa014 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/reaction_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ReactionType(str, Enum): + COMMENT = "comment" + LIKE = "like" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/search_album_response_dto.py b/immich_carddav_sync/immich_client/models/search_album_response_dto.py index c4bca50..ba88341 100644 --- a/immich_carddav_sync/immich_client/models/search_album_response_dto.py +++ b/immich_carddav_sync/immich_client/models/search_album_response_dto.py @@ -29,16 +29,15 @@ class SearchAlbumResponseDto: def to_dict(self) -> Dict[str, Any]: count = self.count + facets = [] for facets_item_data in self.facets: facets_item = facets_item_data.to_dict() - facets.append(facets_item) items = [] for items_item_data in self.items: items_item = items_item_data.to_dict() - items.append(items_item) total = self.total diff --git a/immich_carddav_sync/immich_client/models/search_asset_response_dto.py b/immich_carddav_sync/immich_client/models/search_asset_response_dto.py index 9687f50..f64c156 100644 --- a/immich_carddav_sync/immich_client/models/search_asset_response_dto.py +++ b/immich_carddav_sync/immich_client/models/search_asset_response_dto.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar +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 @@ -18,29 +18,33 @@ class SearchAssetResponseDto: count (int): facets (List['SearchFacetResponseDto']): items (List['AssetResponseDto']): + next_page (Union[None, str]): total (int): """ count: int facets: List["SearchFacetResponseDto"] items: List["AssetResponseDto"] + next_page: Union[None, str] total: int additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: count = self.count + facets = [] for facets_item_data in self.facets: facets_item = facets_item_data.to_dict() - facets.append(facets_item) items = [] for items_item_data in self.items: items_item = items_item_data.to_dict() - items.append(items_item) + next_page: Union[None, str] + next_page = self.next_page + total = self.total field_dict: Dict[str, Any] = {} @@ -50,6 +54,7 @@ def to_dict(self) -> Dict[str, Any]: "count": count, "facets": facets, "items": items, + "nextPage": next_page, "total": total, } ) @@ -78,12 +83,20 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: items.append(items_item) + def _parse_next_page(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + next_page = _parse_next_page(d.pop("nextPage")) + total = d.pop("total") search_asset_response_dto = cls( count=count, facets=facets, items=items, + next_page=next_page, total=total, ) diff --git a/immich_carddav_sync/immich_client/models/search_explore_response_dto.py b/immich_carddav_sync/immich_client/models/search_explore_response_dto.py index 666a542..026c32f 100644 --- a/immich_carddav_sync/immich_client/models/search_explore_response_dto.py +++ b/immich_carddav_sync/immich_client/models/search_explore_response_dto.py @@ -24,10 +24,10 @@ class SearchExploreResponseDto: def to_dict(self) -> Dict[str, Any]: field_name = self.field_name + items = [] for items_item_data in self.items: items_item = items_item_data.to_dict() - items.append(items_item) field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/search_facet_count_response_dto.py b/immich_carddav_sync/immich_client/models/search_facet_count_response_dto.py index 0d6285e..3e33b68 100644 --- a/immich_carddav_sync/immich_client/models/search_facet_count_response_dto.py +++ b/immich_carddav_sync/immich_client/models/search_facet_count_response_dto.py @@ -20,6 +20,7 @@ class SearchFacetCountResponseDto: def to_dict(self) -> Dict[str, Any]: count = self.count + value = self.value field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/search_facet_response_dto.py b/immich_carddav_sync/immich_client/models/search_facet_response_dto.py index 22c59e8..6985c29 100644 --- a/immich_carddav_sync/immich_client/models/search_facet_response_dto.py +++ b/immich_carddav_sync/immich_client/models/search_facet_response_dto.py @@ -26,7 +26,6 @@ def to_dict(self) -> Dict[str, Any]: counts = [] for counts_item_data in self.counts: counts_item = counts_item_data.to_dict() - counts.append(counts_item) field_name = self.field_name diff --git a/immich_carddav_sync/immich_client/models/search_type.py b/immich_carddav_sync/immich_client/models/search_type.py deleted file mode 100644 index c3e4546..0000000 --- a/immich_carddav_sync/immich_client/models/search_type.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import Enum - - -class SearchType(str, Enum): - AUDIO = "AUDIO" - IMAGE = "IMAGE" - OTHER = "OTHER" - VIDEO = "VIDEO" - - def __str__(self) -> str: - return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/server_config_dto.py b/immich_carddav_sync/immich_client/models/server_config_dto.py new file mode 100644 index 0000000..fa9b7bb --- /dev/null +++ b/immich_carddav_sync/immich_client/models/server_config_dto.py @@ -0,0 +1,122 @@ +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="ServerConfigDto") + + +@_attrs_define +class ServerConfigDto: + """ + Attributes: + external_domain (str): + is_initialized (bool): + is_onboarded (bool): + login_page_message (str): + map_dark_style_url (str): + map_light_style_url (str): + oauth_button_text (str): + trash_days (int): + user_delete_delay (int): + """ + + external_domain: str + is_initialized: bool + is_onboarded: bool + login_page_message: str + map_dark_style_url: str + map_light_style_url: str + oauth_button_text: str + trash_days: int + user_delete_delay: int + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + external_domain = self.external_domain + + is_initialized = self.is_initialized + + is_onboarded = self.is_onboarded + + login_page_message = self.login_page_message + + map_dark_style_url = self.map_dark_style_url + + map_light_style_url = self.map_light_style_url + + oauth_button_text = self.oauth_button_text + + trash_days = self.trash_days + + user_delete_delay = self.user_delete_delay + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "externalDomain": external_domain, + "isInitialized": is_initialized, + "isOnboarded": is_onboarded, + "loginPageMessage": login_page_message, + "mapDarkStyleUrl": map_dark_style_url, + "mapLightStyleUrl": map_light_style_url, + "oauthButtonText": oauth_button_text, + "trashDays": trash_days, + "userDeleteDelay": user_delete_delay, + } + ) + + 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") + + is_initialized = d.pop("isInitialized") + + is_onboarded = d.pop("isOnboarded") + + login_page_message = d.pop("loginPageMessage") + + map_dark_style_url = d.pop("mapDarkStyleUrl") + + map_light_style_url = d.pop("mapLightStyleUrl") + + oauth_button_text = d.pop("oauthButtonText") + + trash_days = d.pop("trashDays") + + user_delete_delay = d.pop("userDeleteDelay") + + server_config_dto = cls( + external_domain=external_domain, + is_initialized=is_initialized, + is_onboarded=is_onboarded, + login_page_message=login_page_message, + map_dark_style_url=map_dark_style_url, + map_light_style_url=map_light_style_url, + oauth_button_text=oauth_button_text, + trash_days=trash_days, + user_delete_delay=user_delete_delay, + ) + + server_config_dto.additional_properties = d + return server_config_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_features_dto.py b/immich_carddav_sync/immich_client/models/server_features_dto.py index 288f294..6a6ec89 100644 --- a/immich_carddav_sync/immich_client/models/server_features_dto.py +++ b/immich_carddav_sync/immich_client/models/server_features_dto.py @@ -10,36 +10,85 @@ class ServerFeaturesDto: """ Attributes: - machine_learning (bool): + config_file (bool): + duplicate_detection (bool): + email (bool): + facial_recognition (bool): + import_faces (bool): + map_ (bool): oauth (bool): oauth_auto_launch (bool): password_login (bool): + reverse_geocoding (bool): search (bool): + sidecar (bool): + smart_search (bool): + trash (bool): """ - machine_learning: bool + config_file: bool + duplicate_detection: bool + email: bool + facial_recognition: bool + import_faces: bool + map_: bool oauth: bool oauth_auto_launch: bool password_login: bool + reverse_geocoding: bool search: bool + sidecar: bool + smart_search: bool + trash: bool additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - machine_learning = self.machine_learning + config_file = self.config_file + + duplicate_detection = self.duplicate_detection + + email = self.email + + facial_recognition = self.facial_recognition + + import_faces = self.import_faces + + map_ = self.map_ + oauth = self.oauth + oauth_auto_launch = self.oauth_auto_launch + password_login = self.password_login + + reverse_geocoding = self.reverse_geocoding + search = self.search + sidecar = self.sidecar + + smart_search = self.smart_search + + trash = self.trash + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "machineLearning": machine_learning, + "configFile": config_file, + "duplicateDetection": duplicate_detection, + "email": email, + "facialRecognition": facial_recognition, + "importFaces": import_faces, + "map": map_, "oauth": oauth, "oauthAutoLaunch": oauth_auto_launch, "passwordLogin": password_login, + "reverseGeocoding": reverse_geocoding, "search": search, + "sidecar": sidecar, + "smartSearch": smart_search, + "trash": trash, } ) @@ -48,7 +97,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - machine_learning = d.pop("machineLearning") + config_file = d.pop("configFile") + + duplicate_detection = d.pop("duplicateDetection") + + email = d.pop("email") + + facial_recognition = d.pop("facialRecognition") + + import_faces = d.pop("importFaces") + + map_ = d.pop("map") oauth = d.pop("oauth") @@ -56,14 +115,31 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: password_login = d.pop("passwordLogin") + reverse_geocoding = d.pop("reverseGeocoding") + search = d.pop("search") + sidecar = d.pop("sidecar") + + smart_search = d.pop("smartSearch") + + trash = d.pop("trash") + server_features_dto = cls( - machine_learning=machine_learning, + config_file=config_file, + duplicate_detection=duplicate_detection, + email=email, + facial_recognition=facial_recognition, + import_faces=import_faces, + map_=map_, oauth=oauth, oauth_auto_launch=oauth_auto_launch, password_login=password_login, + reverse_geocoding=reverse_geocoding, search=search, + sidecar=sidecar, + smart_search=smart_search, + trash=trash, ) server_features_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/server_info_response_dto.py b/immich_carddav_sync/immich_client/models/server_info_response_dto.py deleted file mode 100644 index 21dc859..0000000 --- a/immich_carddav_sync/immich_client/models/server_info_response_dto.py +++ /dev/null @@ -1,100 +0,0 @@ -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="ServerInfoResponseDto") - - -@_attrs_define -class ServerInfoResponseDto: - """ - 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_info_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_info_response_dto.additional_properties = d - return server_info_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_stats_response_dto.py b/immich_carddav_sync/immich_client/models/server_stats_response_dto.py index 61bd401..a1d7a60 100644 --- a/immich_carddav_sync/immich_client/models/server_stats_response_dto.py +++ b/immich_carddav_sync/immich_client/models/server_stats_response_dto.py @@ -14,10 +14,10 @@ class ServerStatsResponseDto: """ Attributes: - photos (int): - usage (int): + photos (int): Default: 0. + usage (int): Default: 0. usage_by_user (List['UsageByUserDto']): Example: [{'photos': 1, 'videos': 1, 'diskUsageRaw': 1}]. - videos (int): + videos (int): Default: 0. """ usage_by_user: List["UsageByUserDto"] @@ -28,11 +28,12 @@ class ServerStatsResponseDto: def to_dict(self) -> Dict[str, Any]: photos = self.photos + usage = self.usage + usage_by_user = [] for usage_by_user_item_data in self.usage_by_user: usage_by_user_item = usage_by_user_item_data.to_dict() - usage_by_user.append(usage_by_user_item) videos = self.videos diff --git a/immich_carddav_sync/immich_client/models/server_theme_dto.py b/immich_carddav_sync/immich_client/models/server_theme_dto.py new file mode 100644 index 0000000..34946d6 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/server_theme_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="ServerThemeDto") + + +@_attrs_define +class ServerThemeDto: + """ + Attributes: + custom_css (str): + """ + + custom_css: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + custom_css = self.custom_css + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "customCss": custom_css, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + custom_css = d.pop("customCss") + + server_theme_dto = cls( + custom_css=custom_css, + ) + + server_theme_dto.additional_properties = d + return server_theme_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_response_dto.py b/immich_carddav_sync/immich_client/models/server_version_response_dto.py index 0bbd807..b961740 100644 --- a/immich_carddav_sync/immich_client/models/server_version_response_dto.py +++ b/immich_carddav_sync/immich_client/models/server_version_response_dto.py @@ -22,7 +22,9 @@ class ServerVersionResponseDto: def to_dict(self) -> Dict[str, Any]: major = self.major + minor = self.minor + patch = self.patch field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/shared_link_create_dto.py b/immich_carddav_sync/immich_client/models/shared_link_create_dto.py index 79cbb20..6d10ce9 100644 --- a/immich_carddav_sync/immich_client/models/shared_link_create_dto.py +++ b/immich_carddav_sync/immich_client/models/shared_link_create_dto.py @@ -1,5 +1,6 @@ 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 @@ -16,41 +17,58 @@ class SharedLinkCreateDto: """ Attributes: type (SharedLinkType): - album_id (Union[Unset, str]): + album_id (Union[Unset, UUID]): allow_download (Union[Unset, bool]): Default: True. allow_upload (Union[Unset, bool]): - asset_ids (Union[Unset, List[str]]): + asset_ids (Union[Unset, List[UUID]]): description (Union[Unset, str]): - expires_at (Union[Unset, None, datetime.datetime]): - show_exif (Union[Unset, bool]): Default: True. + expires_at (Union[None, Unset, datetime.datetime]): + password (Union[Unset, str]): + show_metadata (Union[Unset, bool]): Default: True. """ type: SharedLinkType - album_id: Union[Unset, str] = UNSET + album_id: Union[Unset, UUID] = UNSET allow_download: Union[Unset, bool] = True - allow_upload: Union[Unset, bool] = False - asset_ids: Union[Unset, List[str]] = UNSET + allow_upload: Union[Unset, bool] = UNSET + asset_ids: Union[Unset, List[UUID]] = UNSET description: Union[Unset, str] = UNSET - expires_at: Union[Unset, None, datetime.datetime] = UNSET - show_exif: Union[Unset, bool] = True + expires_at: Union[None, Unset, datetime.datetime] = UNSET + password: Union[Unset, str] = UNSET + show_metadata: Union[Unset, bool] = True additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: type = self.type.value - album_id = self.album_id + album_id: Union[Unset, str] = UNSET + if not isinstance(self.album_id, Unset): + album_id = str(self.album_id) + allow_download = self.allow_download + allow_upload = self.allow_upload + asset_ids: Union[Unset, List[str]] = UNSET if not isinstance(self.asset_ids, Unset): - asset_ids = self.asset_ids + 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) description = self.description - expires_at: Union[Unset, None, str] = UNSET - if not isinstance(self.expires_at, Unset): - expires_at = self.expires_at.isoformat() if self.expires_at else None - show_exif = self.show_exif + expires_at: Union[None, Unset, str] + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + password = self.password + + show_metadata = self.show_metadata field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -71,8 +89,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict["description"] = description if expires_at is not UNSET: field_dict["expiresAt"] = expires_at - if show_exif is not UNSET: - field_dict["showExif"] = show_exif + if password is not UNSET: + field_dict["password"] = password + if show_metadata is not UNSET: + field_dict["showMetadata"] = show_metadata return field_dict @@ -81,26 +101,46 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() type = SharedLinkType(d.pop("type")) - album_id = d.pop("albumId", UNSET) + _album_id = d.pop("albumId", UNSET) + album_id: Union[Unset, UUID] + if isinstance(_album_id, Unset): + album_id = UNSET + else: + album_id = UUID(_album_id) allow_download = d.pop("allowDownload", UNSET) allow_upload = d.pop("allowUpload", UNSET) - asset_ids = cast(List[str], d.pop("assetIds", UNSET)) + 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) description = d.pop("description", UNSET) - _expires_at = d.pop("expiresAt", UNSET) - expires_at: Union[Unset, None, datetime.datetime] - if _expires_at is None: - expires_at = None - elif isinstance(_expires_at, Unset): - expires_at = UNSET - else: - expires_at = isoparse(_expires_at) + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + expires_at = _parse_expires_at(d.pop("expiresAt", UNSET)) + + password = d.pop("password", UNSET) - show_exif = d.pop("showExif", UNSET) + show_metadata = d.pop("showMetadata", UNSET) shared_link_create_dto = cls( type=type, @@ -110,7 +150,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: asset_ids=asset_ids, description=description, expires_at=expires_at, - show_exif=show_exif, + password=password, + show_metadata=show_metadata, ) shared_link_create_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/shared_link_edit_dto.py b/immich_carddav_sync/immich_client/models/shared_link_edit_dto.py index 4fc5e05..8653b2e 100644 --- a/immich_carddav_sync/immich_client/models/shared_link_edit_dto.py +++ b/immich_carddav_sync/immich_client/models/shared_link_edit_dto.py @@ -1,5 +1,5 @@ import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -16,27 +16,44 @@ class SharedLinkEditDto: Attributes: allow_download (Union[Unset, bool]): allow_upload (Union[Unset, bool]): + change_expiry_time (Union[Unset, bool]): Few clients cannot send null to set the expiryTime to never. + Setting this flag and not sending expiryAt is considered as null instead. + Clients that can send null values can ignore this. description (Union[Unset, str]): - expires_at (Union[Unset, None, datetime.datetime]): - show_exif (Union[Unset, bool]): + expires_at (Union[None, Unset, datetime.datetime]): + password (Union[Unset, str]): + show_metadata (Union[Unset, bool]): """ allow_download: Union[Unset, bool] = UNSET allow_upload: Union[Unset, bool] = UNSET + change_expiry_time: Union[Unset, bool] = UNSET description: Union[Unset, str] = UNSET - expires_at: Union[Unset, None, datetime.datetime] = UNSET - show_exif: Union[Unset, bool] = UNSET + expires_at: Union[None, Unset, datetime.datetime] = UNSET + password: Union[Unset, str] = UNSET + show_metadata: Union[Unset, bool] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: allow_download = self.allow_download + allow_upload = self.allow_upload + + change_expiry_time = self.change_expiry_time + description = self.description - expires_at: Union[Unset, None, str] = UNSET - if not isinstance(self.expires_at, Unset): - expires_at = self.expires_at.isoformat() if self.expires_at else None - show_exif = self.show_exif + expires_at: Union[None, Unset, str] + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + password = self.password + + show_metadata = self.show_metadata field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -45,12 +62,16 @@ def to_dict(self) -> Dict[str, Any]: field_dict["allowDownload"] = allow_download if allow_upload is not UNSET: field_dict["allowUpload"] = allow_upload + if change_expiry_time is not UNSET: + field_dict["changeExpiryTime"] = change_expiry_time if description is not UNSET: field_dict["description"] = description if expires_at is not UNSET: field_dict["expiresAt"] = expires_at - if show_exif is not UNSET: - field_dict["showExif"] = show_exif + if password is not UNSET: + field_dict["password"] = password + if show_metadata is not UNSET: + field_dict["showMetadata"] = show_metadata return field_dict @@ -61,25 +82,39 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: allow_upload = d.pop("allowUpload", UNSET) + change_expiry_time = d.pop("changeExpiryTime", UNSET) + description = d.pop("description", UNSET) - _expires_at = d.pop("expiresAt", UNSET) - expires_at: Union[Unset, None, datetime.datetime] - if _expires_at is None: - expires_at = None - elif isinstance(_expires_at, Unset): - expires_at = UNSET - else: - expires_at = isoparse(_expires_at) + def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + expires_at = _parse_expires_at(d.pop("expiresAt", UNSET)) + + password = d.pop("password", UNSET) - show_exif = d.pop("showExif", UNSET) + show_metadata = d.pop("showMetadata", UNSET) shared_link_edit_dto = cls( allow_download=allow_download, allow_upload=allow_upload, + change_expiry_time=change_expiry_time, description=description, expires_at=expires_at, - show_exif=show_exif, + password=password, + show_metadata=show_metadata, ) shared_link_edit_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/shared_link_response_dto.py b/immich_carddav_sync/immich_client/models/shared_link_response_dto.py index b8c4ae5..10a11df 100644 --- a/immich_carddav_sync/immich_client/models/shared_link_response_dto.py +++ b/immich_carddav_sync/immich_client/models/shared_link_response_dto.py @@ -1,5 +1,5 @@ import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, TypeVar, Union +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 @@ -24,53 +24,77 @@ class SharedLinkResponseDto: allow_upload (bool): assets (List['AssetResponseDto']): created_at (datetime.datetime): + description (Union[None, str]): + expires_at (Union[None, datetime.datetime]): id (str): key (str): - show_exif (bool): + password (Union[None, str]): + show_metadata (bool): type (SharedLinkType): user_id (str): album (Union[Unset, AlbumResponseDto]): - description (Optional[str]): - expires_at (Optional[datetime.datetime]): + token (Union[None, Unset, str]): """ allow_download: bool allow_upload: bool assets: List["AssetResponseDto"] created_at: datetime.datetime + description: Union[None, str] + expires_at: Union[None, datetime.datetime] id: str key: str - show_exif: bool + password: Union[None, str] + show_metadata: bool type: SharedLinkType user_id: str - description: Optional[str] - expires_at: Optional[datetime.datetime] album: Union[Unset, "AlbumResponseDto"] = UNSET + token: Union[None, Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: allow_download = self.allow_download + allow_upload = self.allow_upload + 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() + description: Union[None, str] + description = self.description + + expires_at: Union[None, str] + if isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + id = self.id + key = self.key - show_exif = self.show_exif + + password: Union[None, str] + password = self.password + + show_metadata = self.show_metadata + type = self.type.value user_id = self.user_id + album: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.album, Unset): album = self.album.to_dict() - description = self.description - expires_at = self.expires_at.isoformat() if self.expires_at else None + token: Union[None, Unset, str] + if isinstance(self.token, Unset): + token = UNSET + else: + token = self.token field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -80,17 +104,20 @@ def to_dict(self) -> Dict[str, Any]: "allowUpload": allow_upload, "assets": assets, "createdAt": created_at, + "description": description, + "expiresAt": expires_at, "id": id, "key": key, - "showExif": show_exif, + "password": password, + "showMetadata": show_metadata, "type": type, "userId": user_id, - "description": description, - "expiresAt": expires_at, } ) if album is not UNSET: field_dict["album"] = album + if token is not UNSET: + field_dict["token"] = token return field_dict @@ -113,11 +140,40 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_at = isoparse(d.pop("createdAt")) + def _parse_description(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + description = _parse_description(d.pop("description")) + + def _parse_expires_at(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = isoparse(data) + + return expires_at_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + expires_at = _parse_expires_at(d.pop("expiresAt")) + id = d.pop("id") key = d.pop("key") - show_exif = d.pop("showExif") + def _parse_password(data: object) -> Union[None, str]: + if data is None: + return data + return cast(Union[None, str], data) + + password = _parse_password(d.pop("password")) + + show_metadata = d.pop("showMetadata") type = SharedLinkType(d.pop("type")) @@ -130,28 +186,30 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: album = AlbumResponseDto.from_dict(_album) - description = d.pop("description") + def _parse_token(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) - _expires_at = d.pop("expiresAt") - expires_at: Optional[datetime.datetime] - if _expires_at is None: - expires_at = None - else: - expires_at = isoparse(_expires_at) + token = _parse_token(d.pop("token", UNSET)) shared_link_response_dto = cls( allow_download=allow_download, allow_upload=allow_upload, assets=assets, created_at=created_at, + description=description, + expires_at=expires_at, id=id, key=key, - show_exif=show_exif, + password=password, + show_metadata=show_metadata, type=type, user_id=user_id, album=album, - description=description, - expires_at=expires_at, + token=token, ) shared_link_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/sign_up_dto.py b/immich_carddav_sync/immich_client/models/sign_up_dto.py index e686963..3d88176 100644 --- a/immich_carddav_sync/immich_client/models/sign_up_dto.py +++ b/immich_carddav_sync/immich_client/models/sign_up_dto.py @@ -11,21 +11,20 @@ class SignUpDto: """ Attributes: email (str): Example: testuser@email.com. - first_name (str): Example: Admin. - last_name (str): Example: Doe. + name (str): Example: Admin. password (str): Example: password. """ email: str - first_name: str - last_name: str + name: str password: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: email = self.email - first_name = self.first_name - last_name = self.last_name + + name = self.name + password = self.password field_dict: Dict[str, Any] = {} @@ -33,8 +32,7 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "email": email, - "firstName": first_name, - "lastName": last_name, + "name": name, "password": password, } ) @@ -46,16 +44,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() email = d.pop("email") - first_name = d.pop("firstName") - - last_name = d.pop("lastName") + name = d.pop("name") password = d.pop("password") sign_up_dto = cls( email=email, - first_name=first_name, - last_name=last_name, + name=name, password=password, ) diff --git a/immich_carddav_sync/immich_client/models/smart_info_response_dto.py b/immich_carddav_sync/immich_client/models/smart_info_response_dto.py index c660398..92b887e 100644 --- a/immich_carddav_sync/immich_client/models/smart_info_response_dto.py +++ b/immich_carddav_sync/immich_client/models/smart_info_response_dto.py @@ -12,28 +12,32 @@ class SmartInfoResponseDto: """ Attributes: - objects (Union[Unset, None, List[str]]): - tags (Union[Unset, None, List[str]]): + objects (Union[List[str], None, Unset]): + tags (Union[List[str], None, Unset]): """ - objects: Union[Unset, None, List[str]] = UNSET - tags: Union[Unset, None, List[str]] = UNSET + objects: Union[List[str], None, Unset] = UNSET + tags: Union[List[str], None, Unset] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - objects: Union[Unset, None, List[str]] = UNSET - if not isinstance(self.objects, Unset): - if self.objects is None: - objects = None - else: - objects = self.objects - - tags: Union[Unset, None, List[str]] = UNSET - if not isinstance(self.tags, Unset): - if self.tags is None: - tags = None - else: - tags = self.tags + objects: Union[List[str], None, Unset] + if isinstance(self.objects, Unset): + objects = UNSET + elif isinstance(self.objects, list): + objects = self.objects + + else: + objects = self.objects + + tags: Union[List[str], None, Unset] + if isinstance(self.tags, Unset): + tags = UNSET + elif isinstance(self.tags, list): + tags = self.tags + + else: + tags = self.tags field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -48,9 +52,40 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - objects = cast(List[str], d.pop("objects", UNSET)) - tags = cast(List[str], d.pop("tags", UNSET)) + def _parse_objects(data: object) -> Union[List[str], None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + objects_type_0 = cast(List[str], data) + + return objects_type_0 + except: # noqa: E722 + pass + return cast(Union[List[str], None, Unset], data) + + objects = _parse_objects(d.pop("objects", UNSET)) + + def _parse_tags(data: object) -> Union[List[str], None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + tags_type_0 = cast(List[str], data) + + return tags_type_0 + except: # noqa: E722 + pass + return cast(Union[List[str], None, Unset], data) + + tags = _parse_tags(d.pop("tags", UNSET)) smart_info_response_dto = cls( objects=objects, diff --git a/immich_carddav_sync/immich_client/models/system_config_dto.py b/immich_carddav_sync/immich_client/models/system_config_dto.py index bfcc3a5..aba6467 100644 --- a/immich_carddav_sync/immich_client/models/system_config_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_dto.py @@ -5,11 +5,23 @@ if TYPE_CHECKING: from ..models.system_config_f_fmpeg_dto import SystemConfigFFmpegDto + from ..models.system_config_image_dto import SystemConfigImageDto from ..models.system_config_job_dto import SystemConfigJobDto + from ..models.system_config_library_dto import SystemConfigLibraryDto + from ..models.system_config_logging_dto import SystemConfigLoggingDto + from ..models.system_config_machine_learning_dto import SystemConfigMachineLearningDto + from ..models.system_config_map_dto import SystemConfigMapDto + from ..models.system_config_metadata_dto import SystemConfigMetadataDto + from ..models.system_config_new_version_check_dto import SystemConfigNewVersionCheckDto + from ..models.system_config_notifications_dto import SystemConfigNotificationsDto from ..models.system_config_o_auth_dto import SystemConfigOAuthDto from ..models.system_config_password_login_dto import SystemConfigPasswordLoginDto + from ..models.system_config_reverse_geocoding_dto import SystemConfigReverseGeocodingDto + from ..models.system_config_server_dto import SystemConfigServerDto from ..models.system_config_storage_template_dto import SystemConfigStorageTemplateDto - from ..models.system_config_thumbnail_dto import SystemConfigThumbnailDto + from ..models.system_config_theme_dto import SystemConfigThemeDto + from ..models.system_config_trash_dto import SystemConfigTrashDto + from ..models.system_config_user_dto import SystemConfigUserDto T = TypeVar("T", bound="SystemConfigDto") @@ -20,44 +32,104 @@ class SystemConfigDto: """ Attributes: ffmpeg (SystemConfigFFmpegDto): + image (SystemConfigImageDto): job (SystemConfigJobDto): + library (SystemConfigLibraryDto): + logging (SystemConfigLoggingDto): + machine_learning (SystemConfigMachineLearningDto): + map_ (SystemConfigMapDto): + metadata (SystemConfigMetadataDto): + new_version_check (SystemConfigNewVersionCheckDto): + notifications (SystemConfigNotificationsDto): oauth (SystemConfigOAuthDto): password_login (SystemConfigPasswordLoginDto): + reverse_geocoding (SystemConfigReverseGeocodingDto): + server (SystemConfigServerDto): storage_template (SystemConfigStorageTemplateDto): - thumbnail (SystemConfigThumbnailDto): + theme (SystemConfigThemeDto): + trash (SystemConfigTrashDto): + user (SystemConfigUserDto): """ ffmpeg: "SystemConfigFFmpegDto" + image: "SystemConfigImageDto" job: "SystemConfigJobDto" + library: "SystemConfigLibraryDto" + logging: "SystemConfigLoggingDto" + machine_learning: "SystemConfigMachineLearningDto" + map_: "SystemConfigMapDto" + metadata: "SystemConfigMetadataDto" + new_version_check: "SystemConfigNewVersionCheckDto" + notifications: "SystemConfigNotificationsDto" oauth: "SystemConfigOAuthDto" password_login: "SystemConfigPasswordLoginDto" + reverse_geocoding: "SystemConfigReverseGeocodingDto" + server: "SystemConfigServerDto" storage_template: "SystemConfigStorageTemplateDto" - thumbnail: "SystemConfigThumbnailDto" + theme: "SystemConfigThemeDto" + trash: "SystemConfigTrashDto" + user: "SystemConfigUserDto" additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: ffmpeg = self.ffmpeg.to_dict() + image = self.image.to_dict() + job = self.job.to_dict() + library = self.library.to_dict() + + logging = self.logging.to_dict() + + machine_learning = self.machine_learning.to_dict() + + map_ = self.map_.to_dict() + + metadata = self.metadata.to_dict() + + new_version_check = self.new_version_check.to_dict() + + notifications = self.notifications.to_dict() + oauth = self.oauth.to_dict() password_login = self.password_login.to_dict() + reverse_geocoding = self.reverse_geocoding.to_dict() + + server = self.server.to_dict() + storage_template = self.storage_template.to_dict() - thumbnail = self.thumbnail.to_dict() + theme = self.theme.to_dict() + + trash = self.trash.to_dict() + + user = self.user.to_dict() field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "ffmpeg": ffmpeg, + "image": image, "job": job, + "library": library, + "logging": logging, + "machineLearning": machine_learning, + "map": map_, + "metadata": metadata, + "newVersionCheck": new_version_check, + "notifications": notifications, "oauth": oauth, "passwordLogin": password_login, + "reverseGeocoding": reverse_geocoding, + "server": server, "storageTemplate": storage_template, - "thumbnail": thumbnail, + "theme": theme, + "trash": trash, + "user": user, } ) @@ -66,32 +138,80 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.system_config_f_fmpeg_dto import SystemConfigFFmpegDto + from ..models.system_config_image_dto import SystemConfigImageDto from ..models.system_config_job_dto import SystemConfigJobDto + from ..models.system_config_library_dto import SystemConfigLibraryDto + from ..models.system_config_logging_dto import SystemConfigLoggingDto + from ..models.system_config_machine_learning_dto import SystemConfigMachineLearningDto + from ..models.system_config_map_dto import SystemConfigMapDto + from ..models.system_config_metadata_dto import SystemConfigMetadataDto + from ..models.system_config_new_version_check_dto import SystemConfigNewVersionCheckDto + from ..models.system_config_notifications_dto import SystemConfigNotificationsDto from ..models.system_config_o_auth_dto import SystemConfigOAuthDto from ..models.system_config_password_login_dto import SystemConfigPasswordLoginDto + from ..models.system_config_reverse_geocoding_dto import SystemConfigReverseGeocodingDto + from ..models.system_config_server_dto import SystemConfigServerDto from ..models.system_config_storage_template_dto import SystemConfigStorageTemplateDto - from ..models.system_config_thumbnail_dto import SystemConfigThumbnailDto + from ..models.system_config_theme_dto import SystemConfigThemeDto + from ..models.system_config_trash_dto import SystemConfigTrashDto + from ..models.system_config_user_dto import SystemConfigUserDto d = src_dict.copy() ffmpeg = SystemConfigFFmpegDto.from_dict(d.pop("ffmpeg")) + image = SystemConfigImageDto.from_dict(d.pop("image")) + job = SystemConfigJobDto.from_dict(d.pop("job")) + library = SystemConfigLibraryDto.from_dict(d.pop("library")) + + logging = SystemConfigLoggingDto.from_dict(d.pop("logging")) + + machine_learning = SystemConfigMachineLearningDto.from_dict(d.pop("machineLearning")) + + map_ = SystemConfigMapDto.from_dict(d.pop("map")) + + metadata = SystemConfigMetadataDto.from_dict(d.pop("metadata")) + + new_version_check = SystemConfigNewVersionCheckDto.from_dict(d.pop("newVersionCheck")) + + notifications = SystemConfigNotificationsDto.from_dict(d.pop("notifications")) + oauth = SystemConfigOAuthDto.from_dict(d.pop("oauth")) password_login = SystemConfigPasswordLoginDto.from_dict(d.pop("passwordLogin")) + reverse_geocoding = SystemConfigReverseGeocodingDto.from_dict(d.pop("reverseGeocoding")) + + server = SystemConfigServerDto.from_dict(d.pop("server")) + storage_template = SystemConfigStorageTemplateDto.from_dict(d.pop("storageTemplate")) - thumbnail = SystemConfigThumbnailDto.from_dict(d.pop("thumbnail")) + theme = SystemConfigThemeDto.from_dict(d.pop("theme")) + + trash = SystemConfigTrashDto.from_dict(d.pop("trash")) + + user = SystemConfigUserDto.from_dict(d.pop("user")) system_config_dto = cls( ffmpeg=ffmpeg, + image=image, job=job, + library=library, + logging=logging, + machine_learning=machine_learning, + map_=map_, + metadata=metadata, + new_version_check=new_version_check, + notifications=notifications, oauth=oauth, password_login=password_login, + reverse_geocoding=reverse_geocoding, + server=server, storage_template=storage_template, - thumbnail=thumbnail, + theme=theme, + trash=trash, + user=user, ) system_config_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/system_config_f_fmpeg_dto.py b/immich_carddav_sync/immich_client/models/system_config_f_fmpeg_dto.py index faab09c..ff32042 100644 --- a/immich_carddav_sync/immich_client/models/system_config_f_fmpeg_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_f_fmpeg_dto.py @@ -4,10 +4,12 @@ from attrs import field as _attrs_field from ..models.audio_codec import AudioCodec +from ..models.cq_mode import CQMode from ..models.tone_mapping import ToneMapping from ..models.transcode_hw_accel import TranscodeHWAccel from ..models.transcode_policy import TranscodePolicy from ..models.video_codec import VideoCodec +from ..models.video_container import VideoContainer T = TypeVar("T", bound="SystemConfigFFmpegDto") @@ -17,12 +19,23 @@ class SystemConfigFFmpegDto: """ Attributes: accel (TranscodeHWAccel): + accel_decode (bool): + accepted_audio_codecs (List[AudioCodec]): + accepted_containers (List[VideoContainer]): + accepted_video_codecs (List[VideoCodec]): + bframes (int): + cq_mode (CQMode): crf (int): + gop_size (int): max_bitrate (str): + npl (int): + preferred_hw_device (str): preset (str): + refs (int): target_audio_codec (AudioCodec): target_resolution (str): target_video_codec (VideoCodec): + temporal_aq (bool): threads (int): tonemap (ToneMapping): transcode (TranscodePolicy): @@ -30,12 +43,23 @@ class SystemConfigFFmpegDto: """ accel: TranscodeHWAccel + accel_decode: bool + accepted_audio_codecs: List[AudioCodec] + accepted_containers: List[VideoContainer] + accepted_video_codecs: List[VideoCodec] + bframes: int + cq_mode: CQMode crf: int + gop_size: int max_bitrate: str + npl: int + preferred_hw_device: str preset: str + refs: int target_audio_codec: AudioCodec target_resolution: str target_video_codec: VideoCodec + temporal_aq: bool threads: int tonemap: ToneMapping transcode: TranscodePolicy @@ -45,15 +69,51 @@ class SystemConfigFFmpegDto: def to_dict(self) -> Dict[str, Any]: accel = self.accel.value + accel_decode = self.accel_decode + + accepted_audio_codecs = [] + for accepted_audio_codecs_item_data in self.accepted_audio_codecs: + accepted_audio_codecs_item = accepted_audio_codecs_item_data.value + accepted_audio_codecs.append(accepted_audio_codecs_item) + + accepted_containers = [] + for accepted_containers_item_data in self.accepted_containers: + accepted_containers_item = accepted_containers_item_data.value + accepted_containers.append(accepted_containers_item) + + accepted_video_codecs = [] + for accepted_video_codecs_item_data in self.accepted_video_codecs: + accepted_video_codecs_item = accepted_video_codecs_item_data.value + accepted_video_codecs.append(accepted_video_codecs_item) + + bframes = self.bframes + + cq_mode = self.cq_mode.value + crf = self.crf + + gop_size = self.gop_size + max_bitrate = self.max_bitrate + + npl = self.npl + + preferred_hw_device = self.preferred_hw_device + preset = self.preset + + refs = self.refs + target_audio_codec = self.target_audio_codec.value target_resolution = self.target_resolution + target_video_codec = self.target_video_codec.value + temporal_aq = self.temporal_aq + threads = self.threads + tonemap = self.tonemap.value transcode = self.transcode.value @@ -65,12 +125,23 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "accel": accel, + "accelDecode": accel_decode, + "acceptedAudioCodecs": accepted_audio_codecs, + "acceptedContainers": accepted_containers, + "acceptedVideoCodecs": accepted_video_codecs, + "bframes": bframes, + "cqMode": cq_mode, "crf": crf, + "gopSize": gop_size, "maxBitrate": max_bitrate, + "npl": npl, + "preferredHwDevice": preferred_hw_device, "preset": preset, + "refs": refs, "targetAudioCodec": target_audio_codec, "targetResolution": target_resolution, "targetVideoCodec": target_video_codec, + "temporalAQ": temporal_aq, "threads": threads, "tonemap": tonemap, "transcode": transcode, @@ -85,18 +156,55 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() accel = TranscodeHWAccel(d.pop("accel")) + accel_decode = d.pop("accelDecode") + + accepted_audio_codecs = [] + _accepted_audio_codecs = d.pop("acceptedAudioCodecs") + for accepted_audio_codecs_item_data in _accepted_audio_codecs: + accepted_audio_codecs_item = AudioCodec(accepted_audio_codecs_item_data) + + accepted_audio_codecs.append(accepted_audio_codecs_item) + + accepted_containers = [] + _accepted_containers = d.pop("acceptedContainers") + for accepted_containers_item_data in _accepted_containers: + accepted_containers_item = VideoContainer(accepted_containers_item_data) + + accepted_containers.append(accepted_containers_item) + + accepted_video_codecs = [] + _accepted_video_codecs = d.pop("acceptedVideoCodecs") + for accepted_video_codecs_item_data in _accepted_video_codecs: + accepted_video_codecs_item = VideoCodec(accepted_video_codecs_item_data) + + accepted_video_codecs.append(accepted_video_codecs_item) + + bframes = d.pop("bframes") + + cq_mode = CQMode(d.pop("cqMode")) + crf = d.pop("crf") + gop_size = d.pop("gopSize") + max_bitrate = d.pop("maxBitrate") + npl = d.pop("npl") + + preferred_hw_device = d.pop("preferredHwDevice") + preset = d.pop("preset") + refs = d.pop("refs") + target_audio_codec = AudioCodec(d.pop("targetAudioCodec")) target_resolution = d.pop("targetResolution") target_video_codec = VideoCodec(d.pop("targetVideoCodec")) + temporal_aq = d.pop("temporalAQ") + threads = d.pop("threads") tonemap = ToneMapping(d.pop("tonemap")) @@ -107,12 +215,23 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: system_config_f_fmpeg_dto = cls( accel=accel, + accel_decode=accel_decode, + accepted_audio_codecs=accepted_audio_codecs, + accepted_containers=accepted_containers, + accepted_video_codecs=accepted_video_codecs, + bframes=bframes, + cq_mode=cq_mode, crf=crf, + gop_size=gop_size, max_bitrate=max_bitrate, + npl=npl, + preferred_hw_device=preferred_hw_device, preset=preset, + refs=refs, target_audio_codec=target_audio_codec, target_resolution=target_resolution, target_video_codec=target_video_codec, + temporal_aq=temporal_aq, threads=threads, tonemap=tonemap, transcode=transcode, diff --git a/immich_carddav_sync/immich_client/models/system_config_job_dto.py b/immich_carddav_sync/immich_client/models/system_config_job_dto.py index 5be9837..ad2a572 100644 --- a/immich_carddav_sync/immich_client/models/system_config_job_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_job_dto.py @@ -15,25 +15,27 @@ class SystemConfigJobDto: """ Attributes: background_task (JobSettingsDto): - clip_encoding (JobSettingsDto): + face_detection (JobSettingsDto): + library (JobSettingsDto): metadata_extraction (JobSettingsDto): - object_tagging (JobSettingsDto): - recognize_faces (JobSettingsDto): + migration (JobSettingsDto): + notifications (JobSettingsDto): search (JobSettingsDto): sidecar (JobSettingsDto): - storage_template_migration (JobSettingsDto): + smart_search (JobSettingsDto): thumbnail_generation (JobSettingsDto): video_conversion (JobSettingsDto): """ background_task: "JobSettingsDto" - clip_encoding: "JobSettingsDto" + face_detection: "JobSettingsDto" + library: "JobSettingsDto" metadata_extraction: "JobSettingsDto" - object_tagging: "JobSettingsDto" - recognize_faces: "JobSettingsDto" + migration: "JobSettingsDto" + notifications: "JobSettingsDto" search: "JobSettingsDto" sidecar: "JobSettingsDto" - storage_template_migration: "JobSettingsDto" + smart_search: "JobSettingsDto" thumbnail_generation: "JobSettingsDto" video_conversion: "JobSettingsDto" additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -41,19 +43,21 @@ class SystemConfigJobDto: def to_dict(self) -> Dict[str, Any]: background_task = self.background_task.to_dict() - clip_encoding = self.clip_encoding.to_dict() + face_detection = self.face_detection.to_dict() + + library = self.library.to_dict() metadata_extraction = self.metadata_extraction.to_dict() - object_tagging = self.object_tagging.to_dict() + migration = self.migration.to_dict() - recognize_faces = self.recognize_faces.to_dict() + notifications = self.notifications.to_dict() search = self.search.to_dict() sidecar = self.sidecar.to_dict() - storage_template_migration = self.storage_template_migration.to_dict() + smart_search = self.smart_search.to_dict() thumbnail_generation = self.thumbnail_generation.to_dict() @@ -64,13 +68,14 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "backgroundTask": background_task, - "clipEncoding": clip_encoding, + "faceDetection": face_detection, + "library": library, "metadataExtraction": metadata_extraction, - "objectTagging": object_tagging, - "recognizeFaces": recognize_faces, + "migration": migration, + "notifications": notifications, "search": search, "sidecar": sidecar, - "storageTemplateMigration": storage_template_migration, + "smartSearch": smart_search, "thumbnailGeneration": thumbnail_generation, "videoConversion": video_conversion, } @@ -85,19 +90,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() background_task = JobSettingsDto.from_dict(d.pop("backgroundTask")) - clip_encoding = JobSettingsDto.from_dict(d.pop("clipEncoding")) + face_detection = JobSettingsDto.from_dict(d.pop("faceDetection")) + + library = JobSettingsDto.from_dict(d.pop("library")) metadata_extraction = JobSettingsDto.from_dict(d.pop("metadataExtraction")) - object_tagging = JobSettingsDto.from_dict(d.pop("objectTagging")) + migration = JobSettingsDto.from_dict(d.pop("migration")) - recognize_faces = JobSettingsDto.from_dict(d.pop("recognizeFaces")) + notifications = JobSettingsDto.from_dict(d.pop("notifications")) search = JobSettingsDto.from_dict(d.pop("search")) sidecar = JobSettingsDto.from_dict(d.pop("sidecar")) - storage_template_migration = JobSettingsDto.from_dict(d.pop("storageTemplateMigration")) + smart_search = JobSettingsDto.from_dict(d.pop("smartSearch")) thumbnail_generation = JobSettingsDto.from_dict(d.pop("thumbnailGeneration")) @@ -105,13 +112,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: system_config_job_dto = cls( background_task=background_task, - clip_encoding=clip_encoding, + face_detection=face_detection, + library=library, metadata_extraction=metadata_extraction, - object_tagging=object_tagging, - recognize_faces=recognize_faces, + migration=migration, + notifications=notifications, search=search, sidecar=sidecar, - storage_template_migration=storage_template_migration, + smart_search=smart_search, thumbnail_generation=thumbnail_generation, video_conversion=video_conversion, ) diff --git a/immich_carddav_sync/immich_client/models/system_config_library_dto.py b/immich_carddav_sync/immich_client/models/system_config_library_dto.py new file mode 100644 index 0000000..ce2add8 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_library_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 + +if TYPE_CHECKING: + from ..models.system_config_library_scan_dto import SystemConfigLibraryScanDto + from ..models.system_config_library_watch_dto import SystemConfigLibraryWatchDto + + +T = TypeVar("T", bound="SystemConfigLibraryDto") + + +@_attrs_define +class SystemConfigLibraryDto: + """ + Attributes: + scan (SystemConfigLibraryScanDto): + watch (SystemConfigLibraryWatchDto): + """ + + scan: "SystemConfigLibraryScanDto" + watch: "SystemConfigLibraryWatchDto" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + scan = self.scan.to_dict() + + watch = self.watch.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "scan": scan, + "watch": watch, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.system_config_library_scan_dto import SystemConfigLibraryScanDto + from ..models.system_config_library_watch_dto import SystemConfigLibraryWatchDto + + d = src_dict.copy() + scan = SystemConfigLibraryScanDto.from_dict(d.pop("scan")) + + watch = SystemConfigLibraryWatchDto.from_dict(d.pop("watch")) + + system_config_library_dto = cls( + scan=scan, + watch=watch, + ) + + system_config_library_dto.additional_properties = d + return system_config_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/system_config_library_scan_dto.py b/immich_carddav_sync/immich_client/models/system_config_library_scan_dto.py new file mode 100644 index 0000000..a3fb34f --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_library_scan_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="SystemConfigLibraryScanDto") + + +@_attrs_define +class SystemConfigLibraryScanDto: + """ + Attributes: + cron_expression (str): + enabled (bool): + """ + + cron_expression: str + enabled: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + cron_expression = self.cron_expression + + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cronExpression": cron_expression, + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + cron_expression = d.pop("cronExpression") + + enabled = d.pop("enabled") + + system_config_library_scan_dto = cls( + cron_expression=cron_expression, + enabled=enabled, + ) + + system_config_library_scan_dto.additional_properties = d + return system_config_library_scan_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_thumbnail_dto.py b/immich_carddav_sync/immich_client/models/system_config_logging_dto.py similarity index 64% rename from immich_carddav_sync/immich_client/models/system_config_thumbnail_dto.py rename to immich_carddav_sync/immich_client/models/system_config_logging_dto.py index b93acb0..7f8f96a 100644 --- a/immich_carddav_sync/immich_client/models/system_config_thumbnail_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_logging_dto.py @@ -3,31 +3,34 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="SystemConfigThumbnailDto") +from ..models.log_level import LogLevel + +T = TypeVar("T", bound="SystemConfigLoggingDto") @_attrs_define -class SystemConfigThumbnailDto: +class SystemConfigLoggingDto: """ Attributes: - jpeg_size (int): - webp_size (int): + enabled (bool): + level (LogLevel): """ - jpeg_size: int - webp_size: int + enabled: bool + level: LogLevel additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - jpeg_size = self.jpeg_size - webp_size = self.webp_size + enabled = self.enabled + + level = self.level.value field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "jpegSize": jpeg_size, - "webpSize": webp_size, + "enabled": enabled, + "level": level, } ) @@ -36,17 +39,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - jpeg_size = d.pop("jpegSize") + enabled = d.pop("enabled") - webp_size = d.pop("webpSize") + level = LogLevel(d.pop("level")) - system_config_thumbnail_dto = cls( - jpeg_size=jpeg_size, - webp_size=webp_size, + system_config_logging_dto = cls( + enabled=enabled, + level=level, ) - system_config_thumbnail_dto.additional_properties = d - return system_config_thumbnail_dto + system_config_logging_dto.additional_properties = d + return system_config_logging_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/system_config_machine_learning_dto.py b/immich_carddav_sync/immich_client/models/system_config_machine_learning_dto.py new file mode 100644 index 0000000..f6b027d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_machine_learning_dto.py @@ -0,0 +1,100 @@ +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.clip_config import CLIPConfig + from ..models.duplicate_detection_config import DuplicateDetectionConfig + from ..models.facial_recognition_config import FacialRecognitionConfig + + +T = TypeVar("T", bound="SystemConfigMachineLearningDto") + + +@_attrs_define +class SystemConfigMachineLearningDto: + """ + Attributes: + clip (CLIPConfig): + duplicate_detection (DuplicateDetectionConfig): + enabled (bool): + facial_recognition (FacialRecognitionConfig): + url (str): + """ + + clip: "CLIPConfig" + duplicate_detection: "DuplicateDetectionConfig" + enabled: bool + facial_recognition: "FacialRecognitionConfig" + url: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + clip = self.clip.to_dict() + + duplicate_detection = self.duplicate_detection.to_dict() + + enabled = self.enabled + + facial_recognition = self.facial_recognition.to_dict() + + url = self.url + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "clip": clip, + "duplicateDetection": duplicate_detection, + "enabled": enabled, + "facialRecognition": facial_recognition, + "url": url, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.clip_config import CLIPConfig + from ..models.duplicate_detection_config import DuplicateDetectionConfig + from ..models.facial_recognition_config import FacialRecognitionConfig + + d = src_dict.copy() + clip = CLIPConfig.from_dict(d.pop("clip")) + + duplicate_detection = DuplicateDetectionConfig.from_dict(d.pop("duplicateDetection")) + + enabled = d.pop("enabled") + + facial_recognition = FacialRecognitionConfig.from_dict(d.pop("facialRecognition")) + + url = d.pop("url") + + system_config_machine_learning_dto = cls( + clip=clip, + duplicate_detection=duplicate_detection, + enabled=enabled, + facial_recognition=facial_recognition, + url=url, + ) + + system_config_machine_learning_dto.additional_properties = d + return system_config_machine_learning_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_count_response_dto.py b/immich_carddav_sync/immich_client/models/system_config_map_dto.py similarity index 58% rename from immich_carddav_sync/immich_client/models/album_count_response_dto.py rename to immich_carddav_sync/immich_client/models/system_config_map_dto.py index 8ed444f..535e7d0 100644 --- a/immich_carddav_sync/immich_client/models/album_count_response_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_map_dto.py @@ -3,35 +3,37 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AlbumCountResponseDto") +T = TypeVar("T", bound="SystemConfigMapDto") @_attrs_define -class AlbumCountResponseDto: +class SystemConfigMapDto: """ Attributes: - not_shared (int): - owned (int): - shared (int): + dark_style (str): + enabled (bool): + light_style (str): """ - not_shared: int - owned: int - shared: int + dark_style: str + enabled: bool + light_style: str 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 + dark_style = self.dark_style + + enabled = self.enabled + + light_style = self.light_style field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "notShared": not_shared, - "owned": owned, - "shared": shared, + "darkStyle": dark_style, + "enabled": enabled, + "lightStyle": light_style, } ) @@ -40,20 +42,20 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - not_shared = d.pop("notShared") + dark_style = d.pop("darkStyle") - owned = d.pop("owned") + enabled = d.pop("enabled") - shared = d.pop("shared") + light_style = d.pop("lightStyle") - album_count_response_dto = cls( - not_shared=not_shared, - owned=owned, - shared=shared, + system_config_map_dto = cls( + dark_style=dark_style, + enabled=enabled, + light_style=light_style, ) - album_count_response_dto.additional_properties = d - return album_count_response_dto + system_config_map_dto.additional_properties = d + return system_config_map_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/search_config_response_dto.py b/immich_carddav_sync/immich_client/models/system_config_new_version_check_dto.py similarity index 82% rename from immich_carddav_sync/immich_client/models/search_config_response_dto.py rename to immich_carddav_sync/immich_client/models/system_config_new_version_check_dto.py index 1d7853e..0d19f58 100644 --- a/immich_carddav_sync/immich_client/models/search_config_response_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_new_version_check_dto.py @@ -3,11 +3,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="SearchConfigResponseDto") +T = TypeVar("T", bound="SystemConfigNewVersionCheckDto") @_attrs_define -class SearchConfigResponseDto: +class SystemConfigNewVersionCheckDto: """ Attributes: enabled (bool): @@ -34,12 +34,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() enabled = d.pop("enabled") - search_config_response_dto = cls( + system_config_new_version_check_dto = cls( enabled=enabled, ) - search_config_response_dto.additional_properties = d - return search_config_response_dto + system_config_new_version_check_dto.additional_properties = d + return system_config_new_version_check_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/system_config_o_auth_dto.py b/immich_carddav_sync/immich_client/models/system_config_o_auth_dto.py index 4dc1c09..76a0417 100644 --- a/immich_carddav_sync/immich_client/models/system_config_o_auth_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_o_auth_dto.py @@ -15,12 +15,16 @@ class SystemConfigOAuthDto: button_text (str): client_id (str): client_secret (str): + default_storage_quota (float): enabled (bool): issuer_url (str): mobile_override_enabled (bool): mobile_redirect_uri (str): + profile_signing_algorithm (str): scope (str): + signing_algorithm (str): storage_label_claim (str): + storage_quota_claim (str): """ auto_launch: bool @@ -28,27 +32,49 @@ class SystemConfigOAuthDto: button_text: str client_id: str client_secret: str + default_storage_quota: float enabled: bool issuer_url: str mobile_override_enabled: bool mobile_redirect_uri: str + profile_signing_algorithm: str scope: str + signing_algorithm: str storage_label_claim: str + storage_quota_claim: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: auto_launch = self.auto_launch + auto_register = self.auto_register + button_text = self.button_text + client_id = self.client_id + client_secret = self.client_secret + + default_storage_quota = self.default_storage_quota + enabled = self.enabled + issuer_url = self.issuer_url + mobile_override_enabled = self.mobile_override_enabled + mobile_redirect_uri = self.mobile_redirect_uri + + profile_signing_algorithm = self.profile_signing_algorithm + scope = self.scope + + signing_algorithm = self.signing_algorithm + storage_label_claim = self.storage_label_claim + storage_quota_claim = self.storage_quota_claim + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -58,12 +84,16 @@ def to_dict(self) -> Dict[str, Any]: "buttonText": button_text, "clientId": client_id, "clientSecret": client_secret, + "defaultStorageQuota": default_storage_quota, "enabled": enabled, "issuerUrl": issuer_url, "mobileOverrideEnabled": mobile_override_enabled, "mobileRedirectUri": mobile_redirect_uri, + "profileSigningAlgorithm": profile_signing_algorithm, "scope": scope, + "signingAlgorithm": signing_algorithm, "storageLabelClaim": storage_label_claim, + "storageQuotaClaim": storage_quota_claim, } ) @@ -82,6 +112,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: client_secret = d.pop("clientSecret") + default_storage_quota = d.pop("defaultStorageQuota") + enabled = d.pop("enabled") issuer_url = d.pop("issuerUrl") @@ -90,22 +122,32 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: mobile_redirect_uri = d.pop("mobileRedirectUri") + profile_signing_algorithm = d.pop("profileSigningAlgorithm") + scope = d.pop("scope") + signing_algorithm = d.pop("signingAlgorithm") + storage_label_claim = d.pop("storageLabelClaim") + storage_quota_claim = d.pop("storageQuotaClaim") + system_config_o_auth_dto = cls( auto_launch=auto_launch, auto_register=auto_register, button_text=button_text, client_id=client_id, client_secret=client_secret, + default_storage_quota=default_storage_quota, enabled=enabled, issuer_url=issuer_url, mobile_override_enabled=mobile_override_enabled, mobile_redirect_uri=mobile_redirect_uri, + profile_signing_algorithm=profile_signing_algorithm, scope=scope, + signing_algorithm=signing_algorithm, storage_label_claim=storage_label_claim, + storage_quota_claim=storage_quota_claim, ) system_config_o_auth_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/system_config_reverse_geocoding_dto.py b/immich_carddav_sync/immich_client/models/system_config_reverse_geocoding_dto.py new file mode 100644 index 0000000..dea9faa --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_reverse_geocoding_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="SystemConfigReverseGeocodingDto") + + +@_attrs_define +class SystemConfigReverseGeocodingDto: + """ + 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_reverse_geocoding_dto = cls( + enabled=enabled, + ) + + system_config_reverse_geocoding_dto.additional_properties = d + return system_config_reverse_geocoding_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_storage_template_dto.py b/immich_carddav_sync/immich_client/models/system_config_storage_template_dto.py index 0734d8c..4f6af5c 100644 --- a/immich_carddav_sync/immich_client/models/system_config_storage_template_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_storage_template_dto.py @@ -10,19 +10,29 @@ class SystemConfigStorageTemplateDto: """ Attributes: + enabled (bool): + hash_verification_enabled (bool): template (str): """ + enabled: bool + hash_verification_enabled: bool template: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + enabled = self.enabled + + hash_verification_enabled = self.hash_verification_enabled + template = self.template field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "enabled": enabled, + "hashVerificationEnabled": hash_verification_enabled, "template": template, } ) @@ -32,9 +42,15 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + enabled = d.pop("enabled") + + hash_verification_enabled = d.pop("hashVerificationEnabled") + template = d.pop("template") system_config_storage_template_dto = cls( + enabled=enabled, + hash_verification_enabled=hash_verification_enabled, template=template, ) diff --git a/immich_carddav_sync/immich_client/models/system_config_template_storage_option_dto.py b/immich_carddav_sync/immich_client/models/system_config_template_storage_option_dto.py index ef9cc56..582c1ed 100644 --- a/immich_carddav_sync/immich_client/models/system_config_template_storage_option_dto.py +++ b/immich_carddav_sync/immich_client/models/system_config_template_storage_option_dto.py @@ -16,6 +16,7 @@ class SystemConfigTemplateStorageOptionDto: month_options (List[str]): preset_options (List[str]): second_options (List[str]): + week_options (List[str]): year_options (List[str]): """ @@ -25,6 +26,7 @@ class SystemConfigTemplateStorageOptionDto: month_options: List[str] preset_options: List[str] second_options: List[str] + week_options: List[str] year_options: List[str] additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -41,6 +43,8 @@ def to_dict(self) -> Dict[str, Any]: second_options = self.second_options + week_options = self.week_options + year_options = self.year_options field_dict: Dict[str, Any] = {} @@ -53,6 +57,7 @@ def to_dict(self) -> Dict[str, Any]: "monthOptions": month_options, "presetOptions": preset_options, "secondOptions": second_options, + "weekOptions": week_options, "yearOptions": year_options, } ) @@ -74,6 +79,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: second_options = cast(List[str], d.pop("secondOptions")) + week_options = cast(List[str], d.pop("weekOptions")) + year_options = cast(List[str], d.pop("yearOptions")) system_config_template_storage_option_dto = cls( @@ -83,6 +90,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: month_options=month_options, preset_options=preset_options, second_options=second_options, + week_options=week_options, year_options=year_options, ) diff --git a/immich_carddav_sync/immich_client/models/system_config_theme_dto.py b/immich_carddav_sync/immich_client/models/system_config_theme_dto.py new file mode 100644 index 0000000..857448f --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_theme_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="SystemConfigThemeDto") + + +@_attrs_define +class SystemConfigThemeDto: + """ + Attributes: + custom_css (str): + """ + + custom_css: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + custom_css = self.custom_css + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "customCss": custom_css, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + custom_css = d.pop("customCss") + + system_config_theme_dto = cls( + custom_css=custom_css, + ) + + system_config_theme_dto.additional_properties = d + return system_config_theme_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_trash_dto.py b/immich_carddav_sync/immich_client/models/system_config_trash_dto.py new file mode 100644 index 0000000..a488c5d --- /dev/null +++ b/immich_carddav_sync/immich_client/models/system_config_trash_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="SystemConfigTrashDto") + + +@_attrs_define +class SystemConfigTrashDto: + """ + Attributes: + days (int): + enabled (bool): + """ + + days: int + enabled: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + days = self.days + + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "days": days, + "enabled": enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + days = d.pop("days") + + enabled = d.pop("enabled") + + system_config_trash_dto = cls( + days=days, + enabled=enabled, + ) + + system_config_trash_dto.additional_properties = d + return system_config_trash_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_response_dto.py b/immich_carddav_sync/immich_client/models/tag_response_dto.py index 20fcd38..1c4d4fd 100644 --- a/immich_carddav_sync/immich_client/models/tag_response_dto.py +++ b/immich_carddav_sync/immich_client/models/tag_response_dto.py @@ -1,9 +1,11 @@ -from typing import Any, Dict, List, Type, TypeVar +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 ..models.tag_type_enum import TagTypeEnum +from ..types import UNSET, Unset T = TypeVar("T", bound="TagResponseDto") @@ -12,54 +14,82 @@ class TagResponseDto: """ Attributes: + created_at (datetime.datetime): id (str): name (str): - type (TagTypeEnum): - user_id (str): + updated_at (datetime.datetime): + value (str): + color (Union[Unset, str]): + parent_id (Union[Unset, str]): """ + created_at: datetime.datetime id: str name: str - type: TagTypeEnum - user_id: str + updated_at: datetime.datetime + value: str + color: Union[Unset, str] = UNSET + parent_id: Union[Unset, str] = UNSET 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 + name = self.name - type = self.type.value - user_id = self.user_id + updated_at = self.updated_at.isoformat() + + value = self.value + + color = self.color + + parent_id = self.parent_id field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { + "createdAt": created_at, "id": id, "name": name, - "type": type, - "userId": user_id, + "updatedAt": updated_at, + "value": value, } ) + 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() + created_at = isoparse(d.pop("createdAt")) + id = d.pop("id") name = d.pop("name") - type = TagTypeEnum(d.pop("type")) + updated_at = isoparse(d.pop("updatedAt")) + + value = d.pop("value") + + color = d.pop("color", UNSET) - user_id = d.pop("userId") + parent_id = d.pop("parentId", UNSET) tag_response_dto = cls( + created_at=created_at, id=id, name=name, - type=type, - user_id=user_id, + updated_at=updated_at, + value=value, + color=color, + parent_id=parent_id, ) tag_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/tag_type_enum.py b/immich_carddav_sync/immich_client/models/tag_type_enum.py deleted file mode 100644 index ab07a47..0000000 --- a/immich_carddav_sync/immich_client/models/tag_type_enum.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import Enum - - -class TagTypeEnum(str, Enum): - CUSTOM = "CUSTOM" - FACE = "FACE" - OBJECT = "OBJECT" - - def __str__(self) -> str: - return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/time_bucket_response_dto.py b/immich_carddav_sync/immich_client/models/time_bucket_response_dto.py index 3181ee4..450eed7 100644 --- a/immich_carddav_sync/immich_client/models/time_bucket_response_dto.py +++ b/immich_carddav_sync/immich_client/models/time_bucket_response_dto.py @@ -20,6 +20,7 @@ class TimeBucketResponseDto: def to_dict(self) -> Dict[str, Any]: count = self.count + time_bucket = self.time_bucket field_dict: Dict[str, Any] = {} diff --git a/immich_carddav_sync/immich_client/models/transcode_hw_accel.py b/immich_carddav_sync/immich_client/models/transcode_hw_accel.py index 5634a96..57d15a7 100644 --- a/immich_carddav_sync/immich_client/models/transcode_hw_accel.py +++ b/immich_carddav_sync/immich_client/models/transcode_hw_accel.py @@ -5,6 +5,7 @@ class TranscodeHWAccel(str, Enum): DISABLED = "disabled" NVENC = "nvenc" QSV = "qsv" + RKMPP = "rkmpp" VAAPI = "vaapi" def __str__(self) -> str: diff --git a/immich_carddav_sync/immich_client/models/transcode_policy.py b/immich_carddav_sync/immich_client/models/transcode_policy.py index afc8081..a30c7cf 100644 --- a/immich_carddav_sync/immich_client/models/transcode_policy.py +++ b/immich_carddav_sync/immich_client/models/transcode_policy.py @@ -3,6 +3,7 @@ class TranscodePolicy(str, Enum): ALL = "all" + BITRATE = "bitrate" DISABLED = "disabled" OPTIMAL = "optimal" REQUIRED = "required" diff --git a/immich_carddav_sync/immich_client/models/update_album_dto.py b/immich_carddav_sync/immich_client/models/update_album_dto.py index 7f19ad8..c8ddcc8 100644 --- a/immich_carddav_sync/immich_client/models/update_album_dto.py +++ b/immich_carddav_sync/immich_client/models/update_album_dto.py @@ -1,8 +1,10 @@ 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.asset_order import AssetOrder from ..types import UNSET, Unset T = TypeVar("T", bound="UpdateAlbumDto") @@ -13,20 +15,34 @@ class UpdateAlbumDto: """ Attributes: album_name (Union[Unset, str]): - album_thumbnail_asset_id (Union[Unset, str]): + album_thumbnail_asset_id (Union[Unset, UUID]): description (Union[Unset, str]): + is_activity_enabled (Union[Unset, bool]): + order (Union[Unset, AssetOrder]): """ album_name: Union[Unset, str] = UNSET - album_thumbnail_asset_id: Union[Unset, str] = UNSET + album_thumbnail_asset_id: Union[Unset, UUID] = UNSET description: Union[Unset, str] = UNSET + is_activity_enabled: Union[Unset, bool] = UNSET + order: Union[Unset, AssetOrder] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: album_name = self.album_name - album_thumbnail_asset_id = self.album_thumbnail_asset_id + + album_thumbnail_asset_id: Union[Unset, str] = UNSET + if not isinstance(self.album_thumbnail_asset_id, Unset): + album_thumbnail_asset_id = str(self.album_thumbnail_asset_id) + description = self.description + is_activity_enabled = self.is_activity_enabled + + order: Union[Unset, str] = UNSET + if not isinstance(self.order, Unset): + order = self.order.value + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -36,6 +52,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict["albumThumbnailAssetId"] = album_thumbnail_asset_id if description is not UNSET: field_dict["description"] = description + if is_activity_enabled is not UNSET: + field_dict["isActivityEnabled"] = is_activity_enabled + if order is not UNSET: + field_dict["order"] = order return field_dict @@ -44,14 +64,30 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() album_name = d.pop("albumName", UNSET) - album_thumbnail_asset_id = d.pop("albumThumbnailAssetId", UNSET) + _album_thumbnail_asset_id = d.pop("albumThumbnailAssetId", UNSET) + album_thumbnail_asset_id: Union[Unset, UUID] + if isinstance(_album_thumbnail_asset_id, Unset): + album_thumbnail_asset_id = UNSET + else: + album_thumbnail_asset_id = UUID(_album_thumbnail_asset_id) description = d.pop("description", UNSET) + is_activity_enabled = d.pop("isActivityEnabled", UNSET) + + _order = d.pop("order", UNSET) + order: Union[Unset, AssetOrder] + if isinstance(_order, Unset): + order = UNSET + else: + order = AssetOrder(_order) + update_album_dto = cls( album_name=album_name, album_thumbnail_asset_id=album_thumbnail_asset_id, description=description, + is_activity_enabled=is_activity_enabled, + order=order, ) update_album_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/update_asset_dto.py b/immich_carddav_sync/immich_client/models/update_asset_dto.py index db2f2dd..9d43444 100644 --- a/immich_carddav_sync/immich_client/models/update_asset_dto.py +++ b/immich_carddav_sync/immich_client/models/update_asset_dto.py @@ -1,4 +1,5 @@ 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 @@ -12,57 +13,114 @@ class UpdateAssetDto: """ Attributes: + date_time_original (Union[Unset, str]): description (Union[Unset, str]): is_archived (Union[Unset, bool]): is_favorite (Union[Unset, bool]): - tag_ids (Union[Unset, List[str]]): Example: ['bf973405-3f2a-48d2-a687-2ed4167164be', - 'dd41870b-5d00-46d2-924e-1d8489a0aa0f', 'fad77c3f-deef-4e7e-9608-14c1aa4e559a']. + latitude (Union[Unset, float]): + live_photo_video_id (Union[None, UUID, Unset]): + longitude (Union[Unset, float]): + rating (Union[Unset, float]): """ + date_time_original: Union[Unset, str] = UNSET description: Union[Unset, str] = UNSET is_archived: Union[Unset, bool] = UNSET is_favorite: Union[Unset, bool] = UNSET - tag_ids: Union[Unset, List[str]] = UNSET + latitude: Union[Unset, float] = UNSET + live_photo_video_id: Union[None, UUID, Unset] = UNSET + longitude: Union[Unset, float] = UNSET + rating: Union[Unset, float] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + date_time_original = self.date_time_original + description = self.description + is_archived = self.is_archived + is_favorite = self.is_favorite - tag_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.tag_ids, Unset): - tag_ids = self.tag_ids + + latitude = self.latitude + + live_photo_video_id: Union[None, Unset, str] + if isinstance(self.live_photo_video_id, Unset): + live_photo_video_id = UNSET + elif isinstance(self.live_photo_video_id, UUID): + live_photo_video_id = str(self.live_photo_video_id) + else: + live_photo_video_id = self.live_photo_video_id + + longitude = self.longitude + + rating = self.rating field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if date_time_original is not UNSET: + field_dict["dateTimeOriginal"] = date_time_original if description is not UNSET: field_dict["description"] = description if is_archived is not UNSET: field_dict["isArchived"] = is_archived if is_favorite is not UNSET: field_dict["isFavorite"] = is_favorite - if tag_ids is not UNSET: - field_dict["tagIds"] = tag_ids + if latitude is not UNSET: + field_dict["latitude"] = latitude + if live_photo_video_id is not UNSET: + field_dict["livePhotoVideoId"] = live_photo_video_id + if longitude is not UNSET: + field_dict["longitude"] = longitude + if rating is not UNSET: + field_dict["rating"] = rating return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + date_time_original = d.pop("dateTimeOriginal", UNSET) + description = d.pop("description", UNSET) is_archived = d.pop("isArchived", UNSET) is_favorite = d.pop("isFavorite", UNSET) - tag_ids = cast(List[str], d.pop("tagIds", UNSET)) + latitude = d.pop("latitude", UNSET) + + def _parse_live_photo_video_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() + live_photo_video_id_type_0 = UUID(data) + + return live_photo_video_id_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + live_photo_video_id = _parse_live_photo_video_id(d.pop("livePhotoVideoId", UNSET)) + + longitude = d.pop("longitude", UNSET) + + rating = d.pop("rating", UNSET) update_asset_dto = cls( + date_time_original=date_time_original, description=description, is_archived=is_archived, is_favorite=is_favorite, - tag_ids=tag_ids, + latitude=latitude, + live_photo_video_id=live_photo_video_id, + longitude=longitude, + rating=rating, ) update_asset_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/update_tag_dto.py b/immich_carddav_sync/immich_client/models/update_library_dto.py similarity index 51% rename from immich_carddav_sync/immich_client/models/update_tag_dto.py rename to immich_carddav_sync/immich_client/models/update_library_dto.py index 4fb2524..3288516 100644 --- a/immich_carddav_sync/immich_client/models/update_tag_dto.py +++ b/immich_carddav_sync/immich_client/models/update_library_dto.py @@ -1,29 +1,45 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +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="UpdateTagDto") +T = TypeVar("T", bound="UpdateLibraryDto") @_attrs_define -class UpdateTagDto: +class UpdateLibraryDto: """ Attributes: + exclusion_patterns (Union[Unset, List[str]]): + import_paths (Union[Unset, List[str]]): name (Union[Unset, str]): """ + exclusion_patterns: Union[Unset, List[str]] = UNSET + import_paths: Union[Unset, List[str]] = UNSET name: Union[Unset, 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 + name = self.name 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 if name is not UNSET: field_dict["name"] = name @@ -32,14 +48,20 @@ def to_dict(self) -> Dict[str, Any]: @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)) + name = d.pop("name", UNSET) - update_tag_dto = cls( + update_library_dto = cls( + exclusion_patterns=exclusion_patterns, + import_paths=import_paths, name=name, ) - update_tag_dto.additional_properties = d - return update_tag_dto + update_library_dto.additional_properties = d + return update_library_dto @property def additional_keys(self) -> List[str]: diff --git a/immich_carddav_sync/immich_client/models/update_partner_dto.py b/immich_carddav_sync/immich_client/models/update_partner_dto.py new file mode 100644 index 0000000..ee005d3 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/update_partner_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="UpdatePartnerDto") + + +@_attrs_define +class UpdatePartnerDto: + """ + Attributes: + in_timeline (bool): + """ + + in_timeline: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + in_timeline = self.in_timeline + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "inTimeline": in_timeline, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + in_timeline = d.pop("inTimeline") + + update_partner_dto = cls( + in_timeline=in_timeline, + ) + + update_partner_dto.additional_properties = d + return update_partner_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_user_dto.py b/immich_carddav_sync/immich_client/models/update_user_dto.py deleted file mode 100644 index 54f7efb..0000000 --- a/immich_carddav_sync/immich_client/models/update_user_dto.py +++ /dev/null @@ -1,132 +0,0 @@ -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="UpdateUserDto") - - -@_attrs_define -class UpdateUserDto: - """ - Attributes: - id (str): - email (Union[Unset, str]): - external_path (Union[Unset, str]): - first_name (Union[Unset, str]): - is_admin (Union[Unset, bool]): - last_name (Union[Unset, str]): - memories_enabled (Union[Unset, bool]): - password (Union[Unset, str]): - should_change_password (Union[Unset, bool]): - storage_label (Union[Unset, str]): - """ - - id: str - email: Union[Unset, str] = UNSET - external_path: Union[Unset, str] = UNSET - first_name: Union[Unset, str] = UNSET - is_admin: Union[Unset, bool] = UNSET - last_name: Union[Unset, str] = UNSET - memories_enabled: Union[Unset, bool] = UNSET - password: Union[Unset, str] = UNSET - should_change_password: Union[Unset, bool] = UNSET - storage_label: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - id = self.id - email = self.email - external_path = self.external_path - first_name = self.first_name - is_admin = self.is_admin - last_name = self.last_name - memories_enabled = self.memories_enabled - password = self.password - should_change_password = self.should_change_password - storage_label = self.storage_label - - field_dict: Dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "id": id, - } - ) - if email is not UNSET: - field_dict["email"] = email - if external_path is not UNSET: - field_dict["externalPath"] = external_path - if first_name is not UNSET: - field_dict["firstName"] = first_name - if is_admin is not UNSET: - field_dict["isAdmin"] = is_admin - if last_name is not UNSET: - field_dict["lastName"] = last_name - if memories_enabled is not UNSET: - field_dict["memoriesEnabled"] = memories_enabled - if password is not UNSET: - field_dict["password"] = password - 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() - id = d.pop("id") - - email = d.pop("email", UNSET) - - external_path = d.pop("externalPath", UNSET) - - first_name = d.pop("firstName", UNSET) - - is_admin = d.pop("isAdmin", UNSET) - - last_name = d.pop("lastName", UNSET) - - memories_enabled = d.pop("memoriesEnabled", UNSET) - - password = d.pop("password", UNSET) - - should_change_password = d.pop("shouldChangePassword", UNSET) - - storage_label = d.pop("storageLabel", UNSET) - - update_user_dto = cls( - id=id, - email=email, - external_path=external_path, - first_name=first_name, - is_admin=is_admin, - last_name=last_name, - memories_enabled=memories_enabled, - password=password, - should_change_password=should_change_password, - storage_label=storage_label, - ) - - update_user_dto.additional_properties = d - return update_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/usage_by_user_dto.py b/immich_carddav_sync/immich_client/models/usage_by_user_dto.py index 0381c06..83ff67b 100644 --- a/immich_carddav_sync/immich_client/models/usage_by_user_dto.py +++ b/immich_carddav_sync/immich_client/models/usage_by_user_dto.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,27 +11,33 @@ class UsageByUserDto: """ Attributes: photos (int): + quota_size_in_bytes (Union[None, int]): usage (int): - user_first_name (str): user_id (str): - user_last_name (str): + user_name (str): videos (int): """ photos: int + quota_size_in_bytes: Union[None, int] usage: int - user_first_name: str user_id: str - user_last_name: str + user_name: str videos: int additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: photos = self.photos + + quota_size_in_bytes: Union[None, int] + quota_size_in_bytes = self.quota_size_in_bytes + usage = self.usage - user_first_name = self.user_first_name + user_id = self.user_id - user_last_name = self.user_last_name + + user_name = self.user_name + videos = self.videos field_dict: Dict[str, Any] = {} @@ -39,10 +45,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update( { "photos": photos, + "quotaSizeInBytes": quota_size_in_bytes, "usage": usage, - "userFirstName": user_first_name, "userId": user_id, - "userLastName": user_last_name, + "userName": user_name, "videos": videos, } ) @@ -54,22 +60,27 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() photos = d.pop("photos") - usage = d.pop("usage") + def _parse_quota_size_in_bytes(data: object) -> Union[None, int]: + if data is None: + return data + return cast(Union[None, int], data) - user_first_name = d.pop("userFirstName") + quota_size_in_bytes = _parse_quota_size_in_bytes(d.pop("quotaSizeInBytes")) + + usage = d.pop("usage") user_id = d.pop("userId") - user_last_name = d.pop("userLastName") + user_name = d.pop("userName") videos = d.pop("videos") usage_by_user_dto = cls( photos=photos, + quota_size_in_bytes=quota_size_in_bytes, usage=usage, - user_first_name=user_first_name, user_id=user_id, - user_last_name=user_last_name, + user_name=user_name, videos=videos, ) diff --git a/immich_carddav_sync/immich_client/models/user_avatar_color.py b/immich_carddav_sync/immich_client/models/user_avatar_color.py new file mode 100644 index 0000000..cd8bf81 --- /dev/null +++ b/immich_carddav_sync/immich_client/models/user_avatar_color.py @@ -0,0 +1,17 @@ +from enum import Enum + + +class UserAvatarColor(str, Enum): + AMBER = "amber" + BLUE = "blue" + GRAY = "gray" + GREEN = "green" + ORANGE = "orange" + PINK = "pink" + PRIMARY = "primary" + PURPLE = "purple" + RED = "red" + YELLOW = "yellow" + + def __str__(self) -> str: + return str(self.value) diff --git a/immich_carddav_sync/immich_client/models/user_response_dto.py b/immich_carddav_sync/immich_client/models/user_response_dto.py index 36530f9..777dc78 100644 --- a/immich_carddav_sync/immich_client/models/user_response_dto.py +++ b/immich_carddav_sync/immich_client/models/user_response_dto.py @@ -1,11 +1,11 @@ import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar, Union +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 -from ..types import UNSET, Unset +from ..models.user_avatar_color import UserAvatarColor T = TypeVar("T", bound="UserResponseDto") @@ -14,132 +14,72 @@ class UserResponseDto: """ Attributes: - created_at (datetime.datetime): + avatar_color (UserAvatarColor): email (str): - first_name (str): id (str): - is_admin (bool): - last_name (str): - oauth_id (str): + name (str): + profile_changed_at (datetime.datetime): profile_image_path (str): - should_change_password (bool): - updated_at (datetime.datetime): - deleted_at (Optional[datetime.datetime]): - external_path (Optional[str]): - memories_enabled (Union[Unset, bool]): - storage_label (Optional[str]): """ - created_at: datetime.datetime + avatar_color: UserAvatarColor email: str - first_name: str id: str - is_admin: bool - last_name: str - oauth_id: str + name: str + profile_changed_at: datetime.datetime profile_image_path: str - should_change_password: bool - updated_at: datetime.datetime - deleted_at: Optional[datetime.datetime] - external_path: Optional[str] - storage_label: Optional[str] - memories_enabled: Union[Unset, bool] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - created_at = self.created_at.isoformat() + avatar_color = self.avatar_color.value email = self.email - first_name = self.first_name + id = self.id - is_admin = self.is_admin - last_name = self.last_name - oauth_id = self.oauth_id - profile_image_path = self.profile_image_path - should_change_password = self.should_change_password - updated_at = self.updated_at.isoformat() - deleted_at = self.deleted_at.isoformat() if self.deleted_at else None + name = self.name + + profile_changed_at = self.profile_changed_at.isoformat() - external_path = self.external_path - memories_enabled = self.memories_enabled - storage_label = self.storage_label + profile_image_path = self.profile_image_path field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { - "createdAt": created_at, + "avatarColor": avatar_color, "email": email, - "firstName": first_name, "id": id, - "isAdmin": is_admin, - "lastName": last_name, - "oauthId": oauth_id, + "name": name, + "profileChangedAt": profile_changed_at, "profileImagePath": profile_image_path, - "shouldChangePassword": should_change_password, - "updatedAt": updated_at, - "deletedAt": deleted_at, - "externalPath": external_path, - "storageLabel": storage_label, } ) - if memories_enabled is not UNSET: - field_dict["memoriesEnabled"] = memories_enabled 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")) + avatar_color = UserAvatarColor(d.pop("avatarColor")) email = d.pop("email") - first_name = d.pop("firstName") - id = d.pop("id") - is_admin = d.pop("isAdmin") - - last_name = d.pop("lastName") + name = d.pop("name") - oauth_id = d.pop("oauthId") + profile_changed_at = isoparse(d.pop("profileChangedAt")) profile_image_path = d.pop("profileImagePath") - should_change_password = d.pop("shouldChangePassword") - - updated_at = isoparse(d.pop("updatedAt")) - - _deleted_at = d.pop("deletedAt") - deleted_at: Optional[datetime.datetime] - if _deleted_at is None: - deleted_at = None - else: - deleted_at = isoparse(_deleted_at) - - external_path = d.pop("externalPath") - - memories_enabled = d.pop("memoriesEnabled", UNSET) - - storage_label = d.pop("storageLabel") - user_response_dto = cls( - created_at=created_at, + avatar_color=avatar_color, email=email, - first_name=first_name, id=id, - is_admin=is_admin, - last_name=last_name, - oauth_id=oauth_id, + name=name, + profile_changed_at=profile_changed_at, profile_image_path=profile_image_path, - should_change_password=should_change_password, - updated_at=updated_at, - deleted_at=deleted_at, - external_path=external_path, - memories_enabled=memories_enabled, - storage_label=storage_label, ) user_response_dto.additional_properties = d diff --git a/immich_carddav_sync/immich_client/models/video_codec.py b/immich_carddav_sync/immich_client/models/video_codec.py index df9585a..abd5170 100644 --- a/immich_carddav_sync/immich_client/models/video_codec.py +++ b/immich_carddav_sync/immich_client/models/video_codec.py @@ -2,6 +2,7 @@ class VideoCodec(str, Enum): + AV1 = "av1" H264 = "h264" HEVC = "hevc" VP9 = "vp9" diff --git a/immich_carddav_sync/immich_client/types.py b/immich_carddav_sync/immich_client/types.py index 15700b8..21fac10 100644 --- a/immich_carddav_sync/immich_client/types.py +++ b/immich_carddav_sync/immich_client/types.py @@ -1,4 +1,5 @@ -""" Contains some shared types for properties """ +"""Contains some shared types for properties""" + from http import HTTPStatus from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar @@ -41,4 +42,4 @@ class Response(Generic[T]): parsed: Optional[T] -__all__ = ["File", "Response", "FileJsonType"] +__all__ = ["File", "Response", "FileJsonType", "Unset", "UNSET"] diff --git a/immich_carddav_sync/main.py b/immich_carddav_sync/main.py index dc7a321..f73a4b6 100644 --- a/immich_carddav_sync/main.py +++ b/immich_carddav_sync/main.py @@ -5,6 +5,7 @@ import aiohttp import aiostream +import uuid import vobject from vdirsyncer.cli import fetchparams @@ -12,7 +13,7 @@ from vdirsyncer.vobject import Item from .immich_client import AuthenticatedClient -from .immich_client.api.person import get_all_people, update_person +from .immich_client.api.people import get_all_people, update_person from .immich_client.models import PeopleResponseDto, PersonResponseDto, PersonUpdateDto @@ -97,7 +98,7 @@ async def set_immich_birth_date(person_id: str, birth_date: str, api_url: str, a logger.debug('PUT /people/%s << {"birthDate":"%s"}', person_id, birth_date) with AuthenticatedClient(base_url=api_url, auth_header_name="X-api-key", prefix="", token=api_key) as client: dto = PersonUpdateDto(birth_date=datetime.date.fromisoformat(birth_date)) - response: PersonResponseDto = await update_person.asyncio(id=person_id, json_body=dto, client=client) + response: PersonResponseDto = await update_person.asyncio(id=uuid.UUID(person_id), body=dto, client=client) if not response or response.birth_date.isoformat() != birth_date: raise RuntimeError("Birth date was not set.")