Skip to content

User Preferences Response Dto

immichpy.client.generated.models.user_preferences_response_dto.UserPreferencesResponseDto pydantic-model

Bases: BaseModel

UserPreferencesResponseDto

Show JSON schema:
{
  "$defs": {
    "AlbumsResponse": {
      "description": "AlbumsResponse",
      "properties": {
        "defaultAssetOrder": {
          "$ref": "#/$defs/AssetOrder",
          "description": "Default asset order for albums"
        }
      },
      "required": [
        "defaultAssetOrder"
      ],
      "title": "AlbumsResponse",
      "type": "object"
    },
    "AssetOrder": {
      "description": "Asset sort order",
      "enum": [
        "asc",
        "desc"
      ],
      "title": "AssetOrder",
      "type": "string"
    },
    "CastResponse": {
      "description": "CastResponse",
      "properties": {
        "gCastEnabled": {
          "description": "Whether Google Cast is enabled",
          "title": "Gcastenabled",
          "type": "boolean"
        }
      },
      "required": [
        "gCastEnabled"
      ],
      "title": "CastResponse",
      "type": "object"
    },
    "DownloadResponse": {
      "description": "DownloadResponse",
      "properties": {
        "archiveSize": {
          "description": "Maximum archive size in bytes",
          "title": "Archivesize",
          "type": "integer"
        },
        "includeEmbeddedVideos": {
          "description": "Whether to include embedded videos in downloads",
          "title": "Includeembeddedvideos",
          "type": "boolean"
        }
      },
      "required": [
        "archiveSize",
        "includeEmbeddedVideos"
      ],
      "title": "DownloadResponse",
      "type": "object"
    },
    "EmailNotificationsResponse": {
      "description": "EmailNotificationsResponse",
      "properties": {
        "albumInvite": {
          "description": "Whether to receive email notifications for album invites",
          "title": "Albuminvite",
          "type": "boolean"
        },
        "albumUpdate": {
          "description": "Whether to receive email notifications for album updates",
          "title": "Albumupdate",
          "type": "boolean"
        },
        "enabled": {
          "description": "Whether email notifications are enabled",
          "title": "Enabled",
          "type": "boolean"
        }
      },
      "required": [
        "albumInvite",
        "albumUpdate",
        "enabled"
      ],
      "title": "EmailNotificationsResponse",
      "type": "object"
    },
    "FoldersResponse": {
      "description": "FoldersResponse",
      "properties": {
        "enabled": {
          "description": "Whether folders are enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "sidebarWeb": {
          "description": "Whether folders appear in web sidebar",
          "title": "Sidebarweb",
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "sidebarWeb"
      ],
      "title": "FoldersResponse",
      "type": "object"
    },
    "MemoriesResponse": {
      "description": "MemoriesResponse",
      "properties": {
        "duration": {
          "description": "Memory duration in seconds",
          "title": "Duration",
          "type": "integer"
        },
        "enabled": {
          "description": "Whether memories are enabled",
          "title": "Enabled",
          "type": "boolean"
        }
      },
      "required": [
        "duration",
        "enabled"
      ],
      "title": "MemoriesResponse",
      "type": "object"
    },
    "PeopleResponse": {
      "description": "PeopleResponse",
      "properties": {
        "enabled": {
          "description": "Whether people are enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "sidebarWeb": {
          "description": "Whether people appear in web sidebar",
          "title": "Sidebarweb",
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "sidebarWeb"
      ],
      "title": "PeopleResponse",
      "type": "object"
    },
    "PurchaseResponse": {
      "description": "PurchaseResponse",
      "properties": {
        "hideBuyButtonUntil": {
          "description": "Date until which to hide buy button",
          "title": "Hidebuybuttonuntil",
          "type": "string"
        },
        "showSupportBadge": {
          "description": "Whether to show support badge",
          "title": "Showsupportbadge",
          "type": "boolean"
        }
      },
      "required": [
        "hideBuyButtonUntil",
        "showSupportBadge"
      ],
      "title": "PurchaseResponse",
      "type": "object"
    },
    "RatingsResponse": {
      "description": "RatingsResponse",
      "properties": {
        "enabled": {
          "description": "Whether ratings are enabled",
          "title": "Enabled",
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "title": "RatingsResponse",
      "type": "object"
    },
    "SharedLinksResponse": {
      "description": "SharedLinksResponse",
      "properties": {
        "enabled": {
          "description": "Whether shared links are enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "sidebarWeb": {
          "description": "Whether shared links appear in web sidebar",
          "title": "Sidebarweb",
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "sidebarWeb"
      ],
      "title": "SharedLinksResponse",
      "type": "object"
    },
    "TagsResponse": {
      "description": "TagsResponse",
      "properties": {
        "enabled": {
          "description": "Whether tags are enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "sidebarWeb": {
          "description": "Whether tags appear in web sidebar",
          "title": "Sidebarweb",
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "sidebarWeb"
      ],
      "title": "TagsResponse",
      "type": "object"
    }
  },
  "description": "UserPreferencesResponseDto",
  "properties": {
    "albums": {
      "$ref": "#/$defs/AlbumsResponse"
    },
    "cast": {
      "$ref": "#/$defs/CastResponse"
    },
    "download": {
      "$ref": "#/$defs/DownloadResponse"
    },
    "emailNotifications": {
      "$ref": "#/$defs/EmailNotificationsResponse"
    },
    "folders": {
      "$ref": "#/$defs/FoldersResponse"
    },
    "memories": {
      "$ref": "#/$defs/MemoriesResponse"
    },
    "people": {
      "$ref": "#/$defs/PeopleResponse"
    },
    "purchase": {
      "$ref": "#/$defs/PurchaseResponse"
    },
    "ratings": {
      "$ref": "#/$defs/RatingsResponse"
    },
    "sharedLinks": {
      "$ref": "#/$defs/SharedLinksResponse"
    },
    "tags": {
      "$ref": "#/$defs/TagsResponse"
    }
  },
  "required": [
    "albums",
    "cast",
    "download",
    "emailNotifications",
    "folders",
    "memories",
    "people",
    "purchase",
    "ratings",
    "sharedLinks",
    "tags"
  ],
  "title": "UserPreferencesResponseDto",
  "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 UserPreferencesResponseDto from a dict

Source code in immichpy/client/generated/models/user_preferences_response_dto.py
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of UserPreferencesResponseDto from a dict"""
    if obj is None:
        return None

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

    _obj = cls.model_validate(
        {
            "albums": AlbumsResponse.from_dict(obj["albums"])
            if obj.get("albums") is not None
            else None,
            "cast": CastResponse.from_dict(obj["cast"])
            if obj.get("cast") is not None
            else None,
            "download": DownloadResponse.from_dict(obj["download"])
            if obj.get("download") is not None
            else None,
            "emailNotifications": EmailNotificationsResponse.from_dict(
                obj["emailNotifications"]
            )
            if obj.get("emailNotifications") is not None
            else None,
            "folders": FoldersResponse.from_dict(obj["folders"])
            if obj.get("folders") is not None
            else None,
            "memories": MemoriesResponse.from_dict(obj["memories"])
            if obj.get("memories") is not None
            else None,
            "people": PeopleResponse.from_dict(obj["people"])
            if obj.get("people") is not None
            else None,
            "purchase": PurchaseResponse.from_dict(obj["purchase"])
            if obj.get("purchase") is not None
            else None,
            "ratings": RatingsResponse.from_dict(obj["ratings"])
            if obj.get("ratings") is not None
            else None,
            "sharedLinks": SharedLinksResponse.from_dict(obj["sharedLinks"])
            if obj.get("sharedLinks") is not None
            else None,
            "tags": TagsResponse.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 UserPreferencesResponseDto from a JSON string

Source code in immichpy/client/generated/models/user_preferences_response_dto.py
83
84
85
86
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of UserPreferencesResponseDto 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_response_dto.py
 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 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_response_dto.py
78
79
80
81
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_response_dto.py
74
75
76
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))