Skip to content

Server Config Dto

immichpy.client.generated.models.server_config_dto.ServerConfigDto pydantic-model

Bases: BaseModel

ServerConfigDto

Show JSON schema:
{
  "description": "ServerConfigDto",
  "properties": {
    "externalDomain": {
      "description": "External domain URL",
      "title": "Externaldomain",
      "type": "string"
    },
    "isInitialized": {
      "description": "Whether the server has been initialized",
      "title": "Isinitialized",
      "type": "boolean"
    },
    "isOnboarded": {
      "description": "Whether the admin has completed onboarding",
      "title": "Isonboarded",
      "type": "boolean"
    },
    "loginPageMessage": {
      "description": "Login page message",
      "title": "Loginpagemessage",
      "type": "string"
    },
    "maintenanceMode": {
      "description": "Whether maintenance mode is active",
      "title": "Maintenancemode",
      "type": "boolean"
    },
    "mapDarkStyleUrl": {
      "description": "Map dark style URL",
      "title": "Mapdarkstyleurl",
      "type": "string"
    },
    "mapLightStyleUrl": {
      "description": "Map light style URL",
      "title": "Maplightstyleurl",
      "type": "string"
    },
    "oauthButtonText": {
      "description": "OAuth button text",
      "title": "Oauthbuttontext",
      "type": "string"
    },
    "publicUsers": {
      "description": "Whether public user registration is enabled",
      "title": "Publicusers",
      "type": "boolean"
    },
    "trashDays": {
      "description": "Number of days before trashed assets are permanently deleted",
      "title": "Trashdays",
      "type": "integer"
    },
    "userDeleteDelay": {
      "description": "Delay in days before deleted users are permanently removed",
      "title": "Userdeletedelay",
      "type": "integer"
    }
  },
  "required": [
    "externalDomain",
    "isInitialized",
    "isOnboarded",
    "loginPageMessage",
    "maintenanceMode",
    "mapDarkStyleUrl",
    "mapLightStyleUrl",
    "oauthButtonText",
    "publicUsers",
    "trashDays",
    "userDeleteDelay"
  ],
  "title": "ServerConfigDto",
  "type": "object"
}

Config:

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

Fields:

external_domain pydantic-field

external_domain: StrictStr

External domain URL

is_initialized pydantic-field

is_initialized: StrictBool

Whether the server has been initialized

is_onboarded pydantic-field

is_onboarded: StrictBool

Whether the admin has completed onboarding

login_page_message pydantic-field

login_page_message: StrictStr

Login page message

maintenance_mode pydantic-field

maintenance_mode: StrictBool

Whether maintenance mode is active

map_dark_style_url pydantic-field

map_dark_style_url: StrictStr

Map dark style URL

map_light_style_url pydantic-field

map_light_style_url: StrictStr

Map light style URL

oauth_button_text pydantic-field

oauth_button_text: StrictStr

OAuth button text

public_users pydantic-field

public_users: StrictBool

Whether public user registration is enabled

trash_days pydantic-field

trash_days: StrictInt

Number of days before trashed assets are permanently deleted

user_delete_delay pydantic-field

user_delete_delay: StrictInt

Delay in days before deleted users are permanently removed

from_dict classmethod

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

Create an instance of ServerConfigDto from a dict

Source code in immichpy/client/generated/models/server_config_dto.py
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
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of ServerConfigDto from a dict"""
    if obj is None:
        return None

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

    _obj = cls.model_validate(
        {
            "externalDomain": obj.get("externalDomain"),
            "isInitialized": obj.get("isInitialized"),
            "isOnboarded": obj.get("isOnboarded"),
            "loginPageMessage": obj.get("loginPageMessage"),
            "maintenanceMode": obj.get("maintenanceMode"),
            "mapDarkStyleUrl": obj.get("mapDarkStyleUrl"),
            "mapLightStyleUrl": obj.get("mapLightStyleUrl"),
            "oauthButtonText": obj.get("oauthButtonText"),
            "publicUsers": obj.get("publicUsers"),
            "trashDays": obj.get("trashDays"),
            "userDeleteDelay": obj.get("userDeleteDelay"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of ServerConfigDto from a JSON string

Source code in immichpy/client/generated/models/server_config_dto.py
94
95
96
97
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ServerConfigDto 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/server_config_dto.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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,
    )
    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/server_config_dto.py
89
90
91
92
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/server_config_dto.py
85
86
87
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))