Skip to content

Search Asset Response Dto

immichpy.client.generated.models.search_asset_response_dto.SearchAssetResponseDto pydantic-model

Bases: BaseModel

SearchAssetResponseDto

Show JSON schema:
{
  "$defs": {
    "AssetResponseDto": {
      "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"
        },
        "duplicateId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Duplicate group ID",
          "title": "Duplicateid"
        },
        "duration": {
          "anyOf": [
            {
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Video/gif duration in milliseconds (null for static images)",
          "title": "Duration"
        },
        "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": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Asset height",
          "title": "Height"
        },
        "id": {
          "description": "Asset ID",
          "format": "uuid",
          "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",
          "format": "uuid",
          "title": "Ownerid",
          "type": "string"
        },
        "people": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PersonResponseDto"
              },
              "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"
        },
        "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": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Asset width",
          "title": "Width"
        }
      },
      "required": [
        "checksum",
        "createdAt",
        "duration",
        "fileCreatedAt",
        "fileModifiedAt",
        "hasMetadata",
        "height",
        "id",
        "isArchived",
        "isEdited",
        "isFavorite",
        "isOffline",
        "isTrashed",
        "localDateTime",
        "originalFileName",
        "originalPath",
        "ownerId",
        "thumbhash",
        "type",
        "updatedAt",
        "visibility",
        "width"
      ],
      "title": "AssetResponseDto",
      "type": "object"
    },
    "AssetStackResponseDto": {
      "description": "AssetStackResponseDto",
      "properties": {
        "assetCount": {
          "description": "Number of assets in stack",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Assetcount",
          "type": "integer"
        },
        "id": {
          "description": "Stack ID",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "primaryAssetId": {
          "description": "Primary asset ID",
          "format": "uuid",
          "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": "EXIF response",
      "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": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image height in pixels",
          "title": "Exifimageheight"
        },
        "exifImageWidth": {
          "anyOf": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "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": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "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": [
            {
              "maximum": 9007199254740991,
              "minimum": -9007199254740991,
              "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": [
            {
              "maximum": 5,
              "minimum": 1,
              "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"
    },
    "PersonResponseDto": {
      "description": "PersonResponseDto",
      "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"
        },
        "id": {
          "description": "Person ID",
          "format": "uuid",
          "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",
        "id",
        "isHidden",
        "name",
        "thumbnailPath"
      ],
      "title": "PersonResponseDto",
      "type": "object"
    },
    "SearchFacetCountResponseDto": {
      "description": "SearchFacetCountResponseDto",
      "properties": {
        "count": {
          "description": "Number of assets with this facet value",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Count",
          "type": "integer"
        },
        "value": {
          "description": "Facet value",
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "count",
        "value"
      ],
      "title": "SearchFacetCountResponseDto",
      "type": "object"
    },
    "SearchFacetResponseDto": {
      "description": "SearchFacetResponseDto",
      "properties": {
        "counts": {
          "items": {
            "$ref": "#/$defs/SearchFacetCountResponseDto"
          },
          "title": "Counts",
          "type": "array"
        },
        "fieldName": {
          "description": "Facet field name",
          "title": "Fieldname",
          "type": "string"
        }
      },
      "required": [
        "counts",
        "fieldName"
      ],
      "title": "SearchFacetResponseDto",
      "type": "object"
    },
    "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",
          "format": "uuid",
          "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": "User 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",
          "format": "uuid",
          "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": "SearchAssetResponseDto",
  "properties": {
    "count": {
      "description": "Number of assets in this page",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Count",
      "type": "integer"
    },
    "facets": {
      "items": {
        "$ref": "#/$defs/SearchFacetResponseDto"
      },
      "title": "Facets",
      "type": "array"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/AssetResponseDto"
      },
      "title": "Items",
      "type": "array"
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Cursor for the next page of results",
      "title": "Nextcursor"
    },
    "nextPage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Next page token",
      "title": "Nextpage"
    },
    "total": {
      "description": "Total number of matching assets",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "count",
    "facets",
    "items",
    "nextCursor",
    "nextPage",
    "total"
  ],
  "title": "SearchAssetResponseDto",
  "type": "object"
}

Config:

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

Fields:

count pydantic-field

count: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]

Number of assets in this page

next_cursor pydantic-field

next_cursor: Optional[StrictStr]

Cursor for the next page of results

next_page pydantic-field

next_page: Optional[StrictStr]

Next page token

total pydantic-field

total: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)]

Total number of matching assets

from_dict classmethod

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

Create an instance of SearchAssetResponseDto from a dict

Source code in immichpy/client/generated/models/search_asset_response_dto.py
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
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of SearchAssetResponseDto 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"),
            "facets": [
                SearchFacetResponseDto.from_dict(_item) for _item in obj["facets"]
            ]
            if obj.get("facets") is not None
            else None,
            "items": [AssetResponseDto.from_dict(_item) for _item in obj["items"]]
            if obj.get("items") is not None
            else None,
            "nextCursor": obj.get("nextCursor"),
            "nextPage": obj.get("nextPage"),
            "total": obj.get("total"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of SearchAssetResponseDto from a JSON string

Source code in immichpy/client/generated/models/search_asset_response_dto.py
74
75
76
77
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SearchAssetResponseDto 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/search_asset_response_dto.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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 facets (list)
    _items = []
    if self.facets:
        for _item_facets in self.facets:
            _items.append(
                _item_facets.to_dict() if _item_facets is not None else None
            )
        _dict["facets"] = _items
    # 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:
            _items.append(
                _item_items.to_dict() if _item_items is not None else None
            )
        _dict["items"] = _items
    # set to None if next_cursor (nullable) is None
    # and model_fields_set contains the field
    if self.next_cursor is None and "next_cursor" in self.model_fields_set:
        _dict["nextCursor"] = None

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

    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/search_asset_response_dto.py
70
71
72
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/search_asset_response_dto.py
66
67
68
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))