Skip to content

Sync Asset V2

immichpy.client.generated.models.sync_asset_v2.SyncAssetV2 pydantic-model

Bases: BaseModel

SyncAssetV2

Show JSON schema:
{
  "$defs": {
    "AssetTypeEnum": {
      "description": "Asset type",
      "enum": [
        "IMAGE",
        "VIDEO",
        "AUDIO",
        "OTHER"
      ],
      "title": "AssetTypeEnum",
      "type": "string"
    },
    "AssetVisibility": {
      "description": "Asset visibility",
      "enum": [
        "archive",
        "timeline",
        "hidden",
        "locked"
      ],
      "title": "AssetVisibility",
      "type": "string"
    }
  },
  "description": "SyncAssetV2",
  "properties": {
    "checksum": {
      "description": "Checksum",
      "title": "Checksum",
      "type": "string"
    },
    "createdAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Uploaded to Immich at",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Createdat"
    },
    "deletedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deleted at",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Deletedat"
    },
    "duration": {
      "anyOf": [
        {
          "maximum": 2147483647,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Duration",
      "title": "Duration"
    },
    "fileCreatedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "File created at",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Filecreatedat"
    },
    "fileModifiedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "File modified at",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Filemodifiedat"
    },
    "height": {
      "anyOf": [
        {
          "maximum": 9007199254740991,
          "minimum": -9007199254740991,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset height",
      "title": "Height"
    },
    "id": {
      "description": "Asset ID",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "isEdited": {
      "description": "Is edited",
      "title": "Isedited",
      "type": "boolean"
    },
    "isFavorite": {
      "description": "Is favorite",
      "title": "Isfavorite",
      "type": "boolean"
    },
    "libraryId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Library ID",
      "title": "Libraryid"
    },
    "livePhotoVideoId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Live photo video ID",
      "title": "Livephotovideoid"
    },
    "localDateTime": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Local date time",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Localdatetime"
    },
    "originalFileName": {
      "description": "Original file name",
      "title": "Originalfilename",
      "type": "string"
    },
    "ownerId": {
      "description": "Owner ID",
      "format": "uuid",
      "title": "Ownerid",
      "type": "string"
    },
    "stackId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Stack ID",
      "title": "Stackid"
    },
    "thumbhash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Thumbhash",
      "title": "Thumbhash"
    },
    "type": {
      "$ref": "#/$defs/AssetTypeEnum"
    },
    "visibility": {
      "$ref": "#/$defs/AssetVisibility"
    },
    "width": {
      "anyOf": [
        {
          "maximum": 9007199254740991,
          "minimum": -9007199254740991,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset width",
      "title": "Width"
    }
  },
  "required": [
    "checksum",
    "createdAt",
    "deletedAt",
    "duration",
    "fileCreatedAt",
    "fileModifiedAt",
    "height",
    "id",
    "isEdited",
    "isFavorite",
    "libraryId",
    "livePhotoVideoId",
    "localDateTime",
    "originalFileName",
    "ownerId",
    "stackId",
    "thumbhash",
    "type",
    "visibility",
    "width"
  ],
  "title": "SyncAssetV2",
  "type": "object"
}

Config:

  • validate_by_name: True
  • validate_by_alias: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

checksum pydantic-field

checksum: StrictStr

Checksum

created_at pydantic-field

created_at: Optional[datetime]

Uploaded to Immich at

deleted_at pydantic-field

deleted_at: Optional[datetime]

Deleted at

duration pydantic-field

duration: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=0)]]

Duration

file_created_at pydantic-field

file_created_at: Optional[datetime]

File created at

file_modified_at pydantic-field

file_modified_at: Optional[datetime]

File modified at

height pydantic-field

height: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]

Asset height

id pydantic-field

id: UUID

Asset ID

is_edited pydantic-field

is_edited: StrictBool

Is edited

is_favorite pydantic-field

is_favorite: StrictBool

Is favorite

library_id pydantic-field

library_id: Optional[StrictStr]

Library ID

live_photo_video_id pydantic-field

live_photo_video_id: Optional[StrictStr]

Live photo video ID

local_date_time pydantic-field

local_date_time: Optional[datetime]

Local date time

original_file_name pydantic-field

original_file_name: StrictStr

Original file name

owner_id pydantic-field

owner_id: UUID

Owner ID

