|
5 | 5 | from io import BytesIO |
6 | 6 | from pathlib import Path |
7 | 7 | from typing import Any, Literal, cast |
| 8 | +from warnings import deprecated |
8 | 9 |
|
9 | 10 | from fishjam._fishjam_openapi_client.api.credentials import ( |
10 | 11 | validate_credentials as credentials_validate_credentials, |
@@ -546,6 +547,7 @@ def create_moq_access( |
546 | 547 |
|
547 | 548 | return response |
548 | 549 |
|
| 550 | + @deprecated("Use `create_composition_recording` instead.") |
549 | 551 | def create_recording( |
550 | 552 | self, |
551 | 553 | source: CompositionSource, |
@@ -573,6 +575,33 @@ def create_recording( |
573 | 575 |
|
574 | 576 | return resp.data |
575 | 577 |
|
| 578 | + def create_composition_recording( |
| 579 | + self, |
| 580 | + source: CompositionSource, |
| 581 | + metadata: dict[str, Any] | None = None, |
| 582 | + ) -> Recording: |
| 583 | + """Creates a new recording. |
| 584 | +
|
| 585 | + Capturing starts synchronously, so the returned recording is `active`. |
| 586 | +
|
| 587 | + Args: |
| 588 | + source: The source of the recording. |
| 589 | + metadata: Free-form metadata used to organize and filter recordings. |
| 590 | +
|
| 591 | + Returns: |
| 592 | + Recording: The started recording details. |
| 593 | + """ |
| 594 | + config = RecordingConfig( |
| 595 | + source=source, metadata=self.__parse_recording_metadata(metadata) |
| 596 | + ) |
| 597 | + |
| 598 | + resp = cast( |
| 599 | + RecordingDetailsResponse, |
| 600 | + self._request(recording_create_recording, body=config), |
| 601 | + ) |
| 602 | + |
| 603 | + return resp.data |
| 604 | + |
576 | 605 | def create_template_recording( |
577 | 606 | self, |
578 | 607 | source: TemplateSource, |
|
0 commit comments