Skip to content

Commit 3c756b1

Browse files
Release 0.25.0
1 parent 75ffe1e commit 3c756b1

30 files changed

+174
-225
lines changed

examples/selective_subscription/selective_subscription/app.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ async def create_peer(request: Request) -> Response:
2929

3030
peer, token = room_service.create_peer()
3131

32-
return JSONResponse({
33-
"peer_id": peer.id,
34-
"token": token,
35-
"room_name": room_name,
36-
"peer_name": peer_name,
37-
})
32+
return JSONResponse(
33+
{
34+
"peer_id": peer.id,
35+
"token": token,
36+
"room_name": room_name,
37+
"peer_name": peer_name,
38+
}
39+
)
3840
except Exception as e:
3941
return JSONResponse({"error": str(e)}, status_code=500)
4042

fishjam/_openapi_client/api/room/add_peer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
from ... import errors
77
from ...client import AuthenticatedClient, Client
8-
from ...models.add_peer_body import AddPeerBody
98
from ...models.error import Error
9+
from ...models.peer_config import PeerConfig
1010
from ...models.peer_details_response import PeerDetailsResponse
1111
from ...types import Response
1212

1313

1414
def _get_kwargs(
1515
room_id: str,
1616
*,
17-
body: AddPeerBody,
17+
body: PeerConfig,
1818
) -> dict[str, Any]:
1919
headers: dict[str, Any] = {}
2020

@@ -81,13 +81,13 @@ def sync_detailed(
8181
room_id: str,
8282
*,
8383
client: AuthenticatedClient,
84-
body: AddPeerBody,
84+
body: PeerConfig,
8585
) -> Response[Union[Error, PeerDetailsResponse]]:
8686
"""Create peer
8787
8888
Args:
8989
room_id (str):
90-
body (AddPeerBody):
90+
body (PeerConfig): Peer configuration
9191
9292
Raises:
9393
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -113,13 +113,13 @@ def sync(
113113
room_id: str,
114114
*,
115115
client: AuthenticatedClient,
116-
body: AddPeerBody,
116+
body: PeerConfig,
117117
) -> Optional[Union[Error, PeerDetailsResponse]]:
118118
"""Create peer
119119
120120
Args:
121121
room_id (str):
122-
body (AddPeerBody):
122+
body (PeerConfig): Peer configuration
123123
124124
Raises:
125125
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -140,13 +140,13 @@ async def asyncio_detailed(
140140
room_id: str,
141141
*,
142142
client: AuthenticatedClient,
143-
body: AddPeerBody,
143+
body: PeerConfig,
144144
) -> Response[Union[Error, PeerDetailsResponse]]:
145145
"""Create peer
146146
147147
Args:
148148
room_id (str):
149-
body (AddPeerBody):
149+
body (PeerConfig): Peer configuration
150150
151151
Raises:
152152
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -170,13 +170,13 @@ async def asyncio(
170170
room_id: str,
171171
*,
172172
client: AuthenticatedClient,
173-
body: AddPeerBody,
173+
body: PeerConfig,
174174
) -> Optional[Union[Error, PeerDetailsResponse]]:
175175
"""Create peer
176176
177177
Args:
178178
room_id (str):
179-
body (AddPeerBody):
179+
body (PeerConfig): Peer configuration
180180
181181
Raises:
182182
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

