fishjam-server-sdk 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. fishjam/__init__.py +85 -0
  2. fishjam/_openapi_client/__init__.py +7 -0
  3. fishjam/_openapi_client/api/__init__.py +1 -0
  4. fishjam/_openapi_client/api/health/__init__.py +0 -0
  5. fishjam/_openapi_client/api/health/healthcheck.py +129 -0
  6. fishjam/_openapi_client/api/hls/__init__.py +0 -0
  7. fishjam/_openapi_client/api/hls/get_hls_content.py +243 -0
  8. fishjam/_openapi_client/api/recording/__init__.py +0 -0
  9. fishjam/_openapi_client/api/recording/delete_recording.py +161 -0
  10. fishjam/_openapi_client/api/recording/get_recording_content.py +171 -0
  11. fishjam/_openapi_client/api/recording/get_recordings.py +133 -0
  12. fishjam/_openapi_client/api/room/__init__.py +0 -0
  13. fishjam/_openapi_client/api/room/add_component.py +181 -0
  14. fishjam/_openapi_client/api/room/add_peer.py +185 -0
  15. fishjam/_openapi_client/api/room/create_room.py +162 -0
  16. fishjam/_openapi_client/api/room/delete_component.py +171 -0
  17. fishjam/_openapi_client/api/room/delete_peer.py +171 -0
  18. fishjam/_openapi_client/api/room/delete_room.py +157 -0
  19. fishjam/_openapi_client/api/room/get_all_rooms.py +129 -0
  20. fishjam/_openapi_client/api/room/get_room.py +159 -0
  21. fishjam/_openapi_client/api/room/subscribe_to.py +193 -0
  22. fishjam/_openapi_client/api/sip/__init__.py +0 -0
  23. fishjam/_openapi_client/api/sip/dial.py +193 -0
  24. fishjam/_openapi_client/api/sip/end_call.py +175 -0
  25. fishjam/_openapi_client/client.py +274 -0
  26. fishjam/_openapi_client/errors.py +14 -0
  27. fishjam/_openapi_client/models/__init__.py +107 -0
  28. fishjam/_openapi_client/models/add_component_json_body.py +181 -0
  29. fishjam/_openapi_client/models/add_peer_json_body.py +74 -0
  30. fishjam/_openapi_client/models/component_details_response.py +156 -0
  31. fishjam/_openapi_client/models/component_file.py +109 -0
  32. fishjam/_openapi_client/models/component_hls.py +100 -0
  33. fishjam/_openapi_client/models/component_options_file.py +70 -0
  34. fishjam/_openapi_client/models/component_options_hls.py +121 -0
  35. fishjam/_openapi_client/models/component_options_hls_subscribe_mode.py +11 -0
  36. fishjam/_openapi_client/models/component_options_recording.py +104 -0
  37. fishjam/_openapi_client/models/component_options_recording_subscribe_mode.py +11 -0
  38. fishjam/_openapi_client/models/component_options_rtsp.py +94 -0
  39. fishjam/_openapi_client/models/component_options_sip.py +72 -0
  40. fishjam/_openapi_client/models/component_options_sipsip_credentials.py +74 -0
  41. fishjam/_openapi_client/models/component_properties_file.py +67 -0
  42. fishjam/_openapi_client/models/component_properties_hls.py +93 -0
  43. fishjam/_openapi_client/models/component_properties_hls_subscribe_mode.py +11 -0
  44. fishjam/_openapi_client/models/component_properties_recording.py +66 -0
  45. fishjam/_openapi_client/models/component_properties_recording_subscribe_mode.py +11 -0
  46. fishjam/_openapi_client/models/component_properties_rtsp.py +88 -0
  47. fishjam/_openapi_client/models/component_properties_sip.py +72 -0
  48. fishjam/_openapi_client/models/component_properties_sipsip_credentials.py +74 -0
  49. fishjam/_openapi_client/models/component_recording.py +100 -0
  50. fishjam/_openapi_client/models/component_rtsp.py +100 -0
  51. fishjam/_openapi_client/models/component_sip.py +100 -0
  52. fishjam/_openapi_client/models/dial_config.py +60 -0
  53. fishjam/_openapi_client/models/error.py +60 -0
  54. fishjam/_openapi_client/models/health_report.py +98 -0
  55. fishjam/_openapi_client/models/health_report_distribution.py +79 -0
  56. fishjam/_openapi_client/models/health_report_status.py +11 -0
  57. fishjam/_openapi_client/models/healthcheck_response.py +66 -0
  58. fishjam/_openapi_client/models/peer.py +107 -0
  59. fishjam/_openapi_client/models/peer_details_response.py +66 -0
  60. fishjam/_openapi_client/models/peer_details_response_data.py +84 -0
  61. fishjam/_openapi_client/models/peer_options_web_rtc.py +60 -0
  62. fishjam/_openapi_client/models/peer_status.py +11 -0
  63. fishjam/_openapi_client/models/recording_list_response.py +60 -0
  64. fishjam/_openapi_client/models/room.py +203 -0
  65. fishjam/_openapi_client/models/room_config.py +111 -0
  66. fishjam/_openapi_client/models/room_config_video_codec.py +11 -0
  67. fishjam/_openapi_client/models/room_create_details_response.py +68 -0
  68. fishjam/_openapi_client/models/room_create_details_response_data.py +73 -0
  69. fishjam/_openapi_client/models/room_details_response.py +66 -0
  70. fishjam/_openapi_client/models/rooms_listing_response.py +75 -0
  71. fishjam/_openapi_client/models/s3_credentials.py +84 -0
  72. fishjam/_openapi_client/models/sip_credentials.py +74 -0
  73. fishjam/_openapi_client/models/subscription_config.py +62 -0
  74. fishjam/_openapi_client/models/track.py +84 -0
  75. fishjam/_openapi_client/models/track_type.py +11 -0
  76. fishjam/_openapi_client/py.typed +1 -0
  77. fishjam/_openapi_client/types.py +52 -0
  78. fishjam/_webhook_notifier.py +19 -0
  79. fishjam/_ws_notifier.py +151 -0
  80. fishjam/api/__init__.py +0 -0
  81. fishjam/api/_base_api.py +26 -0
  82. fishjam/api/_recording_api.py +37 -0
  83. fishjam/api/_room_api.py +237 -0
  84. fishjam/errors.py +47 -0
  85. fishjam/events/__init__.py +42 -0
  86. fishjam/events/_protos/__init__.py +0 -0
  87. fishjam/events/_protos/fishjam/__init__.py +270 -0
  88. fishjam_server_sdk-0.5.0.dist-info/METADATA +176 -0
  89. fishjam_server_sdk-0.5.0.dist-info/RECORD +91 -0
  90. fishjam_server_sdk-0.5.0.dist-info/WHEEL +4 -0
  91. fishjam_server_sdk-0.5.0.dist-info/entry_points.txt +11 -0
