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"
    },
    "deletedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deleted at",
      "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",
      "title": "Filecreatedat"
    },
    "fileModifiedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "File modified at",
      "title": "Filemodifiedat"
    },
    "height": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset height",
      "title": "Height"
    },
    "id": {
      "description": "Asset ID",
      "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",
      "title": "Localdatetime"
    },
    "originalFileName": {
      "description": "Original file name",
      "title": "Originalfilename",
      "type": "string"
    },
    "ownerId": {
      "description": "Owner ID",
      "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": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset width",
      "title": "Width"
    }
  },
  "required": [
    "checksum",
    "deletedAt",
    "duration",
    "fileCreatedAt",
    "fileModifiedAt",
    "height",
    "id",
    "isEdited",
    "isFavorite",
    "libraryId",
    "livePhotoVideoId",
    "localDateTime",
    "originalFileName",
    "ownerId",
    "stackId",
    "thumbhash",
    "type",
    "visibility",
    "width"
  ],
  "title": "SyncAssetV1",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

checksum pydantic-field

checksum: StrictStr

Checksum

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

Asset height

id pydantic-field

id: StrictStr

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: StrictStr

Owner ID

stack_id pydantic-field

stack_id: Optional[StrictStr]

Stack ID

thumbhash pydantic-field

thumbhash: Optional[StrictStr]

Thumbhash

type pydantic-field

type: AssetTypeEnum

Asset type

visibility pydantic-field

visibility: AssetVisibility

Asset visibility

width pydantic-field

width: Optional[StrictInt]

Asset width

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
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
213
214
215
216
@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"),
            "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
 99
100
101
102
@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))

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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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
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 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
94
95
96
97
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())

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
90
91
92
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))