fishjam/_openapi_client/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Contains all the data models used in inputs/outputs"""
22

3-
from .add_peer_body import AddPeerBody
43
from .agent_output import AgentOutput
54
from .audio_format import AudioFormat
65
from .audio_sample_rate import AudioSampleRate
76
from .error import Error
87
from .peer import Peer
8+
from .peer_config import PeerConfig
99
from .peer_details_response import PeerDetailsResponse
1010
from .peer_details_response_data import PeerDetailsResponseData
1111
from .peer_metadata import PeerMetadata
@@ -41,12 +41,12 @@
4141
from .web_rtc_metadata import WebRTCMetadata
4242

4343
__all__ = (
44-
"AddPeerBody",
4544
"AgentOutput",
4645
"AudioFormat",
4746
"AudioSampleRate",
4847
"Error",
4948
"Peer",
49+
"PeerConfig",
5050
"PeerDetailsResponse",
5151
"PeerDetailsResponseData",
5252
"PeerMetadata",

fishjam/_openapi_client/models/agent_output.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
)
77

88
from attrs import define as _attrs_define
9-
from attrs import field as _attrs_field
109

1110
from ..models.audio_format import AudioFormat
1211
from ..models.audio_sample_rate import AudioSampleRate
@@ -26,7 +25,6 @@ class AgentOutput:
2625

2726
audio_format: Union[Unset, AudioFormat] = UNSET
2827
audio_sample_rate: Union[Unset, AudioSampleRate] = UNSET
29-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
3028

3129
def to_dict(self) -> dict[str, Any]:
3230
audio_format: Union[Unset, str] = UNSET
@@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]:
3836
audio_sample_rate = self.audio_sample_rate.value
3937

4038
field_dict: dict[str, Any] = {}
41-
field_dict.update(self.additional_properties)
39+
4240
field_dict.update({})
4341
if audio_format is not UNSET:
4442
field_dict["audioFormat"] = audio_format
@@ -69,21 +67,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
6967
audio_sample_rate=audio_sample_rate,
7068
)
7169

72-
agent_output.additional_properties = d
7370
return agent_output
74-
75-
@property
76-
def additional_keys(self) -> list[str]:
77-
return list(self.additional_properties.keys())
78-
79-
def __getitem__(self, key: str) -> Any:
80-
return self.additional_properties[key]
81-
82-
def __setitem__(self, key: str, value: Any) -> None:
83-
self.additional_properties[key] = value
84-
85-
def __delitem__(self, key: str) -> None:
86-
del self.additional_properties[key]
87-
88-
def __contains__(self, key: str) -> bool:
89-
return key in self.additional_properties

fishjam/_openapi_client/models/error.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ def to_dict(self) -> dict[str, Any]:
2323

2424
field_dict: dict[str, Any] = {}
2525
field_dict.update(self.additional_properties)
26-
field_dict.update({
27-
"errors": errors,
28-
})
26+
field_dict.update(
27+
{
28+
"errors": errors,
29+
}
30+
)
2931

3032
return field_dict
3133

fishjam/_openapi_client/models/peer.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,17 @@ def to_dict(self) -> dict[str, Any]:
7272

7373
field_dict: dict[str, Any] = {}
7474
field_dict.update(self.additional_properties)
75-
field_dict.update({
76-
"id": id,
77-
"metadata": metadata,
78-
"status": status,
79-
"subscribeMode": subscribe_mode,
80-
"subscriptions": subscriptions,
81-
"tracks": tracks,
82-
"type": type_,
83-
})
75+
field_dict.update(
76+
{
77+
"id": id,
78+
"metadata": metadata,
79+
"status": status,
80+
"subscribeMode": subscribe_mode,
81+
"subscriptions": subscriptions,
82+
"tracks": tracks,
83+
"type": type_,
84+
}
85+
)
8486

8587
return field_dict
8688

fishjam/_openapi_client/models/add_peer_body.py renamed to fishjam/_openapi_client/models/peer_config.py

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
)
88

99
from attrs import define as _attrs_define
10-
from attrs import field as _attrs_field
1110

1211
from ..models.peer_type import PeerType
1312

@@ -16,20 +15,20 @@
1615
from ..models.peer_options_web_rtc import PeerOptionsWebRTC
1716

1817

19-
T = TypeVar("T", bound="AddPeerBody")
18+
T = TypeVar("T", bound="PeerConfig")
2019

2120

2221
@_attrs_define
23-
class AddPeerBody:
24-
"""
22+
class PeerConfig:
23+
"""Peer configuration
24+
2525
Attributes:
2626
options (Union['PeerOptionsAgent', 'PeerOptionsWebRTC']): Peer-specific options
2727
type_ (PeerType): Peer type Example: webrtc.
2828
"""
2929

3030
options: Union["PeerOptionsAgent", "PeerOptionsWebRTC"]
3131
type_: PeerType
32-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
3332

