[CLEANUP] Cleaner API gen (less unneeded stuff)

This commit is contained in:
2026-07-03 20:42:47 +02:00
parent d50345fc64
commit fe08201250
750 changed files with 15316 additions and 100454 deletions
@@ -12,6 +12,7 @@
Do not edit the class manually.
""" # noqa: E501
# import models into model package
from generated.immich.openapi_client.models.activity_create_dto import ActivityCreateDto
from generated.immich.openapi_client.models.activity_response_dto import ActivityResponseDto
@@ -383,4 +384,3 @@ from generated.immich.openapi_client.models.workflow_trigger import WorkflowTrig
from generated.immich.openapi_client.models.workflow_trigger_response_dto import WorkflowTriggerResponseDto
from generated.immich.openapi_client.models.workflow_type import WorkflowType
from generated.immich.openapi_client.models.workflow_update_dto import WorkflowUpdateDto
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.reaction_type import ReactionType
from typing import Optional, Set
from typing_extensions import Self
@@ -28,8 +28,8 @@ class ActivityCreateDto(BaseModel):
"""
Activity create
""" # noqa: E501
album_id: UUID = Field(description="Album ID", alias="albumId")
asset_id: Optional[UUID] = Field(default=None, description="Asset ID (if activity is for an asset)", alias="assetId")
album_id: Annotated[str, Field(strict=True)] = Field(description="Album ID", alias="albumId")
asset_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Asset ID (if activity is for an asset)", alias="assetId")
comment: Optional[StrictStr] = Field(default=None, description="Comment text (required if type is comment)")
type: ReactionType
__properties: ClassVar[List[str]] = ["albumId", "assetId", "comment", "type"]
@@ -18,9 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.reaction_type import ReactionType
from generated.immich.openapi_client.models.user_response_dto import UserResponseDto
from typing import Optional, Set
@@ -30,10 +30,10 @@ class ActivityResponseDto(BaseModel):
"""
ActivityResponseDto
""" # noqa: E501
asset_id: Optional[UUID] = Field(description="Asset ID (if activity is for an asset)", alias="assetId")
asset_id: Optional[Annotated[str, Field(strict=True)]] = Field(description="Asset ID (if activity is for an asset)", alias="assetId")
comment: Optional[StrictStr] = Field(default=None, description="Comment text (for comment activities)")
created_at: datetime = Field(description="Creation date", alias="createdAt")
id: UUID = Field(description="Activity ID")
id: Annotated[str, Field(strict=True)] = Field(description="Activity ID")
type: ReactionType
user: UserResponseDto
__properties: ClassVar[List[str]] = ["assetId", "comment", "createdAt", "id", "type", "user"]
@@ -18,10 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from generated.immich.openapi_client.models.album_user_response_dto import AlbumUserResponseDto
from generated.immich.openapi_client.models.asset_order import AssetOrder
from generated.immich.openapi_client.models.contributor_count_response_dto import ContributorCountResponseDto
@@ -33,7 +32,7 @@ class AlbumResponseDto(BaseModel):
AlbumResponseDto
""" # noqa: E501
album_name: StrictStr = Field(description="Album name", alias="albumName")
album_thumbnail_asset_id: Optional[UUID] = Field(description="Thumbnail asset ID", alias="albumThumbnailAssetId")
album_thumbnail_asset_id: Optional[Annotated[str, Field(strict=True)]] = Field(description="Thumbnail asset ID", alias="albumThumbnailAssetId")
album_users: Annotated[List[AlbumUserResponseDto], Field(min_length=1)] = Field(description="First entry is always the album owner. Second entry is the auth user, if it differs from the owner. The rest are ordered alphabetically.", alias="albumUsers")
asset_count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Number of assets", alias="assetCount")
contributor_counts: Optional[List[ContributorCountResponseDto]] = Field(default=None, alias="contributorCounts")
@@ -41,7 +40,7 @@ class AlbumResponseDto(BaseModel):
description: StrictStr = Field(description="Album description")
end_date: Optional[datetime] = Field(default=None, description="End date (latest asset)", alias="endDate")
has_shared_link: StrictBool = Field(description="Has shared link", alias="hasSharedLink")
id: UUID = Field(description="Album ID")
id: Annotated[str, Field(strict=True)] = Field(description="Album ID")
is_activity_enabled: StrictBool = Field(description="Activity feed enabled", alias="isActivityEnabled")
last_modified_asset_timestamp: Optional[datetime] = Field(default=None, description="Last modified asset timestamp", alias="lastModifiedAssetTimestamp")
order: Optional[AssetOrder] = None
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.album_user_role import AlbumUserRole
from typing import Optional, Set
from typing_extensions import Self
@@ -29,7 +29,7 @@ class AlbumUserAddDto(BaseModel):
AlbumUserAddDto
""" # noqa: E501
role: Optional[AlbumUserRole] = None
user_id: UUID = Field(description="User ID", alias="userId")
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID", alias="userId")
__properties: ClassVar[List[str]] = ["role", "userId"]
@field_validator('user_id')
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.album_user_role import AlbumUserRole
from typing import Optional, Set
from typing_extensions import Self
@@ -29,7 +29,7 @@ class AlbumUserCreateDto(BaseModel):
AlbumUserCreateDto
""" # noqa: E501
role: AlbumUserRole
user_id: UUID = Field(description="User ID", alias="userId")
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID", alias="userId")
__properties: ClassVar[List[str]] = ["role", "userId"]
@field_validator('user_id')
@@ -0,0 +1,91 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
class AlbumsAddAssetsDto(BaseModel):
"""
AlbumsAddAssetsDto
""" # noqa: E501
album_ids: List[UUID] = Field(description="Album IDs", alias="albumIds")
asset_ids: List[UUID] = Field(description="Asset IDs", alias="assetIds")
__properties: ClassVar[List[str]] = ["albumIds", "assetIds"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AlbumsAddAssetsDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AlbumsAddAssetsDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"albumIds": obj.get("albumIds"),
"assetIds": obj.get("assetIds")
})
return _obj
@@ -0,0 +1,90 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from generated.immich.openapi_client.models.bulk_id_error_reason import BulkIdErrorReason
from typing import Optional, Set
from typing_extensions import Self
class AlbumsAddAssetsResponseDto(BaseModel):
"""
AlbumsAddAssetsResponseDto
""" # noqa: E501
error: Optional[BulkIdErrorReason] = None
success: StrictBool = Field(description="Operation success")
__properties: ClassVar[List[str]] = ["error", "success"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AlbumsAddAssetsResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AlbumsAddAssetsResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"error": obj.get("error"),
"success": obj.get("success")
})
return _obj
@@ -0,0 +1,88 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.asset_order import AssetOrder
from typing import Optional, Set
from typing_extensions import Self
class AlbumsResponse(BaseModel):
"""
AlbumsResponse
""" # noqa: E501
default_asset_order: AssetOrder = Field(alias="defaultAssetOrder")
__properties: ClassVar[List[str]] = ["defaultAssetOrder"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AlbumsResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AlbumsResponse from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"defaultAssetOrder": obj.get("defaultAssetOrder")
})
return _obj
@@ -0,0 +1,88 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from generated.immich.openapi_client.models.asset_order import AssetOrder
from typing import Optional, Set
from typing_extensions import Self
class AlbumsUpdate(BaseModel):
"""
Album preferences
""" # noqa: E501
default_asset_order: Optional[AssetOrder] = Field(default=None, alias="defaultAssetOrder")
__properties: ClassVar[List[str]] = ["defaultAssetOrder"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AlbumsUpdate from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AlbumsUpdate from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"defaultAssetOrder": obj.get("defaultAssetOrder")
})
return _obj
@@ -18,9 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.permission import Permission
from typing import Optional, Set
from typing_extensions import Self
@@ -30,7 +30,7 @@ class ApiKeyResponseDto(BaseModel):
ApiKeyResponseDto
""" # noqa: E501
created_at: datetime = Field(description="Creation date", alias="createdAt")
id: UUID = Field(description="API key ID")
id: Annotated[str, Field(strict=True)] = Field(description="API key ID")
name: StrictStr = Field(description="API key name")
permissions: List[Permission] = Field(description="List of permissions")
updated_at: datetime = Field(description="Last update date", alias="updatedAt")
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -28,7 +28,7 @@ class AssetBulkDeleteDto(BaseModel):
AssetBulkDeleteDto
""" # noqa: E501
force: Optional[StrictBool] = Field(default=None, description="Force delete even if in use")
ids: List[UUID] = Field(description="IDs to process")
ids: List[Annotated[str, Field(strict=True)]] = Field(description="IDs to process")
__properties: ClassVar[List[str]] = ["force", "ids"]
model_config = ConfigDict(
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from uuid import UUID
from generated.immich.openapi_client.models.asset_visibility import AssetVisibility
from typing import Optional, Set
from typing_extensions import Self
@@ -33,7 +32,7 @@ class AssetBulkUpdateDto(BaseModel):
date_time_relative: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]] = Field(default=None, description="Relative time offset in minutes", alias="dateTimeRelative")
description: Optional[StrictStr] = Field(default=None, description="Asset description")
duplicate_id: Optional[StrictStr] = Field(default=None, description="Duplicate ID", alias="duplicateId")
ids: List[UUID] = Field(description="Asset IDs to update")
ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs to update")
is_favorite: Optional[StrictBool] = Field(default=None, description="Mark as favorite", alias="isFavorite")
latitude: Optional[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]]] = Field(default=None, description="Latitude coordinate")
longitude: Optional[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]]] = Field(default=None, description="Longitude coordinate")
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_reject_reason import AssetRejectReason
from generated.immich.openapi_client.models.asset_upload_action import AssetUploadAction
from typing import Optional, Set
@@ -30,7 +30,7 @@ class AssetBulkUploadCheckResult(BaseModel):
AssetBulkUploadCheckResult
""" # noqa: E501
action: AssetUploadAction
asset_id: Optional[UUID] = Field(default=None, description="Existing asset ID if duplicate", alias="assetId")
asset_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Existing asset ID if duplicate", alias="assetId")
id: StrictStr = Field(description="Client-side identifier echoed from the request to match results to inputs")
is_trashed: Optional[StrictBool] = Field(default=None, description="Whether existing asset is trashed", alias="isTrashed")
reason: Optional[AssetRejectReason] = None
@@ -0,0 +1,114 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class AssetCopyDto(BaseModel):
"""
AssetCopyDto
""" # noqa: E501
albums: Optional[StrictBool] = Field(default=True, description="Copy album associations")
favorite: Optional[StrictBool] = Field(default=True, description="Copy favorite status")
shared_links: Optional[StrictBool] = Field(default=True, description="Copy shared links", alias="sharedLinks")
sidecar: Optional[StrictBool] = Field(default=True, description="Copy sidecar file")
source_id: Annotated[str, Field(strict=True)] = Field(description="Source asset ID", alias="sourceId")
stack: Optional[StrictBool] = Field(default=True, description="Copy stack association")
target_id: Annotated[str, Field(strict=True)] = Field(description="Target asset ID", alias="targetId")
__properties: ClassVar[List[str]] = ["albums", "favorite", "sharedLinks", "sidecar", "sourceId", "stack", "targetId"]
@field_validator('source_id')
def source_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
@field_validator('target_id')
def target_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetCopyDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetCopyDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"albums": obj.get("albums") if obj.get("albums") is not None else True,
"favorite": obj.get("favorite") if obj.get("favorite") is not None else True,
"sharedLinks": obj.get("sharedLinks") if obj.get("sharedLinks") is not None else True,
"sidecar": obj.get("sidecar") if obj.get("sidecar") is not None else True,
"sourceId": obj.get("sourceId"),
"stack": obj.get("stack") if obj.get("stack") is not None else True,
"targetId": obj.get("targetId")
})
return _obj
@@ -0,0 +1,38 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetEditAction(str, Enum):
"""
Type of edit action to perform
"""
"""
allowed enum values
"""
CROP = 'crop'
ROTATE = 'rotate'
MIRROR = 'mirror'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetEditAction from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,94 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.asset_edit_action import AssetEditAction
from generated.immich.openapi_client.models.asset_edit_action_item_dto_parameters import AssetEditActionItemDtoParameters
from typing import Optional, Set
from typing_extensions import Self
class AssetEditActionItemDto(BaseModel):
"""
AssetEditActionItemDto
""" # noqa: E501
action: AssetEditAction
parameters: AssetEditActionItemDtoParameters
__properties: ClassVar[List[str]] = ["action", "parameters"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetEditActionItemDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of parameters
if self.parameters:
_dict['parameters'] = self.parameters.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetEditActionItemDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"action": obj.get("action"),
"parameters": AssetEditActionItemDtoParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None
})
return _obj
@@ -0,0 +1,149 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Optional
from generated.immich.openapi_client.models.crop_parameters import CropParameters
from generated.immich.openapi_client.models.mirror_parameters import MirrorParameters
from generated.immich.openapi_client.models.rotate_parameters import RotateParameters
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import Field
ASSETEDITACTIONITEMDTOPARAMETERS_ANY_OF_SCHEMAS = ["CropParameters", "MirrorParameters", "RotateParameters"]
class AssetEditActionItemDtoParameters(BaseModel):
"""
List of edit actions to apply (crop, rotate, or mirror)
"""
# data type: CropParameters
anyof_schema_1_validator: Optional[CropParameters] = None
# data type: RotateParameters
anyof_schema_2_validator: Optional[RotateParameters] = None
# data type: MirrorParameters
anyof_schema_3_validator: Optional[MirrorParameters] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[CropParameters, MirrorParameters, RotateParameters]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "CropParameters", "MirrorParameters", "RotateParameters" }
model_config = {
"validate_assignment": True,
"protected_namespaces": (),
}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
instance = AssetEditActionItemDtoParameters.model_construct()
error_messages = []
# validate data type: CropParameters
if not isinstance(v, CropParameters):
error_messages.append(f"Error! Input type `{type(v)}` is not `CropParameters`")
else:
return v
# validate data type: RotateParameters
if not isinstance(v, RotateParameters):
error_messages.append(f"Error! Input type `{type(v)}` is not `RotateParameters`")
else:
return v
# validate data type: MirrorParameters
if not isinstance(v, MirrorParameters):
error_messages.append(f"Error! Input type `{type(v)}` is not `MirrorParameters`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in AssetEditActionItemDtoParameters with anyOf schemas: CropParameters, MirrorParameters, RotateParameters. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
error_messages = []
# anyof_schema_1_validator: Optional[CropParameters] = None
try:
instance.actual_instance = CropParameters.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[RotateParameters] = None
try:
instance.actual_instance = RotateParameters.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_3_validator: Optional[MirrorParameters] = None
try:
instance.actual_instance = MirrorParameters.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into AssetEditActionItemDtoParameters with anyOf schemas: CropParameters, MirrorParameters, RotateParameters. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], CropParameters, MirrorParameters, RotateParameters]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
return self.actual_instance.to_dict()
else:
return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
@@ -0,0 +1,104 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_edit_action import AssetEditAction
from generated.immich.openapi_client.models.asset_edit_action_item_dto_parameters import AssetEditActionItemDtoParameters
from typing import Optional, Set
from typing_extensions import Self
class AssetEditActionItemResponseDto(BaseModel):
"""
AssetEditActionItemResponseDto
""" # noqa: E501
action: AssetEditAction
id: Annotated[str, Field(strict=True)] = Field(description="Asset edit ID")
parameters: AssetEditActionItemDtoParameters
__properties: ClassVar[List[str]] = ["action", "id", "parameters"]
@field_validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetEditActionItemResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of parameters
if self.parameters:
_dict['parameters'] = self.parameters.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetEditActionItemResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"action": obj.get("action"),
"id": obj.get("id"),
"parameters": AssetEditActionItemDtoParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None
})
return _obj
@@ -0,0 +1,96 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_edit_action_item_dto import AssetEditActionItemDto
from typing import Optional, Set
from typing_extensions import Self
class AssetEditsCreateDto(BaseModel):
"""
AssetEditsCreateDto
""" # noqa: E501
edits: Annotated[List[AssetEditActionItemDto], Field(min_length=1)] = Field(description="List of edit actions to apply (crop, rotate, or mirror)")
__properties: ClassVar[List[str]] = ["edits"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetEditsCreateDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in edits (list)
_items = []
if self.edits:
for _item_edits in self.edits:
if _item_edits:
_items.append(_item_edits.to_dict())
_dict['edits'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetEditsCreateDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"edits": [AssetEditActionItemDto.from_dict(_item) for _item in obj["edits"]] if obj.get("edits") is not None else None
})
return _obj
@@ -0,0 +1,105 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_edit_action_item_response_dto import AssetEditActionItemResponseDto
from typing import Optional, Set
from typing_extensions import Self
class AssetEditsResponseDto(BaseModel):
"""
AssetEditsResponseDto
""" # noqa: E501
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID these edits belong to", alias="assetId")
edits: List[AssetEditActionItemResponseDto] = Field(description="List of edit actions applied to the asset")
__properties: ClassVar[List[str]] = ["assetId", "edits"]
@field_validator('asset_id')
def asset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetEditsResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in edits (list)
_items = []
if self.edits:
for _item_edits in self.edits:
if _item_edits:
_items.append(_item_edits.to_dict())
_dict['edits'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetEditsResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetId": obj.get("assetId"),
"edits": [AssetEditActionItemResponseDto.from_dict(_item) for _item in obj["edits"]] if obj.get("edits") is not None else None
})
return _obj
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -28,11 +27,11 @@ class AssetFaceCreateDto(BaseModel):
"""
AssetFaceCreateDto
""" # noqa: E501
asset_id: UUID = Field(description="Asset ID", alias="assetId")
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
height: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Face bounding box height")
image_height: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Image height in pixels", alias="imageHeight")
image_width: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Image width in pixels", alias="imageWidth")
person_id: UUID = Field(description="Person ID", alias="personId")
person_id: Annotated[str, Field(strict=True)] = Field(description="Person ID", alias="personId")
width: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Face bounding box width")
x: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Face bounding box X coordinate")
y: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Face bounding box Y coordinate")
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from generated.immich.openapi_client.models.person_response_dto import PersonResponseDto
from generated.immich.openapi_client.models.source_type import SourceType
from typing import Optional, Set
@@ -34,7 +33,7 @@ class AssetFaceResponseDto(BaseModel):
bounding_box_x2: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Bounding box X2 coordinate", alias="boundingBoxX2")
bounding_box_y1: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Bounding box Y1 coordinate", alias="boundingBoxY1")
bounding_box_y2: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Bounding box Y2 coordinate", alias="boundingBoxY2")
id: UUID = Field(description="Face ID")
id: Annotated[str, Field(strict=True)] = Field(description="Face ID")
image_height: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Image height in pixels", alias="imageHeight")
image_width: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Image width in pixels", alias="imageWidth")
person: Optional[PersonResponseDto]
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -27,8 +27,8 @@ class AssetFaceUpdateItem(BaseModel):
"""
AssetFaceUpdateItem
""" # noqa: E501
asset_id: UUID = Field(description="Asset ID", alias="assetId")
person_id: UUID = Field(description="Person ID", alias="personId")
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
person_id: Annotated[str, Field(strict=True)] = Field(description="Person ID", alias="personId")
__properties: ClassVar[List[str]] = ["assetId", "personId"]
@field_validator('asset_id')
@@ -0,0 +1,38 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetIdErrorReason(str, Enum):
"""
Error reason if failed
"""
"""
allowed enum values
"""
DUPLICATE = 'duplicate'
NO_PERMISSION = 'no_permission'
NOT_FOUND = 'not_found'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetIdErrorReason from a JSON string"""
return cls(json.loads(json_str))
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -27,7 +27,7 @@ class AssetIdsDto(BaseModel):
"""
AssetIdsDto
""" # noqa: E501
asset_ids: List[UUID] = Field(description="Asset IDs", alias="assetIds")
asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs", alias="assetIds")
__properties: ClassVar[List[str]] = ["assetIds"]
model_config = ConfigDict(
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_id_error_reason import AssetIdErrorReason
from typing import Optional, Set
from typing_extensions import Self
@@ -28,7 +28,7 @@ class AssetIdsResponseDto(BaseModel):
"""
AssetIdsResponseDto
""" # noqa: E501
asset_id: UUID = Field(description="Asset ID", alias="assetId")
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
error: Optional[AssetIdErrorReason] = None
success: StrictBool = Field(description="Whether operation succeeded")
__properties: ClassVar[List[str]] = ["assetId", "error", "success"]
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_job_name import AssetJobName
from typing import Optional, Set
from typing_extensions import Self
@@ -28,7 +28,7 @@ class AssetJobsDto(BaseModel):
"""
AssetJobsDto
""" # noqa: E501
asset_ids: List[UUID] = Field(description="Asset IDs", alias="assetIds")
asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs", alias="assetIds")
name: AssetJobName
__properties: ClassVar[List[str]] = ["assetIds", "name"]
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_media_status import AssetMediaStatus
from typing import Optional, Set
from typing_extensions import Self
@@ -28,7 +28,7 @@ class AssetMediaResponseDto(BaseModel):
"""
AssetMediaResponseDto
""" # noqa: E501
id: UUID = Field(description="Asset media ID")
id: Annotated[str, Field(strict=True)] = Field(description="Asset media ID")
status: AssetMediaStatus
__properties: ClassVar[List[str]] = ["id", "status"]
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.asset_metadata_bulk_delete_item_dto import AssetMetadataBulkDeleteItemDto
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataBulkDeleteDto(BaseModel):
"""
AssetMetadataBulkDeleteDto
""" # noqa: E501
items: List[AssetMetadataBulkDeleteItemDto] = Field(description="Metadata items to delete")
__properties: ClassVar[List[str]] = ["items"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkDeleteDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
_items = []
if self.items:
for _item_items in self.items:
if _item_items:
_items.append(_item_items.to_dict())
_dict['items'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkDeleteDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"items": [AssetMetadataBulkDeleteItemDto.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
})
return _obj
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataBulkDeleteItemDto(BaseModel):
"""
AssetMetadataBulkDeleteItemDto
""" # noqa: E501
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
key: StrictStr = Field(description="Metadata key")
__properties: ClassVar[List[str]] = ["assetId", "key"]
@field_validator('asset_id')
def asset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkDeleteItemDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkDeleteItemDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetId": obj.get("assetId"),
"key": obj.get("key")
})
return _obj
@@ -0,0 +1,109 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataBulkResponseDto(BaseModel):
"""
AssetMetadataBulkResponseDto
""" # noqa: E501
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
key: StrictStr = Field(description="Metadata key")
updated_at: datetime = Field(description="Last update date", alias="updatedAt")
value: Dict[str, Any] = Field(description="Metadata value (object)")
__properties: ClassVar[List[str]] = ["assetId", "key", "updatedAt", "value"]
@field_validator('asset_id')
def asset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
@field_validator('updated_at')
def updated_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetId": obj.get("assetId"),
"key": obj.get("key"),
"updatedAt": obj.get("updatedAt"),
"value": obj.get("value")
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.asset_metadata_bulk_upsert_item_dto import AssetMetadataBulkUpsertItemDto
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataBulkUpsertDto(BaseModel):
"""
AssetMetadataBulkUpsertDto
""" # noqa: E501
items: List[AssetMetadataBulkUpsertItemDto] = Field(description="Metadata items to upsert")
__properties: ClassVar[List[str]] = ["items"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkUpsertDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
_items = []
if self.items:
for _item_items in self.items:
if _item_items:
_items.append(_item_items.to_dict())
_dict['items'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkUpsertDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"items": [AssetMetadataBulkUpsertItemDto.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataBulkUpsertItemDto(BaseModel):
"""
AssetMetadataBulkUpsertItemDto
""" # noqa: E501
asset_id: Annotated[str, Field(strict=True)] = Field(description="Asset ID", alias="assetId")
key: StrictStr = Field(description="Metadata key")
value: Dict[str, Any] = Field(description="Metadata value (object)")
__properties: ClassVar[List[str]] = ["assetId", "key", "value"]
@field_validator('asset_id')
def asset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkUpsertItemDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataBulkUpsertItemDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetId": obj.get("assetId"),
"key": obj.get("key"),
"value": obj.get("value")
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataResponseDto(BaseModel):
"""
AssetMetadataResponseDto
""" # noqa: E501
key: StrictStr = Field(description="Metadata key")
updated_at: datetime = Field(description="Last update date", alias="updatedAt")
value: Dict[str, Any] = Field(description="Metadata value (object)")
__properties: ClassVar[List[str]] = ["key", "updatedAt", "value"]
@field_validator('updated_at')
def updated_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"key": obj.get("key"),
"updatedAt": obj.get("updatedAt"),
"value": obj.get("value")
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.asset_metadata_upsert_item_dto import AssetMetadataUpsertItemDto
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataUpsertDto(BaseModel):
"""
AssetMetadataUpsertDto
""" # noqa: E501
items: List[AssetMetadataUpsertItemDto] = Field(description="Metadata items to upsert")
__properties: ClassVar[List[str]] = ["items"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataUpsertDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
_items = []
if self.items:
for _item_items in self.items:
if _item_items:
_items.append(_item_items.to_dict())
_dict['items'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataUpsertDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"items": [AssetMetadataUpsertItemDto.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
})
return _obj
@@ -0,0 +1,89 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class AssetMetadataUpsertItemDto(BaseModel):
"""
AssetMetadataUpsertItemDto
""" # noqa: E501
key: StrictStr = Field(description="Metadata key")
value: Dict[str, Any] = Field(description="Metadata value (object)")
__properties: ClassVar[List[str]] = ["key", "value"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetMetadataUpsertItemDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetMetadataUpsertItemDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"key": obj.get("key"),
"value": obj.get("value")
})
return _obj
@@ -0,0 +1,126 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Union
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class AssetOcrResponseDto(BaseModel):
"""
AssetOcrResponseDto
""" # noqa: E501
asset_id: Annotated[str, Field(strict=True)] = Field(alias="assetId")
box_score: Union[StrictFloat, StrictInt] = Field(description="Confidence score for text detection box", alias="boxScore")
id: Annotated[str, Field(strict=True)]
text: StrictStr = Field(description="Recognized text")
text_score: Union[StrictFloat, StrictInt] = Field(description="Confidence score for text recognition", alias="textScore")
x1: Union[StrictFloat, StrictInt] = Field(description="Normalized x coordinate of box corner 1 (0-1)")
x2: Union[StrictFloat, StrictInt] = Field(description="Normalized x coordinate of box corner 2 (0-1)")
x3: Union[StrictFloat, StrictInt] = Field(description="Normalized x coordinate of box corner 3 (0-1)")
x4: Union[StrictFloat, StrictInt] = Field(description="Normalized x coordinate of box corner 4 (0-1)")
y1: Union[StrictFloat, StrictInt] = Field(description="Normalized y coordinate of box corner 1 (0-1)")
y2: Union[StrictFloat, StrictInt] = Field(description="Normalized y coordinate of box corner 2 (0-1)")
y3: Union[StrictFloat, StrictInt] = Field(description="Normalized y coordinate of box corner 3 (0-1)")
y4: Union[StrictFloat, StrictInt] = Field(description="Normalized y coordinate of box corner 4 (0-1)")
__properties: ClassVar[List[str]] = ["assetId", "boxScore", "id", "text", "textScore", "x1", "x2", "x3", "x4", "y1", "y2", "y3", "y4"]
@field_validator('asset_id')
def asset_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
@field_validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AssetOcrResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AssetOcrResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetId": obj.get("assetId"),
"boxScore": obj.get("boxScore"),
"id": obj.get("id"),
"text": obj.get("text"),
"textScore": obj.get("textScore"),
"x1": obj.get("x1"),
"x2": obj.get("x2"),
"x3": obj.get("x3"),
"x4": obj.get("x4"),
"y1": obj.get("y1"),
"y2": obj.get("y2"),
"y3": obj.get("y3"),
"y4": obj.get("y4")
})
return _obj
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetOrderBy(str, Enum):
"""
Asset sorting property
"""
"""
allowed enum values
"""
TAKENAT = 'takenAt'
CREATEDAT = 'createdAt'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetOrderBy from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetRejectReason(str, Enum):
"""
Rejection reason if rejected
"""
"""
allowed enum values
"""
DUPLICATE = 'duplicate'
UNSUPPORTED_MINUS_FORMAT = 'unsupported-format'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetRejectReason from a JSON string"""
return cls(json.loads(json_str))
@@ -18,10 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from generated.immich.openapi_client.models.asset_stack_response_dto import AssetStackResponseDto
from generated.immich.openapi_client.models.asset_type_enum import AssetTypeEnum
from generated.immich.openapi_client.models.asset_visibility import AssetVisibility
@@ -38,27 +37,27 @@ class AssetResponseDto(BaseModel):
""" # noqa: E501
checksum: StrictStr = Field(description="Base64 encoded SHA1 hash")
created_at: datetime = Field(description="The UTC timestamp when the asset was originally uploaded to Immich.", alias="createdAt")
duplicate_id: Optional[UUID] = Field(default=None, description="Duplicate group ID", alias="duplicateId")
duplicate_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Duplicate group ID", alias="duplicateId")
duration: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=0)]] = Field(description="Video/gif duration in milliseconds (null for static images)")
exif_info: Optional[ExifResponseDto] = Field(default=None, alias="exifInfo")
file_created_at: datetime = Field(description="The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken.", alias="fileCreatedAt")
file_modified_at: datetime = Field(description="The UTC timestamp when the file was last modified on the filesystem. This reflects the last time the physical file was changed, which may be different from when the photo was originally taken.", alias="fileModifiedAt")
has_metadata: StrictBool = Field(description="Whether asset has metadata", alias="hasMetadata")
height: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]] = Field(description="Asset height")
id: UUID = Field(description="Asset ID")
id: Annotated[str, Field(strict=True)] = Field(description="Asset ID")
is_archived: StrictBool = Field(description="Is archived", alias="isArchived")
is_edited: StrictBool = Field(description="Is edited", alias="isEdited")
is_favorite: StrictBool = Field(description="Is favorite", alias="isFavorite")
is_offline: StrictBool = Field(description="Is offline", alias="isOffline")
is_trashed: StrictBool = Field(description="Is trashed", alias="isTrashed")
library_id: Optional[UUID] = Field(default=None, description="Library ID", alias="libraryId")
library_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Library ID", alias="libraryId")
live_photo_video_id: Optional[StrictStr] = Field(default=None, description="Live photo video ID", alias="livePhotoVideoId")
local_date_time: datetime = Field(description="The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months.", alias="localDateTime")
original_file_name: StrictStr = Field(description="Original file name", alias="originalFileName")
original_mime_type: Optional[StrictStr] = Field(default=None, description="Original MIME type", alias="originalMimeType")
original_path: StrictStr = Field(description="Original file path", alias="originalPath")
owner: Optional[UserResponseDto] = None
owner_id: UUID = Field(description="Owner user ID", alias="ownerId")
owner_id: Annotated[str, Field(strict=True)] = Field(description="Owner user ID", alias="ownerId")
people: Optional[List[PersonResponseDto]] = None
resized: Optional[StrictBool] = Field(default=None, description="Is resized")
stack: Optional[AssetStackResponseDto] = None
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -29,8 +28,8 @@ class AssetStackResponseDto(BaseModel):
AssetStackResponseDto
""" # noqa: E501
asset_count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Number of assets in stack", alias="assetCount")
id: UUID = Field(description="Stack ID")
primary_asset_id: UUID = Field(description="Primary asset ID", alias="primaryAssetId")
id: Annotated[str, Field(strict=True)] = Field(description="Stack ID")
primary_asset_id: Annotated[str, Field(strict=True)] = Field(description="Primary asset ID", alias="primaryAssetId")
__properties: ClassVar[List[str]] = ["assetCount", "id", "primaryAssetId"]
@field_validator('id')
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetUploadAction(str, Enum):
"""
Upload action
"""
"""
allowed enum values
"""
ACCEPT = 'accept'
REJECT = 'reject'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetUploadAction from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,39 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class AssetVisibility(str, Enum):
"""
Asset visibility
"""
"""
allowed enum values
"""
ARCHIVE = 'archive'
TIMELINE = 'timeline'
HIDDEN = 'hidden'
LOCKED = 'locked'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssetVisibility from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class AuthStatusResponseDto(BaseModel):
"""
AuthStatusResponseDto
""" # noqa: E501
expires_at: Optional[StrictStr] = Field(default=None, description="Session expiration date", alias="expiresAt")
is_elevated: StrictBool = Field(description="Is elevated session", alias="isElevated")
password: StrictBool = Field(description="Has password set")
pin_code: StrictBool = Field(description="Has PIN code set", alias="pinCode")
pin_expires_at: Optional[StrictStr] = Field(default=None, description="PIN expiration date", alias="pinExpiresAt")
__properties: ClassVar[List[str]] = ["expiresAt", "isElevated", "password", "pinCode", "pinExpiresAt"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AuthStatusResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AuthStatusResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"expiresAt": obj.get("expiresAt"),
"isElevated": obj.get("isElevated"),
"password": obj.get("password"),
"pinCode": obj.get("pinCode"),
"pinExpiresAt": obj.get("pinExpiresAt")
})
return _obj
@@ -0,0 +1,40 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class BulkIdErrorReason(str, Enum):
"""
Error reason
"""
"""
allowed enum values
"""
DUPLICATE = 'duplicate'
NO_PERMISSION = 'no_permission'
NOT_FOUND = 'not_found'
UNKNOWN = 'unknown'
VALIDATION = 'validation'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of BulkIdErrorReason from a JSON string"""
return cls(json.loads(json_str))
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.bulk_id_error_reason import BulkIdErrorReason
from typing import Optional, Set
from typing_extensions import Self
@@ -30,7 +30,7 @@ class BulkIdResponseDto(BaseModel):
""" # noqa: E501
error: Optional[BulkIdErrorReason] = None
error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
id: UUID = Field(description="ID")
id: Annotated[str, Field(strict=True)] = Field(description="ID")
success: StrictBool = Field(description="Whether operation succeeded")
__properties: ClassVar[List[str]] = ["error", "errorMessage", "id", "success"]
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -27,7 +27,7 @@ class BulkIdsDto(BaseModel):
"""
BulkIdsDto
""" # noqa: E501
ids: List[UUID] = Field(description="IDs to process")
ids: List[Annotated[str, Field(strict=True)]] = Field(description="IDs to process")
__properties: ClassVar[List[str]] = ["ids"]
model_config = ConfigDict(
@@ -0,0 +1,102 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.calendar_heatmap_response_dto_series_inner import CalendarHeatmapResponseDtoSeriesInner
from typing import Optional, Set
from typing_extensions import Self
class CalendarHeatmapResponseDto(BaseModel):
"""
CalendarHeatmapResponseDto
""" # noqa: E501
var_from: StrictStr = Field(description="Start date in UTC", alias="from")
series: List[CalendarHeatmapResponseDtoSeriesInner]
to: StrictStr = Field(description="End date in UTC")
total_count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Total activity count over the period", alias="totalCount")
__properties: ClassVar[List[str]] = ["from", "series", "to", "totalCount"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CalendarHeatmapResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in series (list)
_items = []
if self.series:
for _item_series in self.series:
if _item_series:
_items.append(_item_series.to_dict())
_dict['series'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CalendarHeatmapResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"from": obj.get("from"),
"series": [CalendarHeatmapResponseDtoSeriesInner.from_dict(_item) for _item in obj["series"]] if obj.get("series") is not None else None,
"to": obj.get("to"),
"totalCount": obj.get("totalCount")
})
return _obj
@@ -0,0 +1,90 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class CalendarHeatmapResponseDtoSeriesInner(BaseModel):
"""
CalendarHeatmapResponseDtoSeriesInner
""" # noqa: E501
count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Activity count")
var_date: StrictStr = Field(description="Date in UTC", alias="date")
__properties: ClassVar[List[str]] = ["count", "date"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CalendarHeatmapResponseDtoSeriesInner from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CalendarHeatmapResponseDtoSeriesInner from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"count": obj.get("count"),
"date": obj.get("date")
})
return _obj
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class CalendarHeatmapType(str, Enum):
"""
Type of calendar heatmap
"""
"""
allowed enum values
"""
UPLOAD = 'Upload'
TAKEN = 'Taken'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of CalendarHeatmapType from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class CastResponse(BaseModel):
"""
CastResponse
""" # noqa: E501
g_cast_enabled: StrictBool = Field(description="Whether Google Cast is enabled", alias="gCastEnabled")
__properties: ClassVar[List[str]] = ["gCastEnabled"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CastResponse from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CastResponse from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"gCastEnabled": obj.get("gCastEnabled")
})
return _obj
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class CastUpdate(BaseModel):
"""
CastUpdate
""" # noqa: E501
g_cast_enabled: Optional[StrictBool] = Field(default=None, description="Whether Google Cast is enabled", alias="gCastEnabled")
__properties: ClassVar[List[str]] = ["gCastEnabled"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CastUpdate from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CastUpdate from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"gCastEnabled": obj.get("gCastEnabled")
})
return _obj
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class ContributorCountResponseDto(BaseModel):
"""
ContributorCountResponseDto
""" # noqa: E501
asset_count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Number of assets contributed", alias="assetCount")
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID", alias="userId")
__properties: ClassVar[List[str]] = ["assetCount", "userId"]
@field_validator('user_id')
def user_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ContributorCountResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ContributorCountResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetCount": obj.get("assetCount"),
"userId": obj.get("userId")
})
return _obj
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.album_user_create_dto import AlbumUserCreateDto
from typing import Optional, Set
from typing_extensions import Self
@@ -30,7 +30,7 @@ class CreateAlbumDto(BaseModel):
""" # noqa: E501
album_name: StrictStr = Field(description="Album name", alias="albumName")
album_users: Optional[List[AlbumUserCreateDto]] = Field(default=None, description="Album users", alias="albumUsers")
asset_ids: Optional[List[UUID]] = Field(default=None, description="Initial asset IDs", alias="assetIds")
asset_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Initial asset IDs", alias="assetIds")
description: Optional[StrictStr] = Field(default=None, description="Album description")
__properties: ClassVar[List[str]] = ["albumName", "albumUsers", "assetIds", "description"]
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -31,7 +30,7 @@ class CreateLibraryDto(BaseModel):
exclusion_patterns: Optional[Annotated[List[StrictStr], Field(max_length=128)]] = Field(default=None, description="Exclusion patterns (max 128)", alias="exclusionPatterns")
import_paths: Optional[Annotated[List[StrictStr], Field(max_length=128)]] = Field(default=None, description="Import paths (max 128)", alias="importPaths")
name: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Library name")
owner_id: UUID = Field(description="Owner user ID", alias="ownerId")
owner_id: Annotated[str, Field(strict=True)] = Field(description="Owner user ID", alias="ownerId")
__properties: ClassVar[List[str]] = ["exclusionPatterns", "importPaths", "name", "ownerId"]
@field_validator('owner_id')
@@ -18,9 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -30,7 +30,7 @@ class CreateProfileImageResponseDto(BaseModel):
""" # noqa: E501
profile_changed_at: datetime = Field(description="Profile image change date", alias="profileChangedAt")
profile_image_path: StrictStr = Field(description="Profile image file path", alias="profileImagePath")
user_id: UUID = Field(description="User ID", alias="userId")
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID", alias="userId")
__properties: ClassVar[List[str]] = ["profileChangedAt", "profileImagePath", "userId"]
@field_validator('profile_changed_at')
@@ -0,0 +1,94 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class CropParameters(BaseModel):
"""
CropParameters
""" # noqa: E501
height: Annotated[int, Field(le=9007199254740991, strict=True, ge=1)] = Field(description="Height of the crop")
width: Annotated[int, Field(le=9007199254740991, strict=True, ge=1)] = Field(description="Width of the crop")
x: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Top-Left X coordinate of crop")
y: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Top-Left Y coordinate of crop")
__properties: ClassVar[List[str]] = ["height", "width", "x", "y"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CropParameters from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CropParameters from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"height": obj.get("height"),
"width": obj.get("width"),
"x": obj.get("x"),
"y": obj.get("y")
})
return _obj
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class DatabaseBackupDeleteDto(BaseModel):
"""
DatabaseBackupDeleteDto
""" # noqa: E501
backups: List[StrictStr] = Field(description="Backup filenames to delete")
__properties: ClassVar[List[str]] = ["backups"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DatabaseBackupDeleteDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DatabaseBackupDeleteDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"backups": obj.get("backups")
})
return _obj
@@ -0,0 +1,92 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class DatabaseBackupDto(BaseModel):
"""
DatabaseBackupDto
""" # noqa: E501
filename: StrictStr = Field(description="Backup filename")
filesize: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Backup file size")
timezone: StrictStr = Field(description="Backup timezone")
__properties: ClassVar[List[str]] = ["filename", "filesize", "timezone"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DatabaseBackupDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DatabaseBackupDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"filename": obj.get("filename"),
"filesize": obj.get("filesize"),
"timezone": obj.get("timezone")
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.database_backup_dto import DatabaseBackupDto
from typing import Optional, Set
from typing_extensions import Self
class DatabaseBackupListResponseDto(BaseModel):
"""
DatabaseBackupListResponseDto
""" # noqa: E501
backups: List[DatabaseBackupDto] = Field(description="List of backups")
__properties: ClassVar[List[str]] = ["backups"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DatabaseBackupListResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in backups (list)
_items = []
if self.backups:
for _item_backups in self.backups:
if _item_backups:
_items.append(_item_backups.to_dict())
_dict['backups'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DatabaseBackupListResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"backups": [DatabaseBackupDto.from_dict(_item) for _item in obj["backups"]] if obj.get("backups") is not None else None
})
return _obj
@@ -0,0 +1,90 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class DownloadArchiveDto(BaseModel):
"""
DownloadArchiveDto
""" # noqa: E501
asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs", alias="assetIds")
edited: Optional[StrictBool] = Field(default=None, description="Download edited asset if available")
__properties: ClassVar[List[str]] = ["assetIds", "edited"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DownloadArchiveDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DownloadArchiveDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"assetIds": obj.get("assetIds"),
"edited": obj.get("edited")
})
return _obj
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -28,7 +27,7 @@ class DownloadArchiveInfo(BaseModel):
"""
DownloadArchiveInfo
""" # noqa: E501
asset_ids: List[UUID] = Field(description="Asset IDs in this archive", alias="assetIds")
asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs in this archive", alias="assetIds")
size: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Archive size in bytes")
__properties: ClassVar[List[str]] = ["assetIds", "size"]
@@ -17,10 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -28,10 +27,10 @@ class DownloadInfoDto(BaseModel):
"""
DownloadInfoDto
""" # noqa: E501
album_id: Optional[UUID] = Field(default=None, description="Album ID to download", alias="albumId")
album_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Album ID to download", alias="albumId")
archive_size: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="Archive size limit in bytes", alias="archiveSize")
asset_ids: Optional[List[UUID]] = Field(default=None, description="Asset IDs to download", alias="assetIds")
user_id: Optional[UUID] = Field(default=None, description="User ID to download assets from", alias="userId")
asset_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Asset IDs to download", alias="assetIds")
user_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="User ID to download assets from", alias="userId")
__properties: ClassVar[List[str]] = ["albumId", "archiveSize", "assetIds", "userId"]
@field_validator('album_id')
@@ -0,0 +1,96 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.duplicate_resolve_group_dto import DuplicateResolveGroupDto
from typing import Optional, Set
from typing_extensions import Self
class DuplicateResolveDto(BaseModel):
"""
DuplicateResolveDto
""" # noqa: E501
groups: Annotated[List[DuplicateResolveGroupDto], Field(min_length=1)] = Field(description="List of duplicate groups to resolve")
__properties: ClassVar[List[str]] = ["groups"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DuplicateResolveDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in groups (list)
_items = []
if self.groups:
for _item_groups in self.groups:
if _item_groups:
_items.append(_item_groups.to_dict())
_dict['groups'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DuplicateResolveDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"groups": [DuplicateResolveGroupDto.from_dict(_item) for _item in obj["groups"]] if obj.get("groups") is not None else None
})
return _obj
@@ -0,0 +1,99 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class DuplicateResolveGroupDto(BaseModel):
"""
DuplicateResolveGroupDto
""" # noqa: E501
duplicate_id: Annotated[str, Field(strict=True)] = Field(alias="duplicateId")
keep_asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs to keep", alias="keepAssetIds")
trash_asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Asset IDs to trash or delete", alias="trashAssetIds")
__properties: ClassVar[List[str]] = ["duplicateId", "keepAssetIds", "trashAssetIds"]
@field_validator('duplicate_id')
def duplicate_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DuplicateResolveGroupDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DuplicateResolveGroupDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"duplicateId": obj.get("duplicateId"),
"keepAssetIds": obj.get("keepAssetIds"),
"trashAssetIds": obj.get("trashAssetIds")
})
return _obj
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_response_dto import AssetResponseDto
from typing import Optional, Set
from typing_extensions import Self
@@ -29,8 +29,8 @@ class DuplicateResponseDto(BaseModel):
DuplicateResponseDto
""" # noqa: E501
assets: List[AssetResponseDto] = Field(description="Duplicate assets")
duplicate_id: UUID = Field(description="Duplicate group ID", alias="duplicateId")
suggested_keep_asset_ids: List[UUID] = Field(description="Suggested asset IDs to keep based on file size and EXIF data", alias="suggestedKeepAssetIds")
duplicate_id: Annotated[str, Field(strict=True)] = Field(description="Duplicate group ID", alias="duplicateId")
suggested_keep_asset_ids: List[Annotated[str, Field(strict=True)]] = Field(description="Suggested asset IDs to keep based on file size and EXIF data", alias="suggestedKeepAssetIds")
__properties: ClassVar[List[str]] = ["assets", "duplicateId", "suggestedKeepAssetIds"]
@field_validator('duplicate_id')
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -27,7 +27,7 @@ class FaceDto(BaseModel):
"""
FaceDto
""" # noqa: E501
id: UUID = Field(description="Face ID")
id: Annotated[str, Field(strict=True)] = Field(description="Face ID")
__properties: ClassVar[List[str]] = ["id"]
@field_validator('id')
@@ -0,0 +1,38 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class IntegrityReport(str, Enum):
"""
Integrity report type
"""
"""
allowed enum values
"""
UNTRACKED_FILE = 'untracked_file'
MISSING_FILE = 'missing_file'
CHECKSUM_MISMATCH = 'checksum_mismatch'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of IntegrityReport from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from generated.immich.openapi_client.models.integrity_report_response_dto_items_inner import IntegrityReportResponseDtoItemsInner
from typing import Optional, Set
from typing_extensions import Self
class IntegrityReportResponseDto(BaseModel):
"""
IntegrityReportResponseDto
""" # noqa: E501
items: List[IntegrityReportResponseDtoItemsInner]
next_cursor: Optional[StrictStr] = Field(default=None, alias="nextCursor")
__properties: ClassVar[List[str]] = ["items", "nextCursor"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of IntegrityReportResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
_items = []
if self.items:
for _item_items in self.items:
if _item_items:
_items.append(_item_items.to_dict())
_dict['items'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of IntegrityReportResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"items": [IntegrityReportResponseDtoItemsInner.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
"nextCursor": obj.get("nextCursor")
})
return _obj
@@ -0,0 +1,100 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.integrity_report import IntegrityReport
from typing import Optional, Set
from typing_extensions import Self
class IntegrityReportResponseDtoItemsInner(BaseModel):
"""
IntegrityReportResponseDtoItemsInner
""" # noqa: E501
id: Annotated[str, Field(strict=True)] = Field(description="Integrity report item id")
path: StrictStr = Field(description="Integrity report item path")
type: IntegrityReport
__properties: ClassVar[List[str]] = ["id", "path", "type"]
@field_validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of IntegrityReportResponseDtoItemsInner from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of IntegrityReportResponseDtoItemsInner from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"path": obj.get("path"),
"type": obj.get("type")
})
return _obj
@@ -0,0 +1,92 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class IntegrityReportSummaryResponseDto(BaseModel):
"""
IntegrityReportSummaryResponseDto
""" # noqa: E501
checksum_mismatch: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]
missing_file: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]
untracked_file: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]
__properties: ClassVar[List[str]] = ["checksum_mismatch", "missing_file", "untracked_file"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of IntegrityReportSummaryResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of IntegrityReportSummaryResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"checksum_mismatch": obj.get("checksum_mismatch"),
"missing_file": obj.get("missing_file"),
"untracked_file": obj.get("untracked_file")
})
return _obj
@@ -18,10 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -32,10 +31,10 @@ class LibraryResponseDto(BaseModel):
asset_count: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Number of assets", alias="assetCount")
created_at: datetime = Field(description="Creation date", alias="createdAt")
exclusion_patterns: List[StrictStr] = Field(description="Exclusion patterns", alias="exclusionPatterns")
id: UUID = Field(description="Library ID")
id: Annotated[str, Field(strict=True)] = Field(description="Library ID")
import_paths: List[StrictStr] = Field(description="Import paths", alias="importPaths")
name: StrictStr = Field(description="Library name")
owner_id: UUID = Field(description="Owner user ID", alias="ownerId")
owner_id: Annotated[str, Field(strict=True)] = Field(description="Owner user ID", alias="ownerId")
refreshed_at: Optional[datetime] = Field(description="Last refresh date", alias="refreshedAt")
updated_at: datetime = Field(description="Last update date", alias="updatedAt")
__properties: ClassVar[List[str]] = ["assetCount", "createdAt", "exclusionPatterns", "id", "importPaths", "name", "ownerId", "refreshedAt", "updatedAt"]
@@ -20,7 +20,6 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from uuid import UUID
from typing import Optional, Set
from typing_extensions import Self
@@ -35,7 +34,7 @@ class LoginResponseDto(BaseModel):
profile_image_path: StrictStr = Field(description="Profile image path", alias="profileImagePath")
should_change_password: StrictBool = Field(description="Should change password", alias="shouldChangePassword")
user_email: Annotated[str, Field(strict=True)] = Field(description="User email", alias="userEmail")
user_id: UUID = Field(description="User ID", alias="userId")
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID", alias="userId")
__properties: ClassVar[List[str]] = ["accessToken", "isAdmin", "isOnboarded", "name", "profileImagePath", "shouldChangePassword", "userEmail", "userId"]
@field_validator('user_email')
@@ -0,0 +1,92 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class MachineLearningAvailabilityChecksDto(BaseModel):
"""
MachineLearningAvailabilityChecksDto
""" # noqa: E501
enabled: StrictBool = Field(description="Enabled")
interval: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]
timeout: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]
__properties: ClassVar[List[str]] = ["enabled", "interval", "timeout"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MachineLearningAvailabilityChecksDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MachineLearningAvailabilityChecksDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"enabled": obj.get("enabled"),
"interval": obj.get("interval"),
"timeout": obj.get("timeout")
})
return _obj
@@ -0,0 +1,39 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class MaintenanceAction(str, Enum):
"""
Maintenance action
"""
"""
allowed enum values
"""
START = 'start'
END = 'end'
SELECT_DATABASE_RESTORE = 'select_database_restore'
RESTORE_DATABASE = 'restore_database'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of MaintenanceAction from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
class MaintenanceAuthDto(BaseModel):
"""
MaintenanceAuthDto
""" # noqa: E501
username: StrictStr = Field(description="Maintenance username")
__properties: ClassVar[List[str]] = ["username"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MaintenanceAuthDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MaintenanceAuthDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"username": obj.get("username")
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.maintenance_detect_install_storage_folder_dto import MaintenanceDetectInstallStorageFolderDto
from typing import Optional, Set
from typing_extensions import Self
class MaintenanceDetectInstallResponseDto(BaseModel):
"""
MaintenanceDetectInstallResponseDto
""" # noqa: E501
storage: List[MaintenanceDetectInstallStorageFolderDto]
__properties: ClassVar[List[str]] = ["storage"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MaintenanceDetectInstallResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in storage (list)
_items = []
if self.storage:
for _item_storage in self.storage:
if _item_storage:
_items.append(_item_storage.to_dict())
_dict['storage'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MaintenanceDetectInstallResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"storage": [MaintenanceDetectInstallStorageFolderDto.from_dict(_item) for _item in obj["storage"]] if obj.get("storage") is not None else None
})
return _obj
@@ -0,0 +1,95 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from generated.immich.openapi_client.models.storage_folder import StorageFolder
from typing import Optional, Set
from typing_extensions import Self
class MaintenanceDetectInstallStorageFolderDto(BaseModel):
"""
MaintenanceDetectInstallStorageFolderDto
""" # noqa: E501
files: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Number of files in the folder")
folder: StorageFolder
readable: StrictBool = Field(description="Whether the folder is readable")
writable: StrictBool = Field(description="Whether the folder is writable")
__properties: ClassVar[List[str]] = ["files", "folder", "readable", "writable"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MaintenanceDetectInstallStorageFolderDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MaintenanceDetectInstallStorageFolderDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"files": obj.get("files"),
"folder": obj.get("folder"),
"readable": obj.get("readable"),
"writable": obj.get("writable")
})
return _obj
@@ -0,0 +1,87 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class MaintenanceLoginDto(BaseModel):
"""
MaintenanceLoginDto
""" # noqa: E501
token: Optional[StrictStr] = Field(default=None, description="Maintenance token")
__properties: ClassVar[List[str]] = ["token"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MaintenanceLoginDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MaintenanceLoginDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"token": obj.get("token")
})
return _obj
@@ -0,0 +1,97 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from generated.immich.openapi_client.models.maintenance_action import MaintenanceAction
from typing import Optional, Set
from typing_extensions import Self
class MaintenanceStatusResponseDto(BaseModel):
"""
MaintenanceStatusResponseDto
""" # noqa: E501
action: MaintenanceAction
active: StrictBool
error: Optional[StrictStr] = None
progress: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]] = None
task: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["action", "active", "error", "progress", "task"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MaintenanceStatusResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MaintenanceStatusResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"action": obj.get("action"),
"active": obj.get("active"),
"error": obj.get("error"),
"progress": obj.get("progress"),
"task": obj.get("task")
})
return _obj
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -29,7 +29,7 @@ class MapMarkerResponseDto(BaseModel):
""" # noqa: E501
city: Optional[StrictStr] = Field(description="City name")
country: Optional[StrictStr] = Field(description="Country name")
id: UUID = Field(description="Asset ID")
id: Annotated[str, Field(strict=True)] = Field(description="Asset ID")
lat: Union[StrictFloat, StrictInt] = Field(description="Latitude")
lon: Union[StrictFloat, StrictInt] = Field(description="Longitude")
state: Optional[StrictStr] = Field(description="State/Province name")
@@ -18,9 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.memory_type import MemoryType
from generated.immich.openapi_client.models.on_this_day_dto import OnThisDayDto
from typing import Optional, Set
@@ -30,7 +30,7 @@ class MemoryCreateDto(BaseModel):
"""
MemoryCreateDto
""" # noqa: E501
asset_ids: Optional[List[UUID]] = Field(default=None, description="Asset IDs to associate with memory", alias="assetIds")
asset_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Asset IDs to associate with memory", alias="assetIds")
data: OnThisDayDto
hide_at: Optional[datetime] = Field(default=None, description="Date when memory should be hidden", alias="hideAt")
is_saved: Optional[StrictBool] = Field(default=None, description="Is memory saved", alias="isSaved")
@@ -18,9 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from uuid import UUID
from typing_extensions import Annotated
from generated.immich.openapi_client.models.asset_response_dto import AssetResponseDto
from generated.immich.openapi_client.models.memory_type import MemoryType
from generated.immich.openapi_client.models.on_this_day_dto import OnThisDayDto
@@ -36,10 +36,10 @@ class MemoryResponseDto(BaseModel):
data: OnThisDayDto
deleted_at: Optional[datetime] = Field(default=None, description="Deletion date", alias="deletedAt")
hide_at: Optional[datetime] = Field(default=None, description="Date when memory should be hidden", alias="hideAt")
id: UUID = Field(description="Memory ID")
id: Annotated[str, Field(strict=True)] = Field(description="Memory ID")
is_saved: StrictBool = Field(description="Is memory saved", alias="isSaved")
memory_at: datetime = Field(description="Memory date", alias="memoryAt")
owner_id: UUID = Field(description="Owner user ID", alias="ownerId")
owner_id: Annotated[str, Field(strict=True)] = Field(description="Owner user ID", alias="ownerId")
seen_at: Optional[datetime] = Field(default=None, description="Date when memory was seen", alias="seenAt")
show_at: Optional[datetime] = Field(default=None, description="Date when memory should be shown", alias="showAt")
type: MemoryType
@@ -0,0 +1,38 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class MemorySearchOrder(str, Enum):
"""
Sort order
"""
"""
allowed enum values
"""
ASC = 'asc'
DESC = 'desc'
RANDOM = 'random'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of MemorySearchOrder from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,88 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class MemoryStatisticsResponseDto(BaseModel):
"""
MemoryStatisticsResponseDto
""" # noqa: E501
total: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)] = Field(description="Total number of memories")
__properties: ClassVar[List[str]] = ["total"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MemoryStatisticsResponseDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MemoryStatisticsResponseDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"total": obj.get("total")
})
return _obj
@@ -18,7 +18,7 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
@@ -17,9 +17,9 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from uuid import UUID
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@@ -27,7 +27,7 @@ class MergePersonDto(BaseModel):
"""
MergePersonDto
""" # noqa: E501
ids: List[UUID] = Field(description="Person IDs to merge")
ids: List[Annotated[str, Field(strict=True)]] = Field(description="Person IDs to merge")
__properties: ClassVar[List[str]] = ["ids"]
model_config = ConfigDict(
@@ -18,10 +18,9 @@ import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from generated.immich.openapi_client.models.asset_order import AssetOrder
from generated.immich.openapi_client.models.asset_type_enum import AssetTypeEnum
from generated.immich.openapi_client.models.asset_visibility import AssetVisibility
@@ -32,7 +31,7 @@ class MetadataSearchDto(BaseModel):
"""
MetadataSearchDto
""" # noqa: E501
album_ids: Optional[List[UUID]] = Field(default=None, description="Filter by album IDs", alias="albumIds")
album_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Filter by album IDs", alias="albumIds")
checksum: Optional[StrictStr] = Field(default=None, description="Filter by file checksum")
city: Optional[StrictStr] = Field(default=None, description="Filter by city name")
country: Optional[StrictStr] = Field(default=None, description="Filter by country name")
@@ -40,14 +39,14 @@ class MetadataSearchDto(BaseModel):
created_before: Optional[datetime] = Field(default=None, description="Filter by creation date (before)", alias="createdBefore")
description: Optional[StrictStr] = Field(default=None, description="Filter by description text")
encoded_video_path: Optional[StrictStr] = Field(default=None, description="Filter by encoded video file path", alias="encodedVideoPath")
id: Optional[UUID] = Field(default=None, description="Filter by asset ID")
id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Filter by asset ID")
is_encoded: Optional[StrictBool] = Field(default=None, description="Filter by encoded status", alias="isEncoded")
is_favorite: Optional[StrictBool] = Field(default=None, description="Filter by favorite status", alias="isFavorite")
is_motion: Optional[StrictBool] = Field(default=None, description="Filter by motion photo status", alias="isMotion")
is_not_in_album: Optional[StrictBool] = Field(default=None, description="Filter assets not in any album", alias="isNotInAlbum")
is_offline: Optional[StrictBool] = Field(default=None, description="Filter by offline status", alias="isOffline")
lens_model: Optional[StrictStr] = Field(default=None, description="Filter by lens model", alias="lensModel")
library_id: Optional[UUID] = Field(default=None, description="Library ID to filter by", alias="libraryId")
library_id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Library ID to filter by", alias="libraryId")
make: Optional[StrictStr] = Field(default=None, description="Filter by camera make")
model: Optional[StrictStr] = Field(default=None, description="Filter by camera model")
ocr: Optional[StrictStr] = Field(default=None, description="Filter by OCR text content")
@@ -55,12 +54,12 @@ class MetadataSearchDto(BaseModel):
original_file_name: Optional[StrictStr] = Field(default=None, description="Filter by original file name", alias="originalFileName")
original_path: Optional[StrictStr] = Field(default=None, description="Filter by original file path", alias="originalPath")
page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="Page number")
person_ids: Optional[List[UUID]] = Field(default=None, description="Filter by person IDs", alias="personIds")
person_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Filter by person IDs", alias="personIds")
preview_path: Optional[StrictStr] = Field(default=None, description="Filter by preview file path", alias="previewPath")
rating: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Filter by rating [1-5], or null for unrated")
size: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = Field(default=None, description="Number of results to return")
state: Optional[StrictStr] = Field(default=None, description="Filter by state/province name")
tag_ids: Optional[List[UUID]] = Field(default=None, description="Filter by tag IDs", alias="tagIds")
tag_ids: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Filter by tag IDs", alias="tagIds")
taken_after: Optional[datetime] = Field(default=None, description="Filter by taken date (after)", alias="takenAfter")
taken_before: Optional[datetime] = Field(default=None, description="Filter by taken date (before)", alias="takenBefore")
thumbnail_path: Optional[StrictStr] = Field(default=None, description="Filter by thumbnail file path", alias="thumbnailPath")
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class MirrorAxis(str, Enum):
"""
Axis to mirror along
"""
"""
allowed enum values
"""
HORIZONTAL = 'horizontal'
VERTICAL = 'vertical'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of MirrorAxis from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,88 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List
from generated.immich.openapi_client.models.mirror_axis import MirrorAxis
from typing import Optional, Set
from typing_extensions import Self
class MirrorParameters(BaseModel):
"""
MirrorParameters
""" # noqa: E501
axis: MirrorAxis
__properties: ClassVar[List[str]] = ["axis"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of MirrorParameters from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of MirrorParameters from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"axis": obj.get("axis")
})
return _obj
@@ -0,0 +1,130 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from generated.immich.openapi_client.models.notification_level import NotificationLevel
from generated.immich.openapi_client.models.notification_type import NotificationType
from typing import Optional, Set
from typing_extensions import Self
class NotificationCreateDto(BaseModel):
"""
NotificationCreateDto
""" # noqa: E501
data: Optional[Dict[str, Any]] = Field(default=None, description="Additional notification data")
description: Optional[StrictStr] = Field(default=None, description="Notification description")
level: Optional[NotificationLevel] = None
read_at: Optional[datetime] = Field(default=None, description="Date when notification was read", alias="readAt")
title: StrictStr = Field(description="Notification title")
type: Optional[NotificationType] = None
user_id: Annotated[str, Field(strict=True)] = Field(description="User ID to send notification to", alias="userId")
__properties: ClassVar[List[str]] = ["data", "description", "level", "readAt", "title", "type", "userId"]
@field_validator('read_at')
def read_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
@field_validator('user_id')
def user_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of NotificationCreateDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# set to None if description (nullable) is None
# and model_fields_set contains the field
if self.description is None and "description" in self.model_fields_set:
_dict['description'] = None
# set to None if read_at (nullable) is None
# and model_fields_set contains the field
if self.read_at is None and "read_at" in self.model_fields_set:
_dict['readAt'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NotificationCreateDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"data": obj.get("data"),
"description": obj.get("description"),
"level": obj.get("level"),
"readAt": obj.get("readAt"),
"title": obj.get("title"),
"type": obj.get("type"),
"userId": obj.get("userId")
})
return _obj
@@ -0,0 +1,88 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class NotificationDeleteAllDto(BaseModel):
"""
NotificationDeleteAllDto
""" # noqa: E501
ids: Annotated[List[Annotated[str, Field(strict=True)]], Field(min_length=1)] = Field(description="Notification IDs to delete")
__properties: ClassVar[List[str]] = ["ids"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of NotificationDeleteAllDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NotificationDeleteAllDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ids": obj.get("ids")
})
return _obj
@@ -0,0 +1,129 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from generated.immich.openapi_client.models.notification_level import NotificationLevel
from generated.immich.openapi_client.models.notification_type import NotificationType
from typing import Optional, Set
from typing_extensions import Self
class NotificationDto(BaseModel):
"""
NotificationDto
""" # noqa: E501
created_at: datetime = Field(description="Creation date", alias="createdAt")
data: Optional[Dict[str, Any]] = Field(default=None, description="Additional notification data")
description: Optional[StrictStr] = Field(default=None, description="Notification description")
id: Annotated[str, Field(strict=True)] = Field(description="Notification ID")
level: NotificationLevel
read_at: Optional[datetime] = Field(default=None, description="Date when notification was read", alias="readAt")
title: StrictStr = Field(description="Notification title")
type: NotificationType
__properties: ClassVar[List[str]] = ["createdAt", "data", "description", "id", "level", "readAt", "title", "type"]
@field_validator('created_at')
def created_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
@field_validator('id')
def id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$", value):
raise ValueError(r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/")
return value
@field_validator('read_at')
def read_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of NotificationDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NotificationDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"createdAt": obj.get("createdAt"),
"data": obj.get("data"),
"description": obj.get("description"),
"id": obj.get("id"),
"level": obj.get("level"),
"readAt": obj.get("readAt"),
"title": obj.get("title"),
"type": obj.get("type")
})
return _obj
@@ -0,0 +1,39 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class NotificationLevel(str, Enum):
"""
Notification level
"""
"""
allowed enum values
"""
SUCCESS = 'success'
ERROR = 'error'
WARNING = 'warning'
INFO = 'info'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of NotificationLevel from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,41 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class NotificationType(str, Enum):
"""
Notification type
"""
"""
allowed enum values
"""
JOBFAILED = 'JobFailed'
BACKUPFAILED = 'BackupFailed'
SYSTEMMESSAGE = 'SystemMessage'
ALBUMINVITE = 'AlbumInvite'
ALBUMUPDATE = 'AlbumUpdate'
CUSTOM = 'Custom'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of NotificationType from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,106 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class NotificationUpdateAllDto(BaseModel):
"""
NotificationUpdateAllDto
""" # noqa: E501
ids: Annotated[List[Annotated[str, Field(strict=True)]], Field(min_length=1)] = Field(description="Notification IDs to update")
read_at: Optional[datetime] = Field(default=None, description="Date when notifications were read", alias="readAt")
__properties: ClassVar[List[str]] = ["ids", "readAt"]
@field_validator('read_at')
def read_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of NotificationUpdateAllDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# set to None if read_at (nullable) is None
# and model_fields_set contains the field
if self.read_at is None and "read_at" in self.model_fields_set:
_dict['readAt'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NotificationUpdateAllDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ids": obj.get("ids"),
"readAt": obj.get("readAt")
})
return _obj
@@ -0,0 +1,103 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class NotificationUpdateDto(BaseModel):
"""
NotificationUpdateDto
""" # noqa: E501
read_at: Optional[datetime] = Field(default=None, description="Date when notification was read", alias="readAt")
__properties: ClassVar[List[str]] = ["readAt"]
@field_validator('read_at')
def read_at_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value
if not re.match(r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$", value):
raise ValueError(r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/")
return value
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of NotificationUpdateDto from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# set to None if read_at (nullable) is None
# and model_fields_set contains the field
if self.read_at is None and "read_at" in self.model_fields_set:
_dict['readAt'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NotificationUpdateDto from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"readAt": obj.get("readAt")
})
return _obj
@@ -0,0 +1,37 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self
class OAuthTokenEndpointAuthMethod(str, Enum):
"""
OAuth token endpoint auth method
"""
"""
allowed enum values
"""
CLIENT_SECRET_POST = 'client_secret_post'
CLIENT_SECRET_BASIC = 'client_secret_basic'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of OAuthTokenEndpointAuthMethod from a JSON string"""
return cls(json.loads(json_str))
@@ -0,0 +1,96 @@
# coding: utf-8
"""
Immich
Immich API
The version of the OpenAPI document: 3.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Union
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
class OcrConfig(BaseModel):
"""
OcrConfig
""" # noqa: E501
enabled: StrictBool = Field(description="Whether the task is enabled")
max_resolution: Annotated[int, Field(le=9007199254740991, strict=True, ge=1)] = Field(description="Maximum resolution for OCR processing", alias="maxResolution")
min_detection_score: Union[Annotated[float, Field(le=1, strict=True, ge=0.1)], Annotated[int, Field(le=1, strict=True, ge=1)]] = Field(description="Minimum confidence score for text detection", alias="minDetectionScore")
min_recognition_score: Union[Annotated[float, Field(le=1, strict=True, ge=0.1)], Annotated[int, Field(le=1, strict=True, ge=1)]] = Field(description="Minimum confidence score for text recognition", alias="minRecognitionScore")
model_name: StrictStr = Field(description="Name of the model to use", alias="modelName")
__properties: ClassVar[List[str]] = ["enabled", "maxResolution", "minDetectionScore", "minRecognitionScore", "modelName"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of OcrConfig from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of OcrConfig from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"enabled": obj.get("enabled"),
"maxResolution": obj.get("maxResolution"),
"minDetectionScore": obj.get("minDetectionScore"),
"minRecognitionScore": obj.get("minRecognitionScore"),
"modelName": obj.get("modelName")
})
return _obj

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