Skip to content

Update Asset Dto

immichpy.client.generated.models.update_asset_dto.UpdateAssetDto pydantic-model

Bases: BaseModel

UpdateAssetDto

Show JSON schema:
{
  "$defs": {
    "AssetVisibility": {
      "description": "Asset visibility",
      "enum": [
        "archive",
        "timeline",
        "hidden",
        "locked"
      ],
      "title": "AssetVisibility",
      "type": "string"
    }
  },
  "description": "UpdateAssetDto",
  "properties": {
    "dateTimeOriginal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Original date and time",
      "title": "Datetimeoriginal"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Asset description",
      "title": "Description"
    },
    "isFavorite": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Mark as favorite",
      "title": "Isfavorite"
    },
    "latitude": {
      "anyOf": [
        {
          "maximum": 90,
          "minimum": -90,
          "type": "number"
        },
        {
          "maximum": 90,
          "minimum": -90,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Latitude coordinate",
      "title": "Latitude"
    },
    "livePhotoVideoId": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Live photo video ID",
      "title": "Livephotovideoid"
    },
    "longitude": {
      "anyOf": [
        {
          "maximum": 180,
          "minimum": -180,
          "type": "number"
        },
        {
          "maximum": 180,
          "minimum": -180,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Longitude coordinate",
      "title": "Longitude"
    },
    "rating": {
      "anyOf": [
        {
          "maximum": 5,
          "minimum": -1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Rating in range [1-5] (starred), -1 (rejected), or null (unrated)",
      "title": "Rating"
    },
    "visibility": {
      "anyOf": [
        {
          "$ref": "#/$defs/AssetVisibility"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "title": "UpdateAssetDto",
  "type": "object"
}

Config:

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

Fields:

date_time_original pydantic-field

date_time_original: Optional[StrictStr] = None

Original date and time

description pydantic-field

description: Optional[StrictStr] = None

Asset description

is_favorite pydantic-field

is_favorite: Optional[StrictBool] = None

Mark as favorite

latitude pydantic-field

latitude: Optional[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]]] = None

Latitude coordinate

live_photo_video_id pydantic-field

live_photo_video_id: Optional[UUID] = None

Live photo video ID

longitude pydantic-field

longitude: Optional[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]]] = None

Longitude coordinate

rating pydantic-field

rating: Optional[Annotated[int, Field(le=5, strict=True, ge=-1)]] = None

Rating in range [1-5] (starred), -1 (rejected), or null (unrated)

from_dict classmethod

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

Create an instance of UpdateAssetDto from a dict

Source code in immichpy/client/generated/models/update_asset_dto.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of UpdateAssetDto from a dict"""
    if obj is None:
        return None

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

    _obj = cls.model_validate(
        {
            "dateTimeOriginal": obj.get("dateTimeOriginal"),
            "description": obj.get("description"),
            "isFavorite": obj.get("isFavorite"),
            "latitude": obj.get("latitude"),
            "livePhotoVideoId": obj.get("livePhotoVideoId"),
            "longitude": obj.get("longitude"),
            "rating": obj.get("rating"),
            "visibility": obj.get("visibility"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of UpdateAssetDto from a JSON string

Source code in immichpy/client/generated/models/update_asset_dto.py
89
90
91
92
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of UpdateAssetDto 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/update_asset_dto.py
 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
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,
    )
    # set to None if live_photo_video_id (nullable) is None
    # and model_fields_set contains the field
    if (
        self.live_photo_video_id is None
        and "live_photo_video_id" in self.model_fields_set
    ):
        _dict["livePhotoVideoId"] = None

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

    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

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