stack_id pydantic-field

stack_id: Optional[StrictStr]

Stack ID

thumbhash pydantic-field

thumbhash: Optional[StrictStr]

Thumbhash

width pydantic-field

width: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]

Asset width

from_dict classmethod

from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of SyncAssetV2 from a dict

Source code in immichpy/client/generated/models/sync_asset_v2.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of SyncAssetV2 from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate(
        {
            "checksum": obj.get("checksum"),
            "createdAt": obj.get("createdAt"),
            "deletedAt": obj.get("deletedAt"),
            "duration": obj.get("duration"),
            "fileCreatedAt": obj.get("fileCreatedAt"),
            "fileModifiedAt": obj.get("fileModifiedAt"),
            "height": obj.get("height"),
            "id": obj.get("id"),
            "isEdited": obj.get("isEdited"),
            "isFavorite": obj.get("isFavorite"),
            "libraryId": obj.get("libraryId"),
            "livePhotoVideoId": obj.get("livePhotoVideoId"),
            "localDateTime": obj.get("localDateTime"),
            "originalFileName": obj.get("originalFileName"),
            "ownerId": obj.get("ownerId"),
            "stackId": obj.get("stackId"),
            "thumbhash": obj.get("thumbhash"),
            "type": obj.get("type"),
            "visibility": obj.get("visibility"),
            "width": obj.get("width"),
        }
    )
    return _obj

from_json classmethod

from_json(json_str: str) -> Optional[Self]

Create an instance of SyncAssetV2 from a JSON string

Source code in immichpy/client/generated/models/sync_asset_v2.py
124
125
126
127
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SyncAssetV2 from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict

to_dict() -> 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.
Source code in immichpy/client/generated/models/sync_asset_v2.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
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 created_at (nullable) is None
    # and model_fields_set contains the field
    if self.created_at is None and "created_at" in self.model_fields_set:
        _dict["createdAt"] = None

    # set to None if deleted_at (nullable) is None
    # and model_fields_set contains the field
    if self.deleted_at is None and "deleted_at" in self.model_fields_set:
        _dict["deletedAt"] = None

    # set to None if duration (nullable) is None
    # and model_fields_set contains the field
    if self.duration is None and "duration" in self.model_fields_set:
        _dict["duration"] = None

    # set to None if file_created_at (nullable) is None
    # and model_fields_set contains the field
    if self.file_created_at is None and "file_created_at" in self.model_fields_set:
        _dict["fileCreatedAt"] = None

    # set to None if file_modified_at (nullable) is None
    # and model_fields_set contains the field
    if (
        self.file_modified_at is None
        and "file_modified_at" in self.model_fields_set
    ):
        _dict["fileModifiedAt"] = None

    # set to None if height (nullable) is None
    # and model_fields_set contains the field
    if self.height is None and "height" in self.model_fields_set:
        _dict["height"] = None

    # set to None if library_id (nullable) is None
    # and model_fields_set contains the field
    if self.library_id is None and "library_id" in self.model_fields_set:
        _dict["libraryId"] = None

    # set to None if live_photo_video_id (nullable) is None
    # and model_fields_set contains the field
    if (
        self.live_photo_video_id is None
        and "live_photo_video_id" in self.model_fields_set
    ):
        _dict["livePhotoVideoId"] = None

    # set to None if local_date_time (nullable) is None
    # and model_fields_set contains the field
    if self.local_date_time is None and "local_date_time" in self.model_fields_set:
        _dict["localDateTime"] = None

    # set to None if stack_id (nullable) is None
    # and model_fields_set contains the field
    if self.stack_id is None and "stack_id" in self.model_fields_set:
        _dict["stackId"] = None

    # set to None if thumbhash (nullable) is None
    # and model_fields_set contains the field
    if self.thumbhash is None and "thumbhash" in self.model_fields_set:
        _dict["thumbhash"] = None

    # set to None if width (nullable) is None
    # and model_fields_set contains the field
    if self.width is None and "width" in self.model_fields_set:
        _dict["width"] = None

    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/sync_asset_v2.py
120
121
122
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    return json.dumps(to_jsonable_python(self.to_dict()))

to_str

to_str() -> str

Returns the string representation of the model using alias

Source code in immichpy/client/generated/models/sync_asset_v2.py
116
117
118
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))