Skip to content

Commit 66730a6

Browse files
committed
deprecate create_recording
1 parent fa4592d commit 66730a6

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎fishjam/api/_fishjam_client.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from io import BytesIO
66
from pathlib import Path
77
from typing import Any, Literal, cast
8+
from warnings import deprecated
89

910
from fishjam._fishjam_openapi_client.api.credentials import (
1011
validate_credentials as credentials_validate_credentials,
@@ -546,6 +547,7 @@ def create_moq_access(
546547

547548
return response
548549

550+
@deprecated("Use `create_composition_recording` instead.")
549551
def create_recording(
550552
self,
551553
source: CompositionSource,
@@ -573,6 +575,33 @@ def create_recording(
573575

574576
return resp.data
575577

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+
576605
def create_template_recording(
577606
self,
578607
source: TemplateSource,

0 commit comments

Comments
 (0)