Skip to content

User Admin Response Dto

immichpy.client.generated.models.user_admin_response_dto.UserAdminResponseDto pydantic-model

Bases: BaseModel

UserAdminResponseDto

Show JSON schema:
{
  "$defs": {
    "UserAvatarColor": {
      "description": "User avatar color",
      "enum": [
        "primary",
        "pink",
        "red",
        "yellow",
        "blue",
        "green",
        "purple",
        "orange",
        "gray",
        "amber"
      ],
      "title": "UserAvatarColor",
      "type": "string"
    },
    "UserLicense": {
      "description": "UserLicense",
      "properties": {
        "activatedAt": {
          "description": "Activation date",
          "examples": [
            "2024-01-01T00:00:00Z"
          ],
          "format": "date-time",
          "title": "Activatedat",
          "type": "string"
        },
        "activationKey": {
          "description": "Activation key",
          "title": "Activationkey",
          "type": "string"
        },
        "licenseKey": {
          "description": "License key (format: /^IM(SV|CL)(-[\\dA-Za-z]{4}){8}$/)",
          "title": "Licensekey",
          "type": "string"
        }
      },
      "required": [
        "activatedAt",
        "activationKey",
        "licenseKey"
      ],
      "title": "UserLicense",
      "type": "object"
    },
    "UserStatus": {
      "description": "User status",
      "enum": [
        "active",
        "removing",
        "deleted"
      ],
      "title": "UserStatus",
      "type": "string"
    }
  },
  "description": "UserAdminResponseDto",
  "properties": {
    "avatarColor": {
      "$ref": "#/$defs/UserAvatarColor"
    },
    "clusterGroupId": {
      "description": "Cluster group the user is a member of",
      "format": "uuid",
      "title": "Clustergroupid",
      "type": "string"
    },
    "createdAt": {
      "description": "Creation date",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "format": "date-time",
      "title": "Createdat",
      "type": "string"
    },
    "deletedAt": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Deletion date",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "title": "Deletedat"
    },
    "email": {
      "description": "User email",
      "title": "Email",
      "type": "string"
    },
    "id": {
      "description": "User ID",
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "isAdmin": {
      "description": "Is admin user",
      "title": "Isadmin",
      "type": "boolean"
    },
    "license": {
      "anyOf": [
        {
          "$ref": "#/$defs/UserLicense"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "description": "User name",
      "title": "Name",
      "type": "string"
    },
    "oauthId": {
      "description": "OAuth ID",
      "title": "Oauthid",
      "type": "string"
    },
    "profileChangedAt": {
      "description": "Profile change date",
      "format": "date-time",
      "title": "Profilechangedat",
      "type": "string"
    },
    "profileImagePath": {
      "description": "Profile image path",
      "title": "Profileimagepath",
      "type": "string"
    },
    "quotaSizeInBytes": {
      "anyOf": [
        {
          "maximum": 9007199254740991,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Storage quota in bytes",
      "title": "Quotasizeinbytes"
    },
    "quotaUsageInBytes": {
      "anyOf": [
        {
          "maximum": 9007199254740991,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Storage usage in bytes",
      "title": "Quotausageinbytes"
    },
    "shouldChangePassword": {
      "description": "Require password change on next login",
      "title": "Shouldchangepassword",
      "type": "boolean"
    },
    "status": {
      "$ref": "#/$defs/UserStatus"
    },
    "storageLabel": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Storage label",
      "title": "Storagelabel"
    },
    "updatedAt": {
      "description": "Last update date",
      "examples": [
        "2024-01-01T00:00:00Z"
      ],
      "format": "date-time",
      "title": "Updatedat",
      "type": "string"
    }
  },
  "required": [
    "avatarColor",
    "clusterGroupId",
    "createdAt",
    "deletedAt",
    "email",
    "id",
    "isAdmin",
    "license",
    "name",
    "oauthId",
    "profileChangedAt",
    "profileImagePath",
    "quotaSizeInBytes",
    "quotaUsageInBytes",
    "shouldChangePassword",
    "status",
    "storageLabel",
    "updatedAt"
  ],
  "title": "UserAdminResponseDto",
  "type": "object"
}

Config:

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

Fields:

Validators:

cluster_group_id pydantic-field

cluster_group_id: UUID

Cluster group the user is a member of

created_at pydantic-field

created_at: datetime

Creation date

deleted_at pydantic-field

deleted_at: Optional[datetime]

Deletion date

email pydantic-field

email: Annotated[str, Field(strict=True)]

User email

id pydantic-field

id: UUID

User ID

is_admin pydantic-field

is_admin: StrictBool

Is admin user

name pydantic-field

name: StrictStr

User name

oauth_id pydantic-field

oauth_id: StrictStr

OAuth ID

profile_changed_at pydantic-field

profile_changed_at: datetime

Profile change date

profile_image_path pydantic-field

profile_image_path: StrictStr

Profile image path

quota_size_in_bytes pydantic-field

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

Storage quota in bytes

quota_usage_in_bytes pydantic-field

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

Storage usage in bytes

should_change_password pydantic-field

should_change_password: StrictBool

Require password change on next login

storage_label pydantic-field

storage_label: Optional[StrictStr]

Storage label

updated_at pydantic-field

updated_at: datetime

Last update date

cluster_group_id_validate_regular_expression pydantic-validator

cluster_group_id_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
110
111
112
113
114
115
116
117
118
119
120
@field_validator("cluster_group_id", mode="before")
def cluster_group_id_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and not re.match(
        r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/"
        )
    return value

created_at_validate_regular_expression pydantic-validator

created_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
122
123
124
125
126
127
128
129
130
131
132
@field_validator("created_at", mode="before")
def created_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and not re.match(
        r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/"
        )
    return value

deleted_at_validate_regular_expression pydantic-validator

deleted_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@field_validator("deleted_at", mode="before")
def deleted_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if value is None:
        return value

    if isinstance(value, str) and not re.match(
        r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/"
        )
    return value

email_validate_regular_expression pydantic-validator

email_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
149
150
151
152
153
154
155
156
157
158
159
@field_validator("email", mode="before")
def email_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and not re.match(
        r"^[\p{L}\p{M}\p{N}.!#$%&\'*+\/=?^_`{|}~-]+@[\p{L}\p{N}](?:[\p{L}\p{M}\p{N}-]{0,61}[\p{L}\p{M}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{M}\p{N}-]{0,61}[\p{L}\p{M}\p{N}])?)*$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^[\p{L}\p{M}\p{N}.!#$%&'*+\/=?^_`{|}~-]+@[\p{L}\p{N}](?:[\p{L}\p{M}\p{N}-]{0,61}[\p{L}\p{M}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{M}\p{N}-]{0,61}[\p{L}\p{M}\p{N}])?)*$/"
        )
    return value

from_dict classmethod

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

Create an instance of UserAdminResponseDto from a dict

Source code in immichpy/client/generated/models/user_admin_response_dto.py
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of UserAdminResponseDto from a dict"""
    if obj is None:
        return None

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

    _obj = cls.model_validate(
        {
            "avatarColor": obj.get("avatarColor"),
            "clusterGroupId": obj.get("clusterGroupId"),
            "createdAt": obj.get("createdAt"),
            "deletedAt": obj.get("deletedAt"),
            "email": obj.get("email"),
            "id": obj.get("id"),
            "isAdmin": obj.get("isAdmin"),
            "license": UserLicense.from_dict(obj["license"])
            if obj.get("license") is not None
            else None,
            "name": obj.get("name"),
            "oauthId": obj.get("oauthId"),
            "profileChangedAt": obj.get("profileChangedAt"),
            "profileImagePath": obj.get("profileImagePath"),
            "quotaSizeInBytes": obj.get("quotaSizeInBytes"),
            "quotaUsageInBytes": obj.get("quotaUsageInBytes"),
            "shouldChangePassword": obj.get("shouldChangePassword"),
            "status": obj.get("status"),
            "storageLabel": obj.get("storageLabel"),
            "updatedAt": obj.get("updatedAt"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of UserAdminResponseDto from a JSON string

Source code in immichpy/client/generated/models/user_admin_response_dto.py
200
201
202
203
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of UserAdminResponseDto from a JSON string"""
    return cls.from_dict(json.loads(json_str))

id_validate_regular_expression pydantic-validator

id_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
161
162
163
164
165
166
167
168
169
170
171
@field_validator("id", mode="before")
def id_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and not re.match(
        r"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/"
        )
    return value

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_admin_response_dto.py
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
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 license
    if self.license:
        _dict["license"] = self.license.to_dict()
    # set to None if deleted_at (nullable) is None
    # and model_fields_set contains the field
    if self.deleted_at is None and "deleted_at" in self.model_fields_set:
        _dict["deletedAt"] = None

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

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

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

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

    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/user_admin_response_dto.py
196
197
198
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/user_admin_response_dto.py
192
193
194
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))

updated_at_validate_regular_expression pydantic-validator

updated_at_validate_regular_expression(value)

Validates the regular expression

Source code in immichpy/client/generated/models/user_admin_response_dto.py
173
174
175
176
177
178
179
180
181
182
183
@field_validator("updated_at", mode="before")
def updated_at_validate_regular_expression(cls, value):
    """Validates the regular expression"""
    if isinstance(value, str) and not re.match(
        r"^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$",
        value,
    ):
        raise ValueError(
            r"must validate the regular expression /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/"
        )
    return value