1from fishjam._fishjam_openapi_client.models import ( 2 CompositionSource, 3 Recording, 4 RecordingStatus, 5 TemplateSource, 6 TemplateSourceResolution, 7) 8 9RecordingSource = CompositionSource | TemplateSource 10"""What a recording captures, one member per source type.""" 11 12__all__ = [ 13 "CompositionSource", 14 "Recording", 15 "RecordingSource", 16 "RecordingStatus", 17 "TemplateSource", 18 "TemplateSourceResolution", 19]
class
CompositionSource:
14@_attrs_define 15class CompositionSource: 16 """Recording source coming from composition 17 18 Attributes: 19 composition_url (str): URL of the composition to record 20 output_id (str): Id of the output being recorded 21 scale_ratio (float | Unset): Scale factor for the recording relative to the source output (>0; may upscale or 22 downscale). Defaults to 1. Default: 1.0. 23 """ 24 25 composition_url: str 26 output_id: str 27 scale_ratio: float | Unset = 1.0 28 29 def to_dict(self) -> dict[str, Any]: 30 composition_url = self.composition_url 31 32 output_id = self.output_id 33 34 scale_ratio = self.scale_ratio 35 36 field_dict: dict[str, Any] = {} 37 38 field_dict.update({ 39 "compositionURL": composition_url, 40 "outputId": output_id, 41 }) 42 if scale_ratio is not UNSET: 43 field_dict["scaleRatio"] = scale_ratio 44 45 return field_dict 46 47 @classmethod 48 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 49 d = dict(src_dict) 50 composition_url = d.pop("compositionURL") 51 52 output_id = d.pop("outputId") 53 54 scale_ratio = d.pop("scaleRatio", UNSET) 55 56 composition_source = cls( 57 composition_url=composition_url, 58 output_id=output_id, 59 scale_ratio=scale_ratio, 60 ) 61 62 return composition_source
Recording source coming from composition
Attributes:
- composition_url (str): URL of the composition to record
- output_id (str): Id of the output being recorded
- scale_ratio (float | Unset): Scale factor for the recording relative to the source output (>0; may upscale or downscale). Defaults to 1. Default: 1.0.
CompositionSource( composition_url: str, output_id: str, scale_ratio: float | fishjam._fishjam_openapi_client.types.Unset = 1.0)
25def __init__(self, composition_url, output_id, scale_ratio=attr_dict['scale_ratio'].default): 26 self.composition_url = composition_url 27 self.output_id = output_id 28 self.scale_ratio = scale_ratio
Method generated by attrs for class CompositionSource.
def
to_dict(self) -> dict[str, typing.Any]:
29 def to_dict(self) -> dict[str, Any]: 30 composition_url = self.composition_url 31 32 output_id = self.output_id 33 34 scale_ratio = self.scale_ratio 35 36 field_dict: dict[str, Any] = {} 37 38 field_dict.update({ 39 "compositionURL": composition_url, 40 "outputId": output_id, 41 }) 42 if scale_ratio is not UNSET: 43 field_dict["scaleRatio"] = scale_ratio 44 45 return field_dict
@classmethod
def
from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
47 @classmethod 48 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 49 d = dict(src_dict) 50 composition_url = d.pop("compositionURL") 51 52 output_id = d.pop("outputId") 53 54 scale_ratio = d.pop("scaleRatio", UNSET) 55 56 composition_source = cls( 57 composition_url=composition_url, 58 output_id=output_id, 59 scale_ratio=scale_ratio, 60 ) 61 62 return composition_source
class
Recording:
23@_attrs_define 24class Recording: 25 """A recording and its current lifecycle status 26 27 Attributes: 28 files (list[RecordingFile]): Media files of the recording, in playback order. Empty until the recording is 29 `available`. 30 id (str): Assigned recording id 31 source (CompositionSource | TemplateSource): The source for the recording 32 status (RecordingStatus): Lifecycle status of a recording 33 metadata (None | RecordingMetadataType0 | Unset): Free-form, user-supplied metadata used to organize and filter 34 recordings 35 """ 36 37 files: list[RecordingFile] 38 id: str 39 source: CompositionSource | TemplateSource 40 status: RecordingStatus 41 metadata: None | RecordingMetadataType0 | Unset = UNSET 42 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) 43 44 def to_dict(self) -> dict[str, Any]: 45 from ..models.composition_source import CompositionSource 46 from ..models.recording_metadata_type_0 import RecordingMetadataType0 47 48 files = [] 49 for files_item_data in self.files: 50 files_item = files_item_data.to_dict() 51 files.append(files_item) 52 53 id = self.id 54 55 source: dict[str, Any] 56 if isinstance(self.source, CompositionSource): 57 source = self.source.to_dict() 58 else: 59 source = self.source.to_dict() 60 61 status = self.status.value 62 63 metadata: dict[str, Any] | None | Unset 64 if isinstance(self.metadata, Unset): 65 metadata = UNSET 66 elif isinstance(self.metadata, RecordingMetadataType0): 67 metadata = self.metadata.to_dict() 68 else: 69 metadata = self.metadata 70 71 field_dict: dict[str, Any] = {} 72 field_dict.update(self.additional_properties) 73 field_dict.update({ 74 "files": files, 75 "id": id, 76 "source": source, 77 "status": status, 78 }) 79 if metadata is not UNSET: 80 field_dict["metadata"] = metadata 81 82 return field_dict 83 84 @classmethod 85 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 86 from ..models.composition_source import CompositionSource 87 from ..models.recording_file import RecordingFile 88 from ..models.recording_metadata_type_0 import RecordingMetadataType0 89 from ..models.template_source import TemplateSource 90 91 d = dict(src_dict) 92 files = [] 93 _files = d.pop("files") 94 for files_item_data in _files: 95 files_item = RecordingFile.from_dict(files_item_data) 96 97 files.append(files_item) 98 99 id = d.pop("id") 100 101 def _parse_source(data: object) -> CompositionSource | TemplateSource: 102 try: 103 if not isinstance(data, dict): 104 raise TypeError() 105 componentsschemas_recording_source_type_0 = CompositionSource.from_dict( 106 data 107 ) 108 109 return componentsschemas_recording_source_type_0 110 except (TypeError, ValueError, AttributeError, KeyError): 111 pass 112 if not isinstance(data, dict): 113 raise TypeError() 114 componentsschemas_recording_source_type_1 = TemplateSource.from_dict(data) 115 116 return componentsschemas_recording_source_type_1 117 118 source = _parse_source(d.pop("source")) 119 120 status = RecordingStatus(d.pop("status")) 121 122 def _parse_metadata(data: object) -> None | RecordingMetadataType0 | Unset: 123 if data is None: 124 return data 125 if isinstance(data, Unset): 126 return data 127 try: 128 if not isinstance(data, dict): 129 raise TypeError() 130 metadata_type_0 = RecordingMetadataType0.from_dict(data) 131 132 return metadata_type_0 133 except (TypeError, ValueError, AttributeError, KeyError): 134 pass 135 return cast(None | RecordingMetadataType0 | Unset, data) 136 137 metadata = _parse_metadata(d.pop("metadata", UNSET)) 138 139 recording = cls( 140 files=files, 141 id=id, 142 source=source, 143 status=status, 144 metadata=metadata, 145 ) 146 147 recording.additional_properties = d 148 return recording 149 150 @property 151 def additional_keys(self) -> list[str]: 152 return list(self.additional_properties.keys()) 153 154 def __getitem__(self, key: str) -> Any: 155 return self.additional_properties[key] 156 157 def __setitem__(self, key: str, value: Any) -> None: 158 self.additional_properties[key] = value 159 160 def __delitem__(self, key: str) -> None: 161 del self.additional_properties[key] 162 163 def __contains__(self, key: str) -> bool: 164 return key in self.additional_properties
A recording and its current lifecycle status
Attributes:
- files (list[RecordingFile]): Media files of the recording, in playback order. Empty until the recording is
available. - id (str): Assigned recording id
- source (CompositionSource | TemplateSource): The source for the recording
- status (RecordingStatus): Lifecycle status of a recording
- metadata (None | RecordingMetadataType0 | Unset): Free-form, user-supplied metadata used to organize and filter recordings
Recording( files: list[fishjam._fishjam_openapi_client.models.recording_file.RecordingFile], id: str, source: CompositionSource | TemplateSource, status: RecordingStatus, metadata: None | fishjam._fishjam_openapi_client.models.recording_metadata_type_0.RecordingMetadataType0 | fishjam._fishjam_openapi_client.types.Unset = <fishjam._fishjam_openapi_client.types.Unset object>)
28def __init__(self, files, id, source, status, metadata=attr_dict['metadata'].default): 29 self.files = files 30 self.id = id 31 self.source = source 32 self.status = status 33 self.metadata = metadata 34 self.additional_properties = __attr_factory_additional_properties()
Method generated by attrs for class Recording.
source: CompositionSource | TemplateSource
status: RecordingStatus
metadata: None | fishjam._fishjam_openapi_client.models.recording_metadata_type_0.RecordingMetadataType0 | fishjam._fishjam_openapi_client.types.Unset
def
to_dict(self) -> dict[str, typing.Any]:
44 def to_dict(self) -> dict[str, Any]: 45 from ..models.composition_source import CompositionSource 46 from ..models.recording_metadata_type_0 import RecordingMetadataType0 47 48 files = [] 49 for files_item_data in self.files: 50 files_item = files_item_data.to_dict() 51 files.append(files_item) 52 53 id = self.id 54 55 source: dict[str, Any] 56 if isinstance(self.source, CompositionSource): 57 source = self.source.to_dict() 58 else: 59 source = self.source.to_dict() 60 61 status = self.status.value 62 63 metadata: dict[str, Any] | None | Unset 64 if isinstance(self.metadata, Unset): 65 metadata = UNSET 66 elif isinstance(self.metadata, RecordingMetadataType0): 67 metadata = self.metadata.to_dict() 68 else: 69 metadata = self.metadata 70 71 field_dict: dict[str, Any] = {} 72 field_dict.update(self.additional_properties) 73 field_dict.update({ 74 "files": files, 75 "id": id, 76 "source": source, 77 "status": status, 78 }) 79 if metadata is not UNSET: 80 field_dict["metadata"] = metadata 81 82 return field_dict
@classmethod
def
from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
84 @classmethod 85 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 86 from ..models.composition_source import CompositionSource 87 from ..models.recording_file import RecordingFile 88 from ..models.recording_metadata_type_0 import RecordingMetadataType0 89 from ..models.template_source import TemplateSource 90 91 d = dict(src_dict) 92 files = [] 93 _files = d.pop("files") 94 for files_item_data in _files: 95 files_item = RecordingFile.from_dict(files_item_data) 96 97 files.append(files_item) 98 99 id = d.pop("id") 100 101 def _parse_source(data: object) -> CompositionSource | TemplateSource: 102 try: 103 if not isinstance(data, dict): 104 raise TypeError() 105 componentsschemas_recording_source_type_0 = CompositionSource.from_dict( 106 data 107 ) 108 109 return componentsschemas_recording_source_type_0 110 except (TypeError, ValueError, AttributeError, KeyError): 111 pass 112 if not isinstance(data, dict): 113 raise TypeError() 114 componentsschemas_recording_source_type_1 = TemplateSource.from_dict(data) 115 116 return componentsschemas_recording_source_type_1 117 118 source = _parse_source(d.pop("source")) 119 120 status = RecordingStatus(d.pop("status")) 121 122 def _parse_metadata(data: object) -> None | RecordingMetadataType0 | Unset: 123 if data is None: 124 return data 125 if isinstance(data, Unset): 126 return data 127 try: 128 if not isinstance(data, dict): 129 raise TypeError() 130 metadata_type_0 = RecordingMetadataType0.from_dict(data) 131 132 return metadata_type_0 133 except (TypeError, ValueError, AttributeError, KeyError): 134 pass 135 return cast(None | RecordingMetadataType0 | Unset, data) 136 137 metadata = _parse_metadata(d.pop("metadata", UNSET)) 138 139 recording = cls( 140 files=files, 141 id=id, 142 source=source, 143 status=status, 144 metadata=metadata, 145 ) 146 147 recording.additional_properties = d 148 return recording
RecordingSource =
CompositionSource | TemplateSource
What a recording captures, one member per source type.
class
RecordingStatus(builtins.str, enum.Enum):
5class RecordingStatus(str, Enum): 6 """Lifecycle status of a recording""" 7 8 ACTIVE = "active" 9 AVAILABLE = "available" 10 FAILED = "failed" 11 FINISHED = "finished" 12 13 def __str__(self) -> str: 14 return str(self.value)
Lifecycle status of a recording
ACTIVE =
<RecordingStatus.ACTIVE: 'active'>
AVAILABLE =
<RecordingStatus.AVAILABLE: 'available'>
FAILED =
<RecordingStatus.FAILED: 'failed'>
FINISHED =
<RecordingStatus.FINISHED: 'finished'>
Inherited Members
- enum.Enum
- name
- value
- builtins.str
- encode
- replace
- split
- rsplit
- join
- capitalize
- casefold
- title
- center
- count
- expandtabs
- find
- partition
- index
- ljust
- lower
- lstrip
- rfind
- rindex
- rjust
- rstrip
- rpartition
- splitlines
- strip
- swapcase
- translate
- upper
- startswith
- endswith
- removeprefix
- removesuffix
- isascii
- islower
- isupper
- istitle
- isspace
- isdecimal
- isdigit
- isnumeric
- isalpha
- isalnum
- isidentifier
- isprintable
- zfill
- format
- format_map
- maketrans
class
TemplateSource:
18@_attrs_define 19class TemplateSource: 20 """Recording source that renders its own scene from a template, rather than cloning an existing output of the 21 composition 22 23 Attributes: 24 composition_url (str): URL of the composition to record 25 audio (bool | Unset): Whether the recording captures audio. Defaults to true. Default: True. 26 resolution (TemplateSourceResolution | Unset): Resolution the scene is rendered at. Defaults to 1280x720. 27 """ 28 29 composition_url: str 30 audio: bool | Unset = True 31 resolution: TemplateSourceResolution | Unset = UNSET 32 33 def to_dict(self) -> dict[str, Any]: 34 composition_url = self.composition_url 35 36 audio = self.audio 37 38 resolution: dict[str, Any] | Unset = UNSET 39 if not isinstance(self.resolution, Unset): 40 resolution = self.resolution.to_dict() 41 42 field_dict: dict[str, Any] = {} 43 44 field_dict.update({ 45 "compositionURL": composition_url, 46 }) 47 if audio is not UNSET: 48 field_dict["audio"] = audio 49 if resolution is not UNSET: 50 field_dict["resolution"] = resolution 51 52 return field_dict 53 54 @classmethod 55 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 56 from ..models.template_source_resolution import TemplateSourceResolution 57 58 d = dict(src_dict) 59 composition_url = d.pop("compositionURL") 60 61 audio = d.pop("audio", UNSET) 62 63 _resolution = d.pop("resolution", UNSET) 64 resolution: TemplateSourceResolution | Unset 65 if isinstance(_resolution, Unset): 66 resolution = UNSET 67 else: 68 resolution = TemplateSourceResolution.from_dict(_resolution) 69 70 template_source = cls( 71 composition_url=composition_url, 72 audio=audio, 73 resolution=resolution, 74 ) 75 76 return template_source
Recording source that renders its own scene from a template, rather than cloning an existing output of the composition
- Attributes: composition_url (str): URL of the composition to record audio (bool | Unset): Whether the recording captures audio. Defaults to true. Default: True. resolution (TemplateSourceResolution | Unset): Resolution the scene is rendered at. Defaults to 1280x720.
TemplateSource( composition_url: str, audio: bool | fishjam._fishjam_openapi_client.types.Unset = True, resolution: TemplateSourceResolution | fishjam._fishjam_openapi_client.types.Unset = <fishjam._fishjam_openapi_client.types.Unset object>)
25def __init__(self, composition_url, audio=attr_dict['audio'].default, resolution=attr_dict['resolution'].default): 26 self.composition_url = composition_url 27 self.audio = audio 28 self.resolution = resolution
Method generated by attrs for class TemplateSource.
resolution: TemplateSourceResolution | fishjam._fishjam_openapi_client.types.Unset
def
to_dict(self) -> dict[str, typing.Any]:
33 def to_dict(self) -> dict[str, Any]: 34 composition_url = self.composition_url 35 36 audio = self.audio 37 38 resolution: dict[str, Any] | Unset = UNSET 39 if not isinstance(self.resolution, Unset): 40 resolution = self.resolution.to_dict() 41 42 field_dict: dict[str, Any] = {} 43 44 field_dict.update({ 45 "compositionURL": composition_url, 46 }) 47 if audio is not UNSET: 48 field_dict["audio"] = audio 49 if resolution is not UNSET: 50 field_dict["resolution"] = resolution 51 52 return field_dict
@classmethod
def
from_dict(cls: type[~T], src_dict: Mapping[str, typing.Any]) -> ~T:
54 @classmethod 55 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 56 from ..models.template_source_resolution import TemplateSourceResolution 57 58 d = dict(src_dict) 59 composition_url = d.pop("compositionURL") 60 61 audio = d.pop("audio", UNSET) 62 63 _resolution = d.pop("resolution", UNSET) 64 resolution: TemplateSourceResolution | Unset 65 if isinstance(_resolution, Unset): 66 resolution = UNSET 67 else: 68 resolution = TemplateSourceResolution.from_dict(_resolution) 69 70 template_source = cls( 71 composition_url=composition_url, 72 audio=audio, 73 resolution=resolution, 74 ) 75 76 return template_source
class
TemplateSourceResolution:
12@_attrs_define 13class TemplateSourceResolution: 14 """Resolution the scene is rendered at. Defaults to 1280x720. 15 16 Attributes: 17 height (int): 18 width (int): 19 """ 20 21 height: int 22 width: int 23 24 def to_dict(self) -> dict[str, Any]: 25 height = self.height 26 27 width = self.width 28 29 field_dict: dict[str, Any] = {} 30 31 field_dict.update({ 32 "height": height, 33 "width": width, 34 }) 35 36 return field_dict 37 38 @classmethod 39 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 40 d = dict(src_dict) 41 height = d.pop("height") 42 43 width = d.pop("width") 44 45 template_source_resolution = cls( 46 height=height, 47 width=width, 48 ) 49 50 return template_source_resolution
Resolution the scene is rendered at. Defaults to 1280x720.
Attributes:
- height (int):
- width (int):
TemplateSourceResolution(height: int, width: int)
Method generated by attrs for class TemplateSourceResolution.