3433
def to_dict(self) -> dict[str, Any]:
3534
from ..models.peer_options_web_rtc import PeerOptionsWebRTC
@@ -43,11 +42,13 @@ def to_dict(self) -> dict[str, Any]:
4342
type_ = self.type_.value
4443

4544
field_dict: dict[str, Any] = {}
46-
field_dict.update(self.additional_properties)
47-
field_dict.update({
48-
"options": options,
49-
"type": type_,
50-
})
45+
46+
field_dict.update(
47+
{
48+
"options": options,
49+
"type": type_,
50+
}
51+
)
5152

5253
return field_dict
5354

@@ -81,26 +82,9 @@ def _parse_options(
8182

8283
type_ = PeerType(d.pop("type"))
8384

84-
add_peer_body = cls(
85+
peer_config = cls(
8586
options=options,
8687
type_=type_,
8788
)
8889

89-
add_peer_body.additional_properties = d
90-
return add_peer_body
91-
92-
@property
93-
def additional_keys(self) -> list[str]:
94-
return list(self.additional_properties.keys())
95-
96-
def __getitem__(self, key: str) -> Any:
97-
return self.additional_properties[key]
98-
99-
def __setitem__(self, key: str, value: Any) -> None:
100-
self.additional_properties[key] = value
101-
102-
def __delitem__(self, key: str) -> None:
103-
del self.additional_properties[key]
104-
105-
def __contains__(self, key: str) -> bool:
106-
return key in self.additional_properties
90+
return peer_config

fishjam/_openapi_client/models/peer_details_response.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ def to_dict(self) -> dict[str, Any]:
3131

3232
field_dict: dict[str, Any] = {}
3333
field_dict.update(self.additional_properties)
34-
field_dict.update({
35-
"data": data,
36-
})
34+
field_dict.update(
35+
{
36+
"data": data,
37+
}
38+
)
3739

3840
return field_dict
3941

fishjam/_openapi_client/models/peer_details_response_data.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ def to_dict(self) -> dict[str, Any]:
4242

4343
field_dict: dict[str, Any] = {}
4444
field_dict.update(self.additional_properties)
45-
field_dict.update({
46-
"peer": peer,
47-
"token": token,
48-
})
45+
field_dict.update(
46+
{
47+
"peer": peer,
48+
"token": token,
49+
}
50+
)
4951
if peer_websocket_url is not UNSET:
5052
field_dict["peer_websocket_url"] = peer_websocket_url
5153

fishjam/_openapi_client/models/peer_options_agent.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
)
88

99
from attrs import define as _attrs_define
10-
from attrs import field as _attrs_field
1110

1211
from ..models.subscribe_mode import SubscribeMode
1312
from ..types import UNSET, Unset
@@ -30,7 +29,6 @@ class PeerOptionsAgent:
3029

3130
output: Union[Unset, "AgentOutput"] = UNSET
3231
subscribe_mode: Union[Unset, SubscribeMode] = UNSET
33-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
3432

3533
def to_dict(self) -> dict[str, Any]:
3634
output: Union[Unset, dict[str, Any]] = UNSET
@@ -42,7 +40,7 @@ def to_dict(self) -> dict[str, Any]:
4240
subscribe_mode = self.subscribe_mode.value
4341

4442
field_dict: dict[str, Any] = {}
45-
field_dict.update(self.additional_properties)
43+
4644
field_dict.update({})
4745
if output is not UNSET:
4846
field_dict["output"] = output
@@ -75,21 +73,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
7573
subscribe_mode=subscribe_mode,
7674
)
7775

78-
peer_options_agent.additional_properties = d
7976
return peer_options_agent
80-
81-
@property
82-
def additional_keys(self) -> list[str]:
83-
return list(self.additional_properties.keys())
84-
85-
def __getitem__(self, key: str) -> Any:
86-
return self.additional_properties[key]
87-
88-
def __setitem__(self, key: str, value: Any) -> None:
89-
self.additional_properties[key] = value
90-
91-
def __delitem__(self, key: str) -> None:
92-
del self.additional_properties[key]
93-
94-
def __contains__(self, key: str) -> bool:
95-
return key in self.additional_properties

0 commit comments

Comments
 (0)