# Path: pyuploadcare/transformations/video.py
# class VideoFormat(StrEnum):
#     webm = "webm"
#     ogg = "ogg"
#     mp4 = "mp4"
# 
# class VideoTransformation(BaseTransformation):
#     def format(
#         self, file_format: Union[VideoFormat, str]
#     ) -> "VideoTransformation":
#         self.set("format", [file_format])
#         return self
# 
#     def size(
#         self,
#         width: Optional[int] = None,
#         height: Optional[int] = None,
#         resize_mode: Optional[Union[str, ResizeMode]] = None,
#     ) -> "VideoTransformation":
#         parameters = [f'{width or ""}x{height or ""}']
#         if resize_mode:
#             parameters.append(resize_mode)
#         self.set("size", parameters)
#         return self
# 
#     def quality(self, file_quality: Quality) -> "VideoTransformation":
#         self.set("quality", [file_quality])
#         return self
# 
#     def cut(self, start_time: str, length: str) -> "VideoTransformation":
#         self.set("cut", [start_time, length])
#         return self
# 
#     def thumbs(self, amount: int) -> "VideoTransformation":
#         self.set("thumbs", [str(amount)])
#         return self
# 
#     def _prefix(self, file_id: str) -> str:
#         return f"{file_id}/video/"
# 
#     def path(self, file_id: str) -> str:
#         path_ = super().path(file_id)
#         path_ = path_.replace("thumbs/", "thumbs~")
#         return path_


import pytest
from pyuploadcare.transformations.video import VideoFormat, VideoTransformation



@pytest.mark.vcr
def test_convert_video(uploadcare):
    transformation = VideoTransformation().format(VideoFormat.webm).thumbs(2)

    path = transformation.path("740e1b8c-1ad8-4324-b7ec-112c79d8eac2")

    response = uploadcare.video_convert_api.convert([path])

    assert not response.problems

    video_convert_info = response.result[0]


# Path: pyuploadcare/transformations/video.py
# class VideoFormat(StrEnum):
#     webm = "webm"
#     ogg = "ogg"
#     mp4 = "mp4"
# 
# class VideoTransformation(BaseTransformation):
#     def format(
#         self, file_format: Union[VideoFormat, str]
#     ) -> "VideoTransformation":
#         self.set("format", [file_format])
#         return self
# 
#     def size(
#         self,
#         width: Optional[int] = None,
#         height: Optional[int] = None,
#         resize_mode: Optional[Union[str, ResizeMode]] = None,
#     ) -> "VideoTransformation":
#         parameters = [f'{width or ""}x{height or ""}']
#         if resize_mode:
#             parameters.append(resize_mode)
#         self.set("size", parameters)
#         return self
# 
#     def quality(self, file_quality: Quality) -> "VideoTransformation":
#         self.set("quality", [file_quality])
#         return self
# 
#     def cut(self, start_time: str, length: str) -> "VideoTransformation":
#         self.set("cut", [start_time, length])
#         return self
# 
#     def thumbs(self, amount: int) -> "VideoTransformation":
#         self.set("thumbs", [str(amount)])
#         return self
# 
#     def _prefix(self, file_id: str) -> str:
#         return f"{file_id}/video/"
# 
#     def path(self, file_id: str) -> str:
#         path_ = super().path(file_id)
#         path_ = path_.replace("thumbs/", "thumbs~")
#         return path_


# Path: tests/functional/api/test_video_convert_api.py
import pytest
from pyuploadcare.transformations.video import VideoFormat, VideoTransformation




@pytest.mark.vcr
def test_convert_video(uploadcare):
    transformation = VideoTransformation().format(VideoFormat.webm).thumbs(2)

    path = transformation.path("740e1b8c-1ad8-4324-b7ec-112c79d8eac2")

    response = uploadcare.video_convert_api.convert([path])

    assert not response.problems

    video_convert_info = response.result[0]


    response = uploadcare.video_convert_api.status(video_convert_info.token)