Skip to content

Sync Asset V1

immichpy.client.generated.models.sync_asset_v1.SyncAssetV1 pydantic-model

Bases: BaseModel

SyncAssetV1

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": "SyncAssetV1",
  "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": [
        {
          "type": "string"
        },
        {
          "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": "SyncAssetV1",
  "type": "object"
}

Config:

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

Fields:

Validators:

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[StrictStr]

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

created_at_validate_regular_expression pydantic-validator

created_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@field_validator("created_at", mode="before")
def created_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and 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

deleted_at_validate_regular_expression pydantic-validator

deleted_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@field_validator("deleted_at", mode="before")
def deleted_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and 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

file_created_at_validate_regular_expression pydantic-validator

file_created_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@field_validator("file_created_at", mode="before")
def file_created_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and 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

file_modified_at_validate_regular_expression pydantic-validator

file_modified_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@field_validator("file_modified_at", mode="before")
def file_modified_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and 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

from_dict classmethod

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

Create an instance of SyncAssetV1 from a dict

Source code in immichpy/client/generated/models/sync_asset_v1.py
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of SyncAssetV1 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 SyncAssetV1 from a JSON string

Source code in immichpy/client/generated/models/sync_asset_v1.py
228
229
230
231
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SyncAssetV1 from a JSON string"""
    return cls.from_dict(json.loads(json_str))

id_validate_regular_expression pydantic-validator

id_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
174
175
176
177
178
179
180
181
182
183
184
@field_validator("id", mode="before")
def id_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and 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

local_date_time_validate_regular_expression pydantic-validator

local_date_time_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
@field_validator("local_date_time", mode="before")
def local_date_time_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and 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

owner_id_validate_regular_expression pydantic-validator

owner_id_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/sync_asset_v1.py
201
202
203
204
205
206
207
208
209
210
211
@field_validator("owner_id", mode="before")
def owner_id_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and 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

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_v1.py
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
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_v1.py
224
225
226
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_v1.py
220
221
222
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))