Skip to content

Asset Response Dto

immichpy.client.generated.models.asset_response_dto.AssetResponseDto pydantic-model

Bases: BaseModel

AssetResponseDto

Show JSON schema:
{
  "$defs": {
    "AssetFaceWithoutPersonResponseDto": {
      "description": "AssetFaceWithoutPersonResponseDto",
      "properties": {
        "boundingBoxX1": {
          "description": "Bounding box X1 coordinate",
          "title": "Boundingboxx1",
          "type": "integer"
        },
        "boundingBoxX2": {
          "description": "Bounding box X2 coordinate",
          "title": "Boundingboxx2",
          "type": "integer"
        },
        "boundingBoxY1": {
          "description": "Bounding box Y1 coordinate",
          "title": "Boundingboxy1",
          "type": "integer"
        },
        "boundingBoxY2": {
          "description": "Bounding box Y2 coordinate",
          "title": "Boundingboxy2",
          "type": "integer"
        },
        "id": {
          "description": "Face ID",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "imageHeight": {
          "description": "Image height in pixels",
          "title": "Imageheight",
          "type": "integer"
        },
        "imageWidth": {
          "description": "Image width in pixels",
          "title": "Imagewidth",
          "type": "integer"
        },
        "sourceType": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourceType"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Face detection source type"
        }
      },
      "required": [
        "boundingBoxX1",
        "boundingBoxX2",
        "boundingBoxY1",
        "boundingBoxY2",
        "id",
        "imageHeight",
        "imageWidth"
      ],
      "title": "AssetFaceWithoutPersonResponseDto",
      "type": "object"
    },
    "AssetStackResponseDto": {
      "description": "AssetStackResponseDto",
      "properties": {
        "assetCount": {
          "description": "Number of assets in stack",
          "title": "Assetcount",
          "type": "integer"
        },
        "id": {
          "description": "Stack ID",
          "title": "Id",
          "type": "string"
        },
        "primaryAssetId": {
          "description": "Primary asset ID",
          "title": "Primaryassetid",
          "type": "string"
        }
      },
      "required": [
        "assetCount",
        "id",
        "primaryAssetId"
      ],
      "title": "AssetStackResponseDto",
      "type": "object"
    },
    "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"
    },
    "ExifResponseDto": {
      "description": "ExifResponseDto",
      "properties": {
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "City name",
          "title": "City"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Country name",
          "title": "Country"
        },
        "dateTimeOriginal": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Original date/time",
          "title": "Datetimeoriginal"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image description",
          "title": "Description"
        },
        "exifImageHeight": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image height in pixels",
          "title": "Exifimageheight"
        },
        "exifImageWidth": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image width in pixels",
          "title": "Exifimagewidth"
        },
        "exposureTime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Exposure time",
          "title": "Exposuretime"
        },
        "fNumber": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "F-number (aperture)",
          "title": "Fnumber"
        },
        "fileSizeInByte": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "File size in bytes",
          "title": "Filesizeinbyte"
        },
        "focalLength": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Focal length in mm",
          "title": "Focallength"
        },
        "iso": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO sensitivity",
          "title": "Iso"
        },
        "latitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "GPS latitude",
          "title": "Latitude"
        },
        "lensModel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Lens model",
          "title": "Lensmodel"
        },
        "longitude": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "GPS longitude",
          "title": "Longitude"
        },
        "make": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Camera make",
          "title": "Make"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Camera model",
          "title": "Model"
        },
        "modifyDate": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Modification date/time",
          "title": "Modifydate"
        },
        "orientation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image orientation",
          "title": "Orientation"
        },
        "projectionType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Projection type",
          "title": "Projectiontype"
        },
        "rating": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Rating",
          "title": "Rating"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "State/province name",
          "title": "State"
        },
        "timeZone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Time zone",
          "title": "Timezone"
        }
      },
      "title": "ExifResponseDto",
      "type": "object"
    },
    "PersonWithFacesResponseDto": {
      "description": "PersonWithFacesResponseDto",
      "properties": {
        "birthDate": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Person date of birth",
          "title": "Birthdate"
        },
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Person color (hex)",
          "title": "Color"
        },
        "faces": {
          "description": "Face detections",
          "items": {
            "$ref": "#/$defs/AssetFaceWithoutPersonResponseDto"
          },
          "title": "Faces",
          "type": "array"
        },
        "id": {
          "description": "Person ID",
          "title": "Id",
          "type": "string"
        },
        "isFavorite": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Is favorite",
          "title": "Isfavorite"
        },
        "isHidden": {
          "description": "Is hidden",
          "title": "Ishidden",
          "type": "boolean"
        },
        "name": {
          "description": "Person name",
          "title": "Name",
          "type": "string"
        },
        "thumbnailPath": {
          "description": "Thumbnail path",
          "title": "Thumbnailpath",
          "type": "string"
        },
        "updatedAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Last update date",
          "title": "Updatedat"
        }
      },
      "required": [
        "birthDate",
        "faces",
        "id",
        "isHidden",
        "name",
        "thumbnailPath"
      ],
      "title": "PersonWithFacesResponseDto",
      "type": "object"
    },
    "SourceType": {
      "description": "Face detection source type",
      "enum": [
        "machine-learning",
        "exif",
        "manual"
      ],
      "title": "SourceType",
      "type": "string"
    },
    "TagResponseDto": {
      "description": "TagResponseDto",
      "properties": {
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tag color (hex)",
          "title": "Color"
        },
        "createdAt": {
          "description": "Creation date",
          "format": "date-time",
          "title": "Createdat",
          "type": "string"
        },
        "id": {
          "description": "Tag ID",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Tag name",
          "title": "Name",
          "type": "string"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Parent tag ID",
          "title": "Parentid"
        },
        "updatedAt": {
          "description": "Last update date",
          "format": "date-time",
          "title": "Updatedat",
          "type": "string"
        },
        "value": {
          "description": "Tag value (full path)",
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "createdAt",
        "id",
        "name",
        "updatedAt",
        "value"
      ],
      "title": "TagResponseDto",
      "type": "object"
    },
    "UserAvatarColor": {
      "description": "Avatar color",
      "enum": [
        "primary",
        "pink",
        "red",
        "yellow",
        "blue",
        "green",
        "purple",
        "orange",
        "gray",
        "amber"
      ],
      "title": "UserAvatarColor",
      "type": "string"
    },
    "UserResponseDto": {
      "description": "UserResponseDto",
      "properties": {
        "avatarColor": {
          "$ref": "#/$defs/UserAvatarColor"
        },
        "email": {
          "description": "User email",
          "title": "Email",
          "type": "string"
        },
        "id": {
          "description": "User ID",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "User name",
          "title": "Name",
          "type": "string"
        },
        "profileChangedAt": {
          "description": "Profile change date",
          "format": "date-time",
          "title": "Profilechangedat",
          "type": "string"
        },
        "profileImagePath": {
          "description": "Profile image path",
          "title": "Profileimagepath",
          "type": "string"
        }
      },
      "required": [
        "avatarColor",
        "email",
        "id",
        "name",
        "profileChangedAt",
        "profileImagePath"
      ],
      "title": "UserResponseDto",
      "type": "object"
    }
  },
  "description": "AssetResponseDto",
  "properties": {
    "checksum": {
      "description": "Base64 encoded SHA1 hash",
      "title": "Checksum",
      "type": "string"
    },
    "createdAt": {
      "description": "The UTC timestamp when the asset was originally uploaded to Immich.",
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deviceAssetId": {
      "description": "Device asset ID",
      "title": "Deviceassetid",
      "type": "string"
    },
    "deviceId": {
      "description": "Device ID",
      "title": "Deviceid",
      "type": "string"
    },
    "duplicateId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Duplicate group ID",
      "title": "Duplicateid"
    },
    "duration": {
      "description": "Video duration (for videos)",
      "title": "Duration",
      "type": "string"
    },
    "exifInfo": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExifResponseDto"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "fileCreatedAt": {
      "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.",
      "format": "date-time",
      "title": "Filecreatedat",
      "type": "string"
    },
    "fileModifiedAt": {
      "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.",
      "format": "date-time",
      "title": "Filemodifiedat",
      "type": "string"
    },
    "hasMetadata": {
      "description": "Whether asset has metadata",
      "title": "Hasmetadata",
      "type": "boolean"
    },
    "height": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset height",
      "title": "Height"
    },
    "id": {
      "description": "Asset ID",
      "title": "Id",
      "type": "string"
    },
    "isArchived": {
      "description": "Is archived",
      "title": "Isarchived",
      "type": "boolean"
    },
    "isEdited": {
      "description": "Is edited",
      "title": "Isedited",
      "type": "boolean"
    },
    "isFavorite": {
      "description": "Is favorite",
      "title": "Isfavorite",
      "type": "boolean"
    },
    "isOffline": {
      "description": "Is offline",
      "title": "Isoffline",
      "type": "boolean"
    },
    "isTrashed": {
      "description": "Is trashed",
      "title": "Istrashed",
      "type": "boolean"
    },
    "libraryId": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Library ID",
      "title": "Libraryid"
    },
    "livePhotoVideoId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Live photo video ID",
      "title": "Livephotovideoid"
    },
    "localDateTime": {
      "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.",
      "format": "date-time",
      "title": "Localdatetime",
      "type": "string"
    },
    "originalFileName": {
      "description": "Original file name",
      "title": "Originalfilename",
      "type": "string"
    },
    "originalMimeType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Original MIME type",
      "title": "Originalmimetype"
    },
    "originalPath": {
      "description": "Original file path",
      "title": "Originalpath",
      "type": "string"
    },
    "owner": {
      "anyOf": [
        {
          "$ref": "#/$defs/UserResponseDto"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "ownerId": {
      "description": "Owner user ID",
      "title": "Ownerid",
      "type": "string"
    },
    "people": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/PersonWithFacesResponseDto"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "People"
    },
    "resized": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Is resized",
      "title": "Resized"
    },
    "stack": {
      "anyOf": [
        {
          "$ref": "#/$defs/AssetStackResponseDto"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/TagResponseDto"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tags"
    },
    "thumbhash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Thumbhash for thumbnail generation (base64) also used as the c query param for thumbnail cache busting.",
      "title": "Thumbhash"
    },
    "type": {
      "$ref": "#/$defs/AssetTypeEnum"
    },
    "unassignedFaces": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AssetFaceWithoutPersonResponseDto"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Unassignedfaces"
    },
    "updatedAt": {
      "description": "The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified.",
      "format": "date-time",
      "title": "Updatedat",
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/AssetVisibility"
    },
    "width": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Asset width",
      "title": "Width"
    }
  },
  "required": [
    "checksum",
    "createdAt",
    "deviceAssetId",
    "deviceId",
    "duration",
    "fileCreatedAt",
    "fileModifiedAt",
    "hasMetadata",
    "height",
    "id",
    "isArchived",
    "isEdited",
    "isFavorite",
    "isOffline",
    "isTrashed",
    "localDateTime",
    "originalFileName",
    "originalPath",
    "ownerId",
    "thumbhash",
    "type",
    "updatedAt",
    "visibility",
    "width"
  ],
  "title": "AssetResponseDto",
  "type": "object"
}

