Skip to content

Release Event V1

immichpy.client.generated.models.release_event_v1.ReleaseEventV1 pydantic-model

Bases: BaseModel

ReleaseEventV1

Show JSON schema:
{
  "$defs": {
    "ReleaseType": {
      "description": "ReleaseType",
      "enum": [
        "major",
        "premajor",
        "minor",
        "preminor",
        "patch",
        "prepatch",
        "prerelease"
      ],
      "title": "ReleaseType",
      "type": "string"
    },
    "ServerVersionResponseDto": {
      "description": "ServerVersionResponseDto",
      "properties": {
        "major": {
          "description": "Major version number",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Major",
          "type": "integer"
        },
        "minor": {
          "description": "Minor version number",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Minor",
          "type": "integer"
        },
        "patch": {
          "description": "Patch version number",
          "maximum": 9007199254740991,
          "minimum": 0,
          "title": "Patch",
          "type": "integer"
        },
        "prerelease": {
          "anyOf": [
            {
              "maximum": 9007199254740991,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Pre-release version number",
          "title": "Prerelease"
        }
      },
      "required": [
        "major",
        "minor",
        "patch",
        "prerelease"
      ],
      "title": "ServerVersionResponseDto",
      "type": "object"
    }
  },
  "description": "ReleaseEventV1",
  "properties": {
    "checkedAt": {
      "description": "When the server last checked for a latest version. As an ISO timestamp",
      "title": "Checkedat",
      "type": "string"
    },
    "isAvailable": {
      "description": "Whether a new version is available",
      "title": "Isavailable",
      "type": "boolean"
    },
    "releaseVersion": {
      "$ref": "#/$defs/ServerVersionResponseDto"
    },
    "serverVersion": {
      "$ref": "#/$defs/ServerVersionResponseDto"
    },
    "type": {
      "$ref": "#/$defs/ReleaseType"
    }
  },
  "required": [
    "checkedAt",
    "isAvailable",
    "releaseVersion",
    "serverVersion",
    "type"
  ],
  "title": "ReleaseEventV1",
  "type": "object"
}

Config:

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

Fields:

checked_at pydantic-field

checked_at: StrictStr

When the server last checked for a latest version. As an ISO timestamp

is_available pydantic-field

is_available: StrictBool

Whether a new version is available

from_dict classmethod

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

Create an instance of ReleaseEventV1 from a dict

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

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

    _obj = cls.model_validate(
        {
            "checkedAt": obj.get("checkedAt"),
            "isAvailable": obj.get("isAvailable"),
            "releaseVersion": ServerVersionResponseDto.from_dict(
                obj["releaseVersion"]
            )
            if obj.get("releaseVersion") is not None
            else None,
            "serverVersion": ServerVersionResponseDto.from_dict(
                obj["serverVersion"]
            )
            if obj.get("serverVersion") is not None
            else None,
            "type": obj.get("type"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of ReleaseEventV1 from a JSON string

Source code in immichpy/client/generated/models/release_event_v1.py
68
69
70
71
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of ReleaseEventV1 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/release_event_v1.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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 release_version
    if self.release_version:
        _dict["releaseVersion"] = self.release_version.to_dict()
    # override the default output from pydantic by calling `to_dict()` of server_version
    if self.server_version:
        _dict["serverVersion"] = self.server_version.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/release_event_v1.py
64
65
66
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/release_event_v1.py
60
61
62
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))