Skip to content

Asset Bulk Update Dto

immichpy.client.generated.models.asset_bulk_update_dto.AssetBulkUpdateDto pydantic-model

Bases: BaseModel

AssetBulkUpdateDto

Show JSON schema:
{
  "$defs": {
    "AssetVisibility": {
      "description": "Asset visibility",
      "enum": [
        "archive",
        "timeline",
        "hidden",
        "locked"
      ],
      "title": "AssetVisibility",
      "type": "string"
    }
  },
  "description": "AssetBulkUpdateDto",
  "properties": {
    "dateTimeOriginal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Original date and time",
      "title": "Datetimeoriginal"
    },
    "dateTimeRelative": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Relative time offset in seconds",
      "title": "Datetimerelative"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Asset description",
      "title": "Description"
    },
    "duplicateId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Duplicate ID",
      "title": "Duplicateid"
    },
    "ids": {
      "description": "Asset IDs to update",
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "title": "Ids",
      "type": "array"
    },
    "isFavorite": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Mark as favorite",
      "title": "Isfavorite"
    },
    "latitude": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Latitude coordinate",
      "title": "Latitude"
    },
    "longitude": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Longitude coordinate",
      "title": "Longitude"
    },
    "rating": {
      "anyOf": [
        {
          "maximum": 5,
          "minimum": -1,
          "type": "number"
        },
        {
          "maximum": 5,
          "minimum": -1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Rating in range [1-5], or null for unrated",
      "title": "Rating"
    },
    "timeZone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Time zone (IANA timezone)",
      "title": "Timezone"
    },
    "visibility": {
      "anyOf": [
        {
          "$ref": "#/$defs/AssetVisibility"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Asset visibility"
    }
  },
  "required": [
    "ids"
  ],
  "title": "AssetBulkUpdateDto",
  "type": "object"
}

Config:

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

Fields:

date_time_original pydantic-field

date_time_original: Optional[StrictStr] = None

Original date and time

date_time_relative pydantic-field

date_time_relative: Optional[Union[StrictFloat, StrictInt]] = None

Relative time offset in seconds

description pydantic-field

description: Optional[StrictStr] = None

Asset description

duplicate_id pydantic-field

duplicate_id: Optional[StrictStr] = None

Duplicate ID

ids pydantic-field

ids: List[UUID]

Asset IDs to update

is_favorite pydantic-field

is_favorite: Optional[StrictBool] = None

Mark as favorite

latitude pydantic-field

latitude: Optional[Union[StrictFloat, StrictInt]] = None

Latitude coordinate

longitude pydantic-field

longitude: Optional[Union[StrictFloat, StrictInt]] = None

Longitude coordinate

rating pydantic-field

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

Rating in range [1-5], or null for unrated

time_zone pydantic-field

time_zone: Optional[StrictStr] = None

Time zone (IANA timezone)

visibility pydantic-field

visibility: Optional[AssetVisibility] = None

Asset visibility

from_dict classmethod

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

Create an instance of AssetBulkUpdateDto from a dict

Source code in immichpy/client/generated/models/asset_bulk_update_dto.py
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of AssetBulkUpdateDto 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"),
            "dateTimeRelative": obj.get("dateTimeRelative"),
            "description": obj.get("description"),
            "duplicateId": obj.get("duplicateId"),
            "ids": obj.get("ids"),
            "isFavorite": obj.get("isFavorite"),
            "latitude": obj.get("latitude"),
            "longitude": obj.get("longitude"),
            "rating": obj.get("rating"),
            "timeZone": obj.get("timeZone"),
            "visibility": obj.get("visibility"),
        }
    )
    return _obj

from_json classmethod

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

Create an instance of AssetBulkUpdateDto from a JSON string

Source code in immichpy/client/generated/models/asset_bulk_update_dto.py
106
107
108
109
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of AssetBulkUpdateDto 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/asset_bulk_update_dto.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 duplicate_id (nullable) is None
    # and model_fields_set contains the field
    if self.duplicate_id is None and "duplicate_id" in self.model_fields_set:
        _dict["duplicateId"] = 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/asset_bulk_update_dto.py
101
102
103
104
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/asset_bulk_update_dto.py
97
98
99
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))