Config:

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

Fields:

checksum pydantic-field

checksum: StrictStr

Base64 encoded SHA1 hash

created_at pydantic-field

created_at: datetime

The UTC timestamp when the asset was originally uploaded to Immich.

device_asset_id pydantic-field

device_asset_id: StrictStr

Device asset ID

device_id pydantic-field

device_id: StrictStr

Device ID

duplicate_id pydantic-field

duplicate_id: Optional[StrictStr] = None

Duplicate group ID

duration pydantic-field

duration: StrictStr

Video duration (for videos)

file_created_at pydantic-field

file_created_at: datetime

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.

file_modified_at pydantic-field

file_modified_at: datetime

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.

has_metadata pydantic-field

has_metadata: StrictBool

Whether asset has metadata

height pydantic-field

height: Optional[Union[StrictFloat, StrictInt]]

Asset height

id pydantic-field

id: StrictStr

Asset ID

is_archived pydantic-field

is_archived: StrictBool

Is archived

is_edited pydantic-field

is_edited: StrictBool

Is edited

is_favorite pydantic-field

is_favorite: StrictBool

Is favorite

is_offline pydantic-field

is_offline: StrictBool

Is offline

is_trashed pydantic-field

is_trashed: StrictBool

Is trashed

library_id pydantic-field