fishjam/__init__.py ADDED
@@ -0,0 +1,85 @@
1
+ """
2
+ .. include:: ../README.md
3
+ """
4
+
5
+ # pylint: disable=locally-disabled, no-name-in-module, import-error
6
+
7
+ # Exceptions and Server Messages
8
+ from fishjam import errors, events
9
+
10
+ # Models
11
+ from fishjam._openapi_client.models import (
12
+ ComponentFile,
13
+ ComponentHLS,
14
+ ComponentOptionsFile,
15
+ ComponentOptionsHLS,
16
+ ComponentOptionsHLSSubscribeMode,
17
+ ComponentOptionsRecording,
18
+ ComponentOptionsRecordingSubscribeMode,
19
+ ComponentOptionsRTSP,
20
+ ComponentOptionsSIP,
21
+ ComponentPropertiesFile,
22
+ ComponentPropertiesHLS,
23
+ ComponentPropertiesHLSSubscribeMode,
24
+ ComponentPropertiesRecording,
25
+ ComponentPropertiesRecordingSubscribeMode,
26
+ ComponentPropertiesRTSP,
27
+ ComponentPropertiesSIP,
28
+ ComponentPropertiesSIPSIPCredentials,
29
+ ComponentRecording,
30
+ ComponentRTSP,
31
+ ComponentSIP,
32
+ Peer,
33
+ PeerOptionsWebRTC,
34
+ PeerStatus,
35
+ Room,
36
+ RoomConfig,
37
+ RoomConfigVideoCodec,
38
+ S3Credentials,
39
+ SIPCredentials,
40
+ )
41
+
42
+ # API
43
+ from fishjam._webhook_notifier import receive_binary
44
+ from fishjam._ws_notifier import Notifier
45
+ from fishjam.api._recording_api import RecordingApi
46
+ from fishjam.api._room_api import RoomApi
47
+
48
+ __all__ = [
49
+ "RoomApi",
50
+ "RecordingApi",
51
+ "Notifier",
52
+ "receive_binary",
53
+ "Room",
54
+ "RoomConfig",
55
+ "RoomConfigVideoCodec",
56
+ "Peer",
57
+ "PeerOptionsWebRTC",
58
+ "PeerStatus",
59
+ "ComponentHLS",
60
+ "ComponentOptionsHLS",
61
+ "ComponentOptionsHLSSubscribeMode",
62
+ "ComponentPropertiesHLS",
63
+ "ComponentPropertiesHLSSubscribeMode",
64
+ "ComponentSIP",
65
+ "ComponentOptionsSIP",
66
+ "ComponentPropertiesSIP",
67
+ "ComponentPropertiesSIPSIPCredentials",
68
+ "ComponentFile",
69
+ "ComponentRTSP",
70
+ "ComponentOptionsRTSP",
71
+ "ComponentPropertiesRTSP",
72
+ "ComponentFile",
73
+ "ComponentOptionsFile",
74
+ "ComponentPropertiesFile",
75
+ "events",
76
+ "errors",
77
+ "SIPCredentials",
78
+ "ComponentRecording",
79
+ "ComponentOptionsRecording",
80
+ "ComponentOptionsRecordingSubscribeMode",
81
+ "ComponentPropertiesRecording",
82
+ "ComponentPropertiesRecordingSubscribeMode",
83
+ "S3Credentials",
84
+ ]
85
+ __docformat__ = "restructuredtext"
@@ -0,0 +1,7 @@
1
+ """ A client library for accessing Fishjam Media Server """
2
+ from .client import AuthenticatedClient, Client
3
+
4
+ __all__ = (
5
+ "AuthenticatedClient",
6
+ "Client",
7
+ )
@@ -0,0 +1 @@
1
+ """ Contains methods for accessing the API """
File without changes
@@ -0,0 +1,129 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error import Error
9
+ from ...models.healthcheck_response import HealthcheckResponse
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs() -> Dict[str, Any]:
14
+ return {
15
+ "method": "get",
16
+ "url": "/health",
17
+ }
18
+
19
+
20
+ def _parse_response(
21
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
22
+ ) -> Optional[Union[Error, HealthcheckResponse]]:
23
+ if response.status_code == HTTPStatus.OK:
24
+ response_200 = HealthcheckResponse.from_dict(response.json())
25
+
26
+ return response_200
27
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
28
+ response_401 = Error.from_dict(response.json())
29
+
30
+ return response_401
31
+ if client.raise_on_unexpected_status:
32
+ raise errors.UnexpectedStatus(response.status_code, response.content)
33
+ else:
34
+ return None
35
+
36
+
37
+ def _build_response(
38
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
+ ) -> Response[Union[Error, HealthcheckResponse]]:
40
+ return Response(
41
+ status_code=HTTPStatus(response.status_code),
42
+ content=response.content,
43
+ headers=response.headers,
44
+ parsed=_parse_response(client=client, response=response),
45
+ )
46
+
47
+
48
+ def sync_detailed(
49
+ *,
50
+ client: AuthenticatedClient,
51
+ ) -> Response[Union[Error, HealthcheckResponse]]:
52
+ """Describes the health of Fishjam
53
+
54
+ Raises:
55
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
57
+
58
+ Returns:
59
+ Response[Union[Error, HealthcheckResponse]]
60
+ """
61
+
62
+ kwargs = _get_kwargs()
63
+
64
+ response = client.get_httpx_client().request(
65
+ **kwargs,
66
+ )
67
+
68
+ return _build_response(client=client, response=response)
69
+
70
+
71
+ def sync(
72
+ *,
73
+ client: AuthenticatedClient,
74
+ ) -> Optional[Union[Error, HealthcheckResponse]]:
75
+ """Describes the health of Fishjam
76
+
77
+ Raises:
78
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
80
+
81
+ Returns:
82
+ Union[Error, HealthcheckResponse]
83
+ """
84
+
85
+ return sync_detailed(
86
+ client=client,
87
+ ).parsed
88
+
89
+
90
+ async def asyncio_detailed(
91
+ *,
92
+ client: AuthenticatedClient,
93
+ ) -> Response[Union[Error, HealthcheckResponse]]:
94
+ """Describes the health of Fishjam
95
+
96
+ Raises:
97
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
99
+
100
+ Returns:
101
+ Response[Union[Error, HealthcheckResponse]]
102
+ """
103
+
104
+ kwargs = _get_kwargs()
105
+
106
+ response = await client.get_async_httpx_client().request(**kwargs)
107
+
108
+ return _build_response(client=client, response=response)
109
+
110
+
111
+ async def asyncio(
112
+ *,
113
+ client: AuthenticatedClient,
114
+ ) -> Optional[Union[Error, HealthcheckResponse]]:
115
+ """Describes the health of Fishjam
116
+
117
+ Raises:
118
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
119
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
120
+
121
+ Returns:
122
+ Union[Error, HealthcheckResponse]
123
+ """
124
+
125
+ return (
126
+ await asyncio_detailed(
127
+ client=client,
128
+ )
129
+ ).parsed
File without changes
@@ -0,0 +1,243 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error import Error
9
+ from ...types import UNSET, Response, Unset
10
+
11
+
12
+ def _get_kwargs(
13
+ room_id: str,
14
+ filename: str,
15
+ *,
16
+ field_hls_msn: Union[Unset, None, int] = UNSET,
17
+ field_hls_part: Union[Unset, None, int] = UNSET,
18
+ field_hls_skip: Union[Unset, None, str] = UNSET,
19
+ range_: Union[Unset, str] = UNSET,
20
+ ) -> Dict[str, Any]:
21
+ headers = {}
22
+ if not isinstance(range_, Unset):
23
+ headers["range"] = range_
24
+
25
+ params: Dict[str, Any] = {}
26
+ params["_HLS_msn"] = field_hls_msn
27
+
28
+ params["_HLS_part"] = field_hls_part
29
+
30
+ params["_HLS_skip"] = field_hls_skip
31
+
32
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
33
+
34
+ return {
35
+ "method": "get",
36
+ "url": "/hls/{room_id}/{filename}".format(
37
+ room_id=room_id,
38
+ filename=filename,
39
+ ),
40
+ "params": params,
41
+ "headers": headers,
42
+ }
43
+
44
+
45
+ def _parse_response(
46
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
+ ) -> Optional[Union[Error, str]]:
48
+ if response.status_code == HTTPStatus.OK:
49
+ response_200 = cast(str, response.json())
50
+ return response_200
51
+ if response.status_code == HTTPStatus.BAD_REQUEST:
52
+ response_400 = Error.from_dict(response.json())
53
+
54
+ return response_400
55
+ if response.status_code == HTTPStatus.NOT_FOUND:
56
+ response_404 = Error.from_dict(response.json())
57
+
58
+ return response_404
59
+ if client.raise_on_unexpected_status:
60
+ raise errors.UnexpectedStatus(response.status_code, response.content)
61
+ else:
62
+ return None
63
+
64
+
65
+ def _build_response(
66
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
67
+ ) -> Response[Union[Error, str]]:
68
+ return Response(
69
+ status_code=HTTPStatus(response.status_code),
70
+ content=response.content,
71
+ headers=response.headers,
72
+ parsed=_parse_response(client=client, response=response),
73
+ )
74
+
75
+
76
+ def sync_detailed(
77
+ room_id: str,
78
+ filename: str,
79
+ *,
80
+ client: Union[AuthenticatedClient, Client],
81
+ field_hls_msn: Union[Unset, None, int] = UNSET,
82
+ field_hls_part: Union[Unset, None, int] = UNSET,
83
+ field_hls_skip: Union[Unset, None, str] = UNSET,
84
+ range_: Union[Unset, str] = UNSET,
85
+ ) -> Response[Union[Error, str]]:
86
+ """Retrieve HLS Content
87
+
88
+ Args:
89
+ room_id (str):
90
+ filename (str):
91
+ field_hls_msn (Union[Unset, None, int]): Segment sequence number Example: 10.
92
+ field_hls_part (Union[Unset, None, int]): Partial segment sequence number Example: 10.
93
+ field_hls_skip (Union[Unset, None, str]): Set to "YES" if delta manifest should be
94
+ requested Example: True.
95
+ range_ (Union[Unset, str]):
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ Response[Union[Error, str]]
103
+ """
104
+
105
+ kwargs = _get_kwargs(
106
+ room_id=room_id,
107
+ filename=filename,
108
+ field_hls_msn=field_hls_msn,
109
+ field_hls_part=field_hls_part,
110
+ field_hls_skip=field_hls_skip,
111
+ range_=range_,
112
+ )
113
+
114
+ response = client.get_httpx_client().request(
115
+ **kwargs,
116
+ )
117
+
118
+ return _build_response(client=client, response=response)
119
+
120
+
121
+ def sync(
122
+ room_id: str,
123
+ filename: str,
124
+ *,
125
+ client: Union[AuthenticatedClient, Client],
126
+ field_hls_msn: Union[Unset, None, int] = UNSET,
127
+ field_hls_part: Union[Unset, None, int] = UNSET,
128
+ field_hls_skip: Union[Unset, None, str] = UNSET,
129
+ range_: Union[Unset, str] = UNSET,
130
+ ) -> Optional[Union[Error, str]]:
131
+ """Retrieve HLS Content
132
+
133
+ Args:
134
+ room_id (str):
135
+ filename (str):
136
+ field_hls_msn (Union[Unset, None, int]): Segment sequence number Example: 10.
137
+ field_hls_part (Union[Unset, None, int]): Partial segment sequence number Example: 10.
138
+ field_hls_skip (Union[Unset, None, str]): Set to "YES" if delta manifest should be
139
+ requested Example: True.
140
+ range_ (Union[Unset, str]):
141
+
142
+ Raises:
143
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
145
+
146
+ Returns:
147
+ Union[Error, str]
148
+ """
149
+
150
+ return sync_detailed(
151
+ room_id=room_id,
152
+ filename=filename,
153
+ client=client,
154
+ field_hls_msn=field_hls_msn,
155
+ field_hls_part=field_hls_part,
156
+ field_hls_skip=field_hls_skip,
157
+ range_=range_,
158
+ ).parsed
159
+
160
+
161
+ async def asyncio_detailed(
162
+ room_id: str,
163
+ filename: str,
164
+ *,
165
+ client: Union[AuthenticatedClient, Client],
166
+ field_hls_msn: Union[Unset, None, int] = UNSET,
167
+ field_hls_part: Union[Unset, None, int] = UNSET,
168
+ field_hls_skip: Union[Unset, None, str] = UNSET,
169
+ range_: Union[Unset, str] = UNSET,
170
+ ) -> Response[Union[Error, str]]:
171
+ """Retrieve HLS Content
172
+
173
+ Args:
174
+ room_id (str):
175
+ filename (str):
176
+ field_hls_msn (Union[Unset, None, int]): Segment sequence number Example: 10.
177
+ field_hls_part (Union[Unset, None, int]): Partial segment sequence number Example: 10.
178
+ field_hls_skip (Union[Unset, None, str]): Set to "YES" if delta manifest should be
179
+ requested Example: True.
180
+ range_ (Union[Unset, str]):
181
+
182
+ Raises:
183
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
184
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
185
+
186
+ Returns:
187
+ Response[Union[Error, str]]
188
+ """
189
+
190
+ kwargs = _get_kwargs(
191
+ room_id=room_id,
192
+ filename=filename,
193
+ field_hls_msn=field_hls_msn,
194
+ field_hls_part=field_hls_part,
195
+ field_hls_skip=field_hls_skip,
196
+ range_=range_,
197
+ )
198
+
199
+ response = await client.get_async_httpx_client().request(**kwargs)
200
+
201
+ return _build_response(client=client, response=response)
202
+
203
+
204
+ async def asyncio(
205
+ room_id: str,
206
+ filename: str,
207
+ *,
208
+ client: Union[AuthenticatedClient, Client],
209
+ field_hls_msn: Union[Unset, None, int] = UNSET,
210
+ field_hls_part: Union[Unset, None, int] = UNSET,
211
+ field_hls_skip: Union[Unset, None, str] = UNSET,
212
+ range_: Union[Unset, str] = UNSET,
213
+ ) -> Optional[Union[Error, str]]:
214
+ """Retrieve HLS Content
215
+
216
+ Args:
217
+ room_id (str):
218
+ filename (str):
219
+ field_hls_msn (Union[Unset, None, int]): Segment sequence number Example: 10.
220
+ field_hls_part (Union[Unset, None, int]): Partial segment sequence number Example: 10.
221
+ field_hls_skip (Union[Unset, None, str]): Set to "YES" if delta manifest should be
222
+ requested Example: True.
223
+ range_ (Union[Unset, str]):
224
+
225
+ Raises:
226
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
227
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
228
+
229
+ Returns:
230
+ Union[Error, str]
231
+ """
232
+
233
+ return (
234
+ await asyncio_detailed(
235
+ room_id=room_id,
236
+ filename=filename,
237
+ client=client,
238
+ field_hls_msn=field_hls_msn,
239
+ field_hls_part=field_hls_part,
240
+ field_hls_skip=field_hls_skip,
241
+ range_=range_,
242
+ )
243
+ ).parsed
File without changes
@@ -0,0 +1,161 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error import Error
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ recording_id: str,
14
+ ) -> Dict[str, Any]:
15
+ return {
16
+ "method": "delete",
17
+ "url": "/recording/{recording_id}".format(
18
+ recording_id=recording_id,
19
+ ),
20
+ }
21
+
22
+
23
+ def _parse_response(
24
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
+ ) -> Optional[Union[Any, Error]]:
26
+ if response.status_code == HTTPStatus.NO_CONTENT:
27
+ response_204 = cast(Any, None)
28
+ return response_204
29
+ if response.status_code == HTTPStatus.BAD_REQUEST:
30
+ response_400 = Error.from_dict(response.json())
31
+
32
+ return response_400
33
+ if response.status_code == HTTPStatus.UNAUTHORIZED:
34
+ response_401 = Error.from_dict(response.json())
35
+
36
+ return response_401
37
+ if response.status_code == HTTPStatus.NOT_FOUND:
38
+ response_404 = Error.from_dict(response.json())
39
+
40
+ return response_404
41
+ if client.raise_on_unexpected_status:
42
+ raise errors.UnexpectedStatus(response.status_code, response.content)
43
+ else:
44
+ return None
45
+
46
+
47
+ def _build_response(
48
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
+ ) -> Response[Union[Any, Error]]:
50
+ return Response(
51
+ status_code=HTTPStatus(response.status_code),
52
+ content=response.content,
53
+ headers=response.headers,
54
+ parsed=_parse_response(client=client, response=response),
55
+ )
56
+
57
+
58
+ def sync_detailed(
59
+ recording_id: str,
60
+ *,
61
+ client: AuthenticatedClient,
62
+ ) -> Response[Union[Any, Error]]:
63
+ """Deletes the recording
64
+
65
+ Args:
66
+ recording_id (str):
67
+
68
+ Raises:
69
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
70
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
71
+
72
+ Returns:
73
+ Response[Union[Any, Error]]
74
+ """
75
+
76
+ kwargs = _get_kwargs(
77
+ recording_id=recording_id,
78
+ )
79
+
80
+ response = client.get_httpx_client().request(
81
+ **kwargs,
82
+ )
83
+
84
+ return _build_response(client=client, response=response)
85
+
86
+
87
+ def sync(
88
+ recording_id: str,
89
+ *,
90
+ client: AuthenticatedClient,
91
+ ) -> Optional[Union[Any, Error]]:
92
+ """Deletes the recording
93
+
94
+ Args:
95
+ recording_id (str):
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ Union[Any, Error]
103
+ """
104
+
105
+ return sync_detailed(
106
+ recording_id=recording_id,
107
+ client=client,
108
+ ).parsed
109
+
110
+
111
+ async def asyncio_detailed(
112
+ recording_id: str,
113
+ *,
114
+ client: AuthenticatedClient,
115
+ ) -> Response[Union[Any, Error]]:
116
+ """Deletes the recording
117
+
118
+ Args:
119
+ recording_id (str):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[Union[Any, Error]]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ recording_id=recording_id,
131
+ )
132
+
133
+ response = await client.get_async_httpx_client().request(**kwargs)
134
+
135
+ return _build_response(client=client, response=response)
136
+
137
+
138
+ async def asyncio(
139
+ recording_id: str,
140
+ *,
141
+ client: AuthenticatedClient,
142
+ ) -> Optional[Union[Any, Error]]:
143
+ """Deletes the recording
144
+
145
+ Args:
146
+ recording_id (str):
147
+
148
+ Raises:
149
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
151
+
152
+ Returns:
153
+ Union[Any, Error]
154
+ """
155
+
156
+ return (
157
+ await asyncio_detailed(
158
+ recording_id=recording_id,
159
+ client=client,
160
+ )
161
+ ).parsed