optimize webhook serialization (#1592)
* encode webhooks only after knowing they will be sent
Signed-off-by: technillogue <technillogue@gmail.com>
* fix some tests
Signed-off-by: technillogue <technillogue@gmail.com>
* bail out of upload type checks early for strs
Signed-off-by: technillogue <technillogue@gmail.com>
* fix some errors
Signed-off-by: technillogue <technillogue@gmail.com>
* Fix mocks in tests
* Use Status.is_terminal(response.status) consistently
* Fix webhook tests
---------
Signed-off-by: technillogue <technillogue@gmail.com>
Co-authored-by: Mattt Zmuda <mattt@replicate.com>