Skip to content

System Config Image Dto

immichpy.client.generated.models.system_config_image_dto.SystemConfigImageDto pydantic-model

Bases: BaseModel

SystemConfigImageDto

Show JSON schema:
{
  "$defs": {
    "Colorspace": {
      "description": "Colorspace",
      "enum": [
        "srgb",
        "p3"
      ],
      "title": "Colorspace",
      "type": "string"
    },
    "ImageFormat": {
      "description": "Image format",
      "enum": [
        "jpeg",
        "webp"
      ],
      "title": "ImageFormat",
      "type": "string"
    },
    "SystemConfigGeneratedFullsizeImageDto": {
      "description": "SystemConfigGeneratedFullsizeImageDto",
      "properties": {
        "enabled": {
          "description": "Enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "format": {
          "$ref": "#/$defs/ImageFormat"
        },
        "progressive": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "description": "Progressive",
          "title": "Progressive"
        },
        "quality": {
          "description": "Quality",
          "maximum": 100,
          "minimum": 1,
          "title": "Quality",
          "type": "integer"
        }
      },
      "required": [
        "enabled",
        "format",
        "quality"
      ],
      "title": "SystemConfigGeneratedFullsizeImageDto",
      "type": "object"
    },
    "SystemConfigGeneratedImageDto": {
      "description": "SystemConfigGeneratedImageDto",
      "properties": {
        "format": {
          "$ref": "#/$defs/ImageFormat"
        },
        "progressive": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": false,
          "title": "Progressive"
        },
        "quality": {
          "description": "Quality",
          "maximum": 100,
          "minimum": 1,
          "title": "Quality",
          "type": "integer"
        },
        "size": {
          "description": "Size",
          "minimum": 1,
          "title": "Size",
          "type": "integer"
        }
      },
      "required": [
        "format",
        "quality",
        "size"
      ],
      "title": "SystemConfigGeneratedImageDto",
      "type": "object"
    }
  },
  "description": "SystemConfigImageDto",
  "properties": {
    "colorspace": {
      "$ref": "#/$defs/Colorspace"
    },
    "extractEmbedded": {
      "description": "Extract embedded",
      "title": "Extractembedded",
      "type": "boolean"
    },
    "fullsize": {
      "$ref": "#/$defs/SystemConfigGeneratedFullsizeImageDto"
    },
    "preview": {
      "$ref": "#/$defs/SystemConfigGeneratedImageDto"
    },
    "thumbnail": {
      "$ref": "#/$defs/SystemConfigGeneratedImageDto"
    }
  },
  "required": [
    "colorspace",
    "extractEmbedded",
    "fullsize",
    "preview",
    "thumbnail"
  ],
  "title": "SystemConfigImageDto",
  "type": "object"
}

Config:

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

Fields:

colorspace pydantic-field

colorspace: Colorspace

Colorspace

extract_embedded pydantic-field

extract_embedded: StrictBool

Extract embedded

from_dict classmethod

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

Create an instance of SystemConfigImageDto from a dict

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

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

    _obj = cls.model_validate(
        {
            "colorspace": obj.get("colorspace"),
            "extractEmbedded": obj.get("extractEmbedded"),
            "fullsize": SystemConfigGeneratedFullsizeImageDto.from_dict(
                obj["fullsize"]
            )
            if obj.get("fullsize") is not None
            else None,
            "preview": SystemConfigGeneratedImageDto.from_dict(obj["preview"])
            if obj.get("preview") is not None
            else None,
            "thumbnail": SystemConfigGeneratedImageDto.from_dict(obj["thumbnail"])
            if obj.get("thumbnail") is not None
            else None,
        }
    )
    return _obj

from_json classmethod

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

Create an instance of SystemConfigImageDto from a JSON string

Source code in immichpy/client/generated/models/system_config_image_dto.py
67
68
69
70
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SystemConfigImageDto 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/system_config_image_dto.py
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
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 fullsize
    if self.fullsize:
        _dict["fullsize"] = self.fullsize.to_dict()
    # override the default output from pydantic by calling `to_dict()` of preview
    if self.preview:
        _dict["preview"] = self.preview.to_dict()
    # override the default output from pydantic by calling `to_dict()` of thumbnail
    if self.thumbnail:
        _dict["thumbnail"] = self.thumbnail.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/system_config_image_dto.py
62
63
64
65
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/system_config_image_dto.py
58
59
60
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))