library_id: Optional[UUID] = None

Library ID

live_photo_video_id pydantic-field

live_photo_video_id: Optional[StrictStr] = None

Live photo video ID

local_date_time pydantic-field

local_date_time: datetime

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.

original_file_name pydantic-field

original_file_name: StrictStr

Original file name

original_mime_type pydantic-field

original_mime_type: Optional[StrictStr] = None

Original MIME type

original_path pydantic-field

original_path: StrictStr

Original file path

owner_id pydantic-field

owner_id: StrictStr

Owner user ID

resized pydantic-field

resized: Optional[StrictBool] = None

Is resized

thumbhash pydantic-field

thumbhash: Optional[StrictStr]

Thumbhash for thumbnail generation (base64) also used as the c query param for thumbnail cache busting.

type pydantic-field

type: AssetTypeEnum

Asset type

updated_at pydantic-field

updated_at: datetime

The UTC timestamp when the asset record was last updated in the database. This is automatically maintained by the database and reflects when any field in the asset was last modified.

visibility pydantic-field

visibility: AssetVisibility

Asset visibility

width pydantic-field

width: Optional[Union[StrictFloat, StrictInt]]

Asset width

from_dict classmethod

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

Create an instance of AssetResponseDto from a dict

Source code in immichpy/client/generated/models/asset_response_dto.py
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AssetResponseDto 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"),
            "deviceAssetId": obj.get("deviceAssetId"),
            "deviceId": obj.get("deviceId"),
            "duplicateId": obj.get("duplicateId"),
            "duration": obj.get("duration"),
            "exifInfo": ExifResponseDto.from_dict(obj["exifInfo"])
            if obj.get("exifInfo") is not None
            else None,
            "fileCreatedAt": obj.get("fileCreatedAt"),
            "fileModifiedAt": obj.get("fileModifiedAt"),
            "hasMetadata": obj.get("hasMetadata"),
            "height": obj.get("height"),
            "id": obj.get("id"),
            "isArchived": obj.get("isArchived"),
            "isEdited": obj.get("isEdited"),
            "isFavorite": obj.get("isFavorite"),
            "isOffline": obj.get("isOffline"),
            "isTrashed": obj.get("isTrashed"),
            "libraryId": obj.get("libraryId"),
            "livePhotoVideoId": obj.get("livePhotoVideoId"),
            "localDateTime": obj.get("localDateTime"),
            "originalFileName": obj.get("originalFileName"),
            "originalMimeType": obj.get("originalMimeType"),
            "originalPath": obj.get("originalPath"),
            "owner": UserResponseDto.from_dict(obj["owner"])
            if obj.get("owner") is not None
            else None,
            "ownerId": obj.get("ownerId"),
            "people": [
                PersonWithFacesResponseDto.from_dict(_item)
                for _item in obj["people"]
            ]
            if obj.get("people") is not None
            else None,
            "resized": obj.get("resized"),
            "stack": AssetStackResponseDto.from_dict(obj["stack"])
            if obj.get("stack") is not None
            else None,
            "tags": [TagResponseDto.from_dict(_item) for _item in obj["tags"]]
            if obj.get("tags") is not None
            else None,
            "thumbhash": obj.get("thumbhash"),
            "type": obj.get("type"),
            "unassignedFaces": [
                AssetFaceWithoutPersonResponseDto.from_dict(_item)
                for _item in obj["unassignedFaces"]
            ]
            if obj.get("unassignedFaces") is not None
            else None,
            "updatedAt": obj.get("updatedAt"),
            "visibility": obj.get("visibility"),
            "width": obj.get("width"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of AssetResponseDto from a JSON string

Source code in immichpy/client/generated/models/asset_response_dto.py
177
178
179
180
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AssetResponseDto 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/asset_response_dto.py
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
213
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
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 exif_info
    if self.exif_info:
        _dict["exifInfo"] = self.exif_info.to_dict()
    # override the default output from pydantic by calling `to_dict()` of owner
    if self.owner:
        _dict["owner"] = self.owner.to_dict()
    # override the default output from pydantic by calling `to_dict()` of each item in people (list)
    _items = []
    if self.people:
        for _item_people in self.people:
            if _item_people:
                _items.append(_item_people.to_dict())
        _dict["people"] = _items
    # override the default output from pydantic by calling `to_dict()` of stack
    if self.stack:
        _dict["stack"] = self.stack.to_dict()
    # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
    _items = []
    if self.tags:
        for _item_tags in self.tags:
            if _item_tags:
                _items.append(_item_tags.to_dict())
        _dict["tags"] = _items
    # override the default output from pydantic by calling `to_dict()` of each item in unassigned_faces (list)
    _items = []
    if self.unassigned_faces:
        for _item_unassigned_faces in self.unassigned_faces:
            if _item_unassigned_faces:
                _items.append(_item_unassigned_faces.to_dict())
        _dict["unassignedFaces"] = _items
    # set to None if duplicate_id (nullable) is None
    # and model_fields_set contains the field
    if self.duplicate_id is None and "duplicate_id" in self.model_fields_set:
        _dict["duplicateId"] = 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 stack (nullable) is None
    # and model_fields_set contains the field
    if self.stack is None and "stack" in self.model_fields_set:
        _dict["stack"] = 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/asset_response_dto.py
172
173
174
175
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/asset_response_dto.py
168
169
170
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))