[Spaces] Add support for mounted volumes (#4018)
* [Spaces] Add support for mounted volumes
* fix test
* Add Volume.to_dict() to deduplicate serialization logic
The Volume-to-dict serialization was duplicated in hf_api.py (set_space_volumes)
and _jobs_api.py (_create_job_spec). Added a to_dict() method on the Volume
dataclass and updated both call sites to use it.
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
* Apply suggestion from @Wauplin
* Move Volume definition to _space_api.py
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Lucain <Wauplin@users.noreply.github.com>