Replace Pydantic V1 with Pydantic V2 and make all needed changes. Try using [bump-pydantic](https://github.com/pydantic/bump-pydantic) first and make manual changes where that does not work. Look out for opportunities for simplifications that only work with Pydantic V2 and do them.