Skip to content

Search Album Response Dto

immichpy.client.generated.models.search_album_response_dto.SearchAlbumResponseDto pydantic-model

Bases: BaseModel

SearchAlbumResponseDto

Show JSON schema:
{
  "$defs": {
    "AlbumResponseDto": {
      "description": "AlbumResponseDto",
      "properties": {
        "albumName": {
          "description": "Album name",
          "title": "Albumname",
          "type": "string"
        },
        "albumThumbnailAssetId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Thumbnail asset ID",
          "title": "Albumthumbnailassetid"
        },
        "albumUsers": {
          "description": "First entry is always the album owner. Second entry is the auth user, if it differs from the owner. The rest are ordered alphabetically.",
          "items": {
            "$ref": "#/$defs/AlbumUserResponseDto"
          },
          "minItems": 1,
          "title": "Albumusers",
          "type": "array"
        },
        "assetCount": {
          "description": "Number of assets",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Assetcount",
          "type": "integer"
        },
        "contributorCounts": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ContributorCountResponseDto"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Contributorcounts"
        },
        "createdAt": {
          "description": "Creation date",
          "format": "date-time",
          "title": "Createdat",
          "type": "string"
        },
        "description": {
          "description": "Album description",
          "title": "Description",
          "type": "string"
        },
        "endDate": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "UTC representation of (local) end date (latest asset)",
          "title": "Enddate"
        },
        "hasSharedLink": {
          "description": "Has shared link",
          "title": "Hassharedlink",
          "type": "boolean"
        },
        "id": {
          "description": "Album ID",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "isActivityEnabled": {
          "description": "Activity feed enabled",
          "title": "Isactivityenabled",
          "type": "boolean"
        },
        "lastModifiedAssetTimestamp": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Last modified asset timestamp",
          "title": "Lastmodifiedassettimestamp"
        },
        "order": {
          "anyOf": [
            {
              "$ref": "#/$defs/AssetOrder"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "shared": {
          "description": "Is shared album",
          "title": "Shared",
          "type": "boolean"
        },
        "startDate": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "UTC representation of (local) start date (earliest asset)",
          "title": "Startdate"
        },
        "updatedAt": {
          "description": "Last update date",
          "format": "date-time",
          "title": "Updatedat",
          "type": "string"
        }
      },
      "required": [
        "albumName",
        "albumThumbnailAssetId",
        "albumUsers",
        "assetCount",
        "createdAt",
        "description",
        "hasSharedLink",
        "id",
        "isActivityEnabled",
        "shared",
        "updatedAt"
      ],
      "title": "AlbumResponseDto",
      "type": "object"
    },
    "AlbumUserResponseDto": {
      "description": "AlbumUserResponseDto",
      "properties": {
        "role": {
          "$ref": "#/$defs/AlbumUserRole"
        },
        "user": {
          "$ref": "#/$defs/UserResponseDto"
        }
      },
      "required": [
        "role",
        "user"
      ],
      "title": "AlbumUserResponseDto",
      "type": "object"
    },
    "AlbumUserRole": {
      "description": "Album user role",
      "enum": [
        "editor",
        "owner",
        "viewer"
      ],
      "title": "AlbumUserRole",
      "type": "string"
    },
    "AssetOrder": {
      "description": "Asset sort order",
      "enum": [
        "asc",
        "desc"
      ],
      "title": "AssetOrder",
      "type": "string"
    },
    "ContributorCountResponseDto": {
      "description": "ContributorCountResponseDto",
      "properties": {
        "assetCount": {
          "description": "Number of assets contributed",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Assetcount",
          "type": "integer"
        },
        "userId": {
          "description": "User ID",
          "format": "uuid",
          "title": "Userid",
          "type": "string"
        }
      },
      "required": [
        "assetCount",
        "userId"
      ],
      "title": "ContributorCountResponseDto",
      "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"
    },
    "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": "SearchAlbumResponseDto",
  "properties": {
    "count": {
      "description": "Number of albums in this page",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Count",
      "type": "integer"
    },
    "facets": {
      "items": {
        "$ref": "#/$defs/SearchFacetResponseDto"
      },
      "title": "Facets",
      "type": "array"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/AlbumResponseDto"
      },
      "title": "Items",
      "type": "array"
    },
    "total": {
      "description": "Total number of matching albums",
      "maximum": 9007199254740991,
      "minimum": 0,
      "title": "Total",
      "type": "integer"
    }
  },
  "required": [
    "count",
    "facets",
    "items",
    "total"
  ],
  "title": "SearchAlbumResponseDto",
  "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 albums in this page

total pydantic-field

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

Total number of matching albums

from_dict classmethod

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

Create an instance of SearchAlbumResponseDto from a dict

Source code in immichpy/client/generated/models/search_album_response_dto.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of SearchAlbumResponseDto 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": [AlbumResponseDto.from_dict(_item) for _item in obj["items"]]
            if obj.get("items") is not None
            else None,
            "total": obj.get("total"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of SearchAlbumResponseDto from a JSON string

Source code in immichpy/client/generated/models/search_album_response_dto.py
61
62
63
64
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SearchAlbumResponseDto 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_album_response_dto.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/search_album_response_dto.py
57
58
59
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_album_response_dto.py
53
54
55
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))