Skip to content

User Preferences Update Dto

immichpy.client.generated.models.user_preferences_update_dto.UserPreferencesUpdateDto pydantic-model

Bases: BaseModel

UserPreferencesUpdateDto

Show JSON schema:
{
  "$defs": {
    "AlbumsUpdate": {
      "description": "Album preferences",
      "properties": {
        "defaultAssetOrder": {
          "anyOf": [
            {
              "$ref": "#/$defs/AssetOrder"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Default asset order for albums"
        }
      },
      "title": "AlbumsUpdate",
      "type": "object"
    },
    "AssetOrder": {
      "description": "Asset sort order",
      "enum": [
        "asc",
        "desc"
      ],
      "title": "AssetOrder",
      "type": "string"
    },
    "AvatarUpdate": {
      "description": "AvatarUpdate",
      "properties": {
        "color": {
          "anyOf": [
            {
              "$ref": "#/$defs/UserAvatarColor"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Avatar color"
        }
      },
      "title": "AvatarUpdate",
      "type": "object"
    },
    "CastUpdate": {
      "description": "CastUpdate",
      "properties": {
        "gCastEnabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether Google Cast is enabled",
          "title": "Gcastenabled"
        }
      },
      "title": "CastUpdate",
      "type": "object"
    },
    "DownloadUpdate": {
      "description": "DownloadUpdate",
      "properties": {
        "archiveSize": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum archive size in bytes",
          "title": "Archivesize"
        },
        "includeEmbeddedVideos": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to include embedded videos in downloads",
          "title": "Includeembeddedvideos"
        }
      },
      "title": "DownloadUpdate",
      "type": "object"
    },
    "EmailNotificationsUpdate": {
      "description": "EmailNotificationsUpdate",
      "properties": {
        "albumInvite": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to receive email notifications for album invites",
          "title": "Albuminvite"
        },
        "albumUpdate": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to receive email notifications for album updates",
          "title": "Albumupdate"
        },
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether email notifications are enabled",
          "title": "Enabled"
        }
      },
      "title": "EmailNotificationsUpdate",
      "type": "object"
    },
    "FoldersUpdate": {
      "description": "FoldersUpdate",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether folders are enabled",
          "title": "Enabled"
        },
        "sidebarWeb": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether folders appear in web sidebar",
          "title": "Sidebarweb"
        }
      },
      "title": "FoldersUpdate",
      "type": "object"
    },
    "MemoriesUpdate": {
      "description": "MemoriesUpdate",
      "properties": {
        "duration": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Memory duration in seconds",
          "title": "Duration"
        },
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether memories are enabled",
          "title": "Enabled"
        }
      },
      "title": "MemoriesUpdate",
      "type": "object"
    },
    "PeopleUpdate": {
      "description": "PeopleUpdate",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether people are enabled",
          "title": "Enabled"
        },
        "sidebarWeb": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether people appear in web sidebar",
          "title": "Sidebarweb"
        }
      },
      "title": "PeopleUpdate",
      "type": "object"
    },
    "PurchaseUpdate": {
      "description": "PurchaseUpdate",
      "properties": {
        "hideBuyButtonUntil": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Date until which to hide buy button",
          "title": "Hidebuybuttonuntil"
        },
        "showSupportBadge": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether to show support badge",
          "title": "Showsupportbadge"
        }
      },
      "title": "PurchaseUpdate",
      "type": "object"
    },
    "RatingsUpdate": {
      "description": "RatingsUpdate",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether ratings are enabled",
          "title": "Enabled"
        }
      },
      "title": "RatingsUpdate",
      "type": "object"
    },
    "SharedLinksUpdate": {
      "description": "SharedLinksUpdate",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether shared links are enabled",
          "title": "Enabled"
        },
        "sidebarWeb": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether shared links appear in web sidebar",
          "title": "Sidebarweb"
        }
      },
      "title": "SharedLinksUpdate",
      "type": "object"
    },
    "TagsUpdate": {
      "description": "TagsUpdate",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether tags are enabled",
          "title": "Enabled"
        },
        "sidebarWeb": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether tags appear in web sidebar",
          "title": "Sidebarweb"
        }
      },
      "title": "TagsUpdate",
      "type": "object"
    },
    "UserAvatarColor": {
      "description": "Avatar color",
      "enum": [
        "primary",
        "pink",
        "red",
        "yellow",
        "blue",
        "green",
        "purple",
        "orange",
        "gray",
        "amber"
      ],
      "title": "UserAvatarColor",
      "type": "string"
    }
  },
  "description": "UserPreferencesUpdateDto",
  "properties": {
    "albums": {
      "anyOf": [
        {
          "$ref": "#/$defs/AlbumsUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "avatar": {
      "anyOf": [
        {
          "$ref": "#/$defs/AvatarUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "cast": {
      "anyOf": [
        {
          "$ref": "#/$defs/CastUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "download": {
      "anyOf": [
        {
          "$ref": "#/$defs/DownloadUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "emailNotifications": {
      "anyOf": [
        {
          "$ref": "#/$defs/EmailNotificationsUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "folders": {
      "anyOf": [
        {
          "$ref": "#/$defs/FoldersUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "memories": {
      "anyOf": [
        {
          "$ref": "#/$defs/MemoriesUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "people": {
      "anyOf": [
        {
          "$ref": "#/$defs/PeopleUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "purchase": {
      "anyOf": [
        {
          "$ref": "#/$defs/PurchaseUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "ratings": {
      "anyOf": [
        {
          "$ref": "#/$defs/RatingsUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "sharedLinks": {
      "anyOf": [
        {
          "$ref": "#/$defs/SharedLinksUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "tags": {
      "anyOf": [
        {
          "$ref": "#/$defs/TagsUpdate"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "title": "UserPreferencesUpdateDto",
  "type": "object"
}

Config:

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

Fields:

from_dict classmethod

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

Create an instance of UserPreferencesUpdateDto from a dict

Source code in immichpy/client/generated/models/user_preferences_update_dto.py
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of UserPreferencesUpdateDto from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate(
        {
            "albums": AlbumsUpdate.from_dict(obj["albums"])
            if obj.get("albums") is not None
            else None,
            "avatar": AvatarUpdate.from_dict(obj["avatar"])
            if obj.get("avatar") is not None
            else None,
            "cast": CastUpdate.from_dict(obj["cast"])
            if obj.get("cast") is not None
            else None,
            "download": DownloadUpdate.from_dict(obj["download"])
            if obj.get("download") is not None
            else None,
            "emailNotifications": EmailNotificationsUpdate.from_dict(
                obj["emailNotifications"]
            )
            if obj.get("emailNotifications") is not None
            else None,
            "folders": FoldersUpdate.from_dict(obj["folders"])
            if obj.get("folders") is not None
            else None,
            "memories": MemoriesUpdate.from_dict(obj["memories"])
            if obj.get("memories") is not None
            else None,
            "people": PeopleUpdate.from_dict(obj["people"])
            if obj.get("people") is not None
            else None,
            "purchase": PurchaseUpdate.from_dict(obj["purchase"])
            if obj.get("purchase") is not None
            else None,
            "ratings": RatingsUpdate.from_dict(obj["ratings"])
            if obj.get("ratings") is not None
            else None,
            "sharedLinks": SharedLinksUpdate.from_dict(obj["sharedLinks"])
            if obj.get("sharedLinks") is not None
            else None,
            "tags": TagsUpdate.from_dict(obj["tags"])
            if obj.get("tags") is not None
            else None,
        }
    )
    return _obj

from_json classmethod

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

Create an instance of UserPreferencesUpdateDto from a JSON string

Source code in immichpy/client/generated/models/user_preferences_update_dto.py
88
89
90
91
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of UserPreferencesUpdateDto 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/user_preferences_update_dto.py
 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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 albums
    if self.albums:
        _dict["albums"] = self.albums.to_dict()
    # override the default output from pydantic by calling `to_dict()` of avatar
    if self.avatar:
        _dict["avatar"] = self.avatar.to_dict()
    # override the default output from pydantic by calling `to_dict()` of cast
    if self.cast:
        _dict["cast"] = self.cast.to_dict()
    # override the default output from pydantic by calling `to_dict()` of download
    if self.download:
        _dict["download"] = self.download.to_dict()
    # override the default output from pydantic by calling `to_dict()` of email_notifications
    if self.email_notifications:
        _dict["emailNotifications"] = self.email_notifications.to_dict()
    # override the default output from pydantic by calling `to_dict()` of folders
    if self.folders:
        _dict["folders"] = self.folders.to_dict()
    # override the default output from pydantic by calling `to_dict()` of memories
    if self.memories:
        _dict["memories"] = self.memories.to_dict()
    # override the default output from pydantic by calling `to_dict()` of people
    if self.people:
        _dict["people"] = self.people.to_dict()
    # override the default output from pydantic by calling `to_dict()` of purchase
    if self.purchase:
        _dict["purchase"] = self.purchase.to_dict()
    # override the default output from pydantic by calling `to_dict()` of ratings
    if self.ratings:
        _dict["ratings"] = self.ratings.to_dict()
    # override the default output from pydantic by calling `to_dict()` of shared_links
    if self.shared_links:
        _dict["sharedLinks"] = self.shared_links.to_dict()
    # override the default output from pydantic by calling `to_dict()` of tags
    if self.tags:
        _dict["tags"] = self.tags.to_dict()
    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/user_preferences_update_dto.py
83
84
85
86
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/user_preferences_update_dto.py
79
80
81
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))