gcore 0.6.0__py3-none-any.whl → 0.7.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.

Potentially problematic release.


This version of gcore might be problematic. Click here for more details.

Files changed (181) hide show
  1. gcore/_client.py +9 -0
  2. gcore/_models.py +24 -3
  3. gcore/_version.py +1 -1
  4. gcore/pagination.py +101 -1
  5. gcore/resources/__init__.py +14 -0
  6. gcore/resources/cloud/__init__.py +28 -0
  7. gcore/resources/cloud/cloud.py +64 -0
  8. gcore/resources/cloud/cost_reports.py +811 -0
  9. gcore/resources/cloud/file_shares/file_shares.py +10 -0
  10. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +61 -26
  11. gcore/resources/cloud/inference/registry_credentials.py +4 -6
  12. gcore/resources/cloud/usage_reports.py +337 -0
  13. gcore/resources/streaming/__init__.py +159 -0
  14. gcore/resources/streaming/ai_tasks.py +1288 -0
  15. gcore/resources/streaming/broadcasts.py +579 -0
  16. gcore/resources/streaming/directories.py +515 -0
  17. gcore/resources/streaming/players.py +577 -0
  18. gcore/resources/streaming/playlists.py +1059 -0
  19. gcore/resources/streaming/quality_sets.py +331 -0
  20. gcore/resources/streaming/restreams.py +484 -0
  21. gcore/resources/streaming/statistics.py +3224 -0
  22. gcore/resources/streaming/streaming.py +390 -0
  23. gcore/resources/streaming/streams/__init__.py +33 -0
  24. gcore/resources/streaming/streams/overlays.py +716 -0
  25. gcore/resources/streaming/streams/streams.py +1592 -0
  26. gcore/resources/streaming/videos/__init__.py +33 -0
  27. gcore/resources/streaming/videos/subtitles.py +623 -0
  28. gcore/resources/streaming/videos/videos.py +1553 -0
  29. gcore/resources/waap/ip_info.py +28 -10
  30. gcore/types/cloud/__init__.py +10 -0
  31. gcore/types/cloud/cost_report_aggregated.py +865 -0
  32. gcore/types/cloud/cost_report_aggregated_monthly.py +865 -0
  33. gcore/types/cloud/cost_report_detailed.py +1343 -0
  34. gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +394 -0
  35. gcore/types/cloud/cost_report_get_aggregated_params.py +409 -0
  36. gcore/types/cloud/cost_report_get_detailed_params.py +435 -0
  37. gcore/types/cloud/file_share.py +37 -3
  38. gcore/types/cloud/file_share_create_params.py +16 -0
  39. gcore/types/cloud/gpu_baremetal_cluster.py +2 -2
  40. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +9 -0
  41. gcore/types/cloud/quota_get_all_response.py +24 -2
  42. gcore/types/cloud/quota_get_by_region_response.py +24 -2
  43. gcore/types/cloud/quotas/request_create_params.py +12 -1
  44. gcore/types/cloud/quotas/request_get_response.py +12 -1
  45. gcore/types/cloud/quotas/request_list_response.py +12 -1
  46. gcore/types/cloud/usage_report.py +1612 -0
  47. gcore/types/cloud/usage_report_get_params.py +432 -0
  48. gcore/types/streaming/__init__.py +143 -0
  49. gcore/types/streaming/ai_contentmoderation_casm.py +39 -0
  50. gcore/types/streaming/ai_contentmoderation_hardnudity.py +54 -0
  51. gcore/types/streaming/ai_contentmoderation_nsfw.py +39 -0
  52. gcore/types/streaming/ai_contentmoderation_softnudity.py +66 -0
  53. gcore/types/streaming/ai_contentmoderation_sport.py +39 -0
  54. gcore/types/streaming/ai_contentmoderation_weapon.py +39 -0
  55. gcore/types/streaming/ai_task.py +205 -0
  56. gcore/types/streaming/ai_task_cancel_response.py +12 -0
  57. gcore/types/streaming/ai_task_create_params.py +168 -0
  58. gcore/types/streaming/ai_task_create_response.py +10 -0
  59. gcore/types/streaming/ai_task_get_ai_settings_params.py +27 -0
  60. gcore/types/streaming/ai_task_get_ai_settings_response.py +12 -0
  61. gcore/types/streaming/ai_task_get_response.py +313 -0
  62. gcore/types/streaming/ai_task_list_params.py +50 -0
  63. gcore/types/streaming/broadcast.py +71 -0
  64. gcore/types/streaming/broadcast_create_params.py +76 -0
  65. gcore/types/streaming/broadcast_list_params.py +12 -0
  66. gcore/types/streaming/broadcast_spectators_count.py +12 -0
  67. gcore/types/streaming/broadcast_update_params.py +76 -0
  68. gcore/types/streaming/clip.py +78 -0
  69. gcore/types/streaming/create_video_param.py +214 -0
  70. gcore/types/streaming/direct_upload_parameters.py +33 -0
  71. gcore/types/streaming/directories_tree.py +19 -0
  72. gcore/types/streaming/directory_base.py +31 -0
  73. gcore/types/streaming/directory_create_params.py +15 -0
  74. gcore/types/streaming/directory_get_response.py +19 -0
  75. gcore/types/streaming/directory_item.py +13 -0
  76. gcore/types/streaming/directory_update_params.py +18 -0
  77. gcore/types/streaming/directory_video.py +13 -0
  78. gcore/types/streaming/ffprobes.py +25 -0
  79. gcore/types/streaming/max_stream_series.py +21 -0
  80. gcore/types/streaming/meet_series.py +23 -0
  81. gcore/types/streaming/player.py +114 -0
  82. gcore/types/streaming/player_create_params.py +18 -0
  83. gcore/types/streaming/player_list_params.py +12 -0
  84. gcore/types/streaming/player_param.py +114 -0
  85. gcore/types/streaming/player_update_params.py +18 -0
  86. gcore/types/streaming/playlist.py +102 -0
  87. gcore/types/streaming/playlist_create.py +12 -0
  88. gcore/types/streaming/playlist_create_params.py +102 -0
  89. gcore/types/streaming/playlist_list_params.py +12 -0
  90. gcore/types/streaming/playlist_list_videos_response.py +10 -0
  91. gcore/types/streaming/playlist_update_params.py +102 -0
  92. gcore/types/streaming/playlist_video.py +215 -0
  93. gcore/types/streaming/popular_videos.py +17 -0
  94. gcore/types/streaming/quality_set_set_default_params.py +23 -0
  95. gcore/types/streaming/quality_sets.py +57 -0
  96. gcore/types/streaming/restream.py +37 -0
  97. gcore/types/streaming/restream_create_params.py +41 -0
  98. gcore/types/streaming/restream_list_params.py +12 -0
  99. gcore/types/streaming/restream_update_params.py +41 -0
  100. gcore/types/streaming/statistic_get_ffprobes_params.py +22 -0
  101. gcore/types/streaming/statistic_get_live_unique_viewers_params.py +26 -0
  102. gcore/types/streaming/statistic_get_live_unique_viewers_response.py +25 -0
  103. gcore/types/streaming/statistic_get_live_watch_time_cdn_params.py +32 -0
  104. gcore/types/streaming/statistic_get_live_watch_time_total_cdn_params.py +30 -0
  105. gcore/types/streaming/statistic_get_max_streams_series_params.py +20 -0
  106. gcore/types/streaming/statistic_get_meet_series_params.py +20 -0
  107. gcore/types/streaming/statistic_get_popular_videos_params.py +15 -0
  108. gcore/types/streaming/statistic_get_storage_series_params.py +20 -0
  109. gcore/types/streaming/statistic_get_stream_series_params.py +20 -0
  110. gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +27 -0
  111. gcore/types/streaming/statistic_get_unique_viewers_params.py +34 -0
  112. gcore/types/streaming/statistic_get_views_by_browsers_params.py +15 -0
  113. gcore/types/streaming/statistic_get_views_by_country_params.py +15 -0
  114. gcore/types/streaming/statistic_get_views_by_hostname_params.py +15 -0
  115. gcore/types/streaming/statistic_get_views_by_operating_system_params.py +15 -0
  116. gcore/types/streaming/statistic_get_views_by_referer_params.py +15 -0
  117. gcore/types/streaming/statistic_get_views_by_region_params.py +15 -0
  118. gcore/types/streaming/statistic_get_views_heatmap_params.py +21 -0
  119. gcore/types/streaming/statistic_get_views_params.py +34 -0
  120. gcore/types/streaming/statistic_get_vod_storage_volume_params.py +17 -0
  121. gcore/types/streaming/statistic_get_vod_transcoding_duration_params.py +17 -0
  122. gcore/types/streaming/statistic_get_vod_unique_viewers_cdn_params.py +26 -0
  123. gcore/types/streaming/statistic_get_vod_watch_time_cdn_params.py +32 -0
  124. gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_params.py +30 -0
  125. gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_response.py +22 -0
  126. gcore/types/streaming/storage_series.py +23 -0
  127. gcore/types/streaming/stream.py +420 -0
  128. gcore/types/streaming/stream_create_clip_params.py +48 -0
  129. gcore/types/streaming/stream_create_params.py +165 -0
  130. gcore/types/streaming/stream_list_clips_response.py +10 -0
  131. gcore/types/streaming/stream_list_params.py +18 -0
  132. gcore/types/streaming/stream_series.py +21 -0
  133. gcore/types/streaming/stream_start_recording_response.py +76 -0
  134. gcore/types/streaming/stream_update_params.py +169 -0
  135. gcore/types/streaming/streams/__init__.py +11 -0
  136. gcore/types/streaming/streams/overlay.py +43 -0
  137. gcore/types/streaming/streams/overlay_create_params.py +36 -0
  138. gcore/types/streaming/streams/overlay_create_response.py +10 -0
  139. gcore/types/streaming/streams/overlay_list_response.py +10 -0
  140. gcore/types/streaming/streams/overlay_update_multiple_params.py +39 -0
  141. gcore/types/streaming/streams/overlay_update_multiple_response.py +10 -0
  142. gcore/types/streaming/streams/overlay_update_params.py +33 -0
  143. gcore/types/streaming/subtitle.py +12 -0
  144. gcore/types/streaming/subtitle_base.py +18 -0
  145. gcore/types/streaming/subtitle_base_param.py +18 -0
  146. gcore/types/streaming/unique_viewers.py +35 -0
  147. gcore/types/streaming/unique_viewers_cdn.py +17 -0
  148. gcore/types/streaming/video.py +444 -0
  149. gcore/types/streaming/video_create_multiple_params.py +28 -0
  150. gcore/types/streaming/video_create_multiple_response.py +10 -0
  151. gcore/types/streaming/video_create_params.py +13 -0
  152. gcore/types/streaming/video_create_response.py +10 -0
  153. gcore/types/streaming/video_list_names_params.py +13 -0
  154. gcore/types/streaming/video_list_params.py +59 -0
  155. gcore/types/streaming/video_update_params.py +214 -0
  156. gcore/types/streaming/videos/__init__.py +7 -0
  157. gcore/types/streaming/videos/subtitle_create_params.py +17 -0
  158. gcore/types/streaming/videos/subtitle_list_response.py +10 -0
  159. gcore/types/streaming/videos/subtitle_update_params.py +20 -0
  160. gcore/types/streaming/views.py +35 -0
  161. gcore/types/streaming/views_by_browser.py +17 -0
  162. gcore/types/streaming/views_by_country.py +19 -0
  163. gcore/types/streaming/views_by_hostname.py +17 -0
  164. gcore/types/streaming/views_by_operating_system.py +17 -0
  165. gcore/types/streaming/views_by_referer.py +17 -0
  166. gcore/types/streaming/views_by_region.py +19 -0
  167. gcore/types/streaming/views_heatmap.py +19 -0
  168. gcore/types/streaming/vod_statistics_series.py +21 -0
  169. gcore/types/streaming/vod_total_stream_duration_series.py +22 -0
  170. gcore/types/waap/domains/custom_rule_create_params.py +4 -4
  171. gcore/types/waap/domains/custom_rule_update_params.py +4 -4
  172. gcore/types/waap/ip_info_get_blocked_requests_params.py +5 -1
  173. gcore/types/waap/ip_info_get_counts_params.py +2 -1
  174. gcore/types/waap/ip_info_get_top_sessions_params.py +5 -1
  175. gcore/types/waap/ip_info_get_top_urls_params.py +5 -1
  176. gcore/types/waap/ip_info_get_top_user_agents_params.py +5 -1
  177. gcore/types/waap/waap_custom_rule.py +4 -4
  178. {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/METADATA +1 -1
  179. {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/RECORD +181 -33
  180. {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/WHEEL +0 -0
  181. {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1059 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Iterable
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
11
+ from ..._utils import maybe_transform, async_maybe_transform
12
+ from ..._compat import cached_property
13
+ from ..._resource import SyncAPIResource, AsyncAPIResource
14
+ from ..._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from ...pagination import SyncPageStreaming, AsyncPageStreaming
21
+ from ..._base_client import AsyncPaginator, make_request_options
22
+ from ...types.streaming import playlist_list_params, playlist_create_params, playlist_update_params
23
+ from ...types.streaming.playlist import Playlist
24
+ from ...types.streaming.playlist_create import PlaylistCreate
25
+ from ...types.streaming.playlist_list_videos_response import PlaylistListVideosResponse
26
+
27
+ __all__ = ["PlaylistsResource", "AsyncPlaylistsResource"]
28
+
29
+
30
+ class PlaylistsResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> PlaylistsResourceWithRawResponse:
33
+ """
34
+ This property can be used as a prefix for any HTTP method call to return
35
+ the raw response object instead of the parsed content.
36
+
37
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
38
+ """
39
+ return PlaylistsResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> PlaylistsResourceWithStreamingResponse:
43
+ """
44
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
+
46
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
47
+ """
48
+ return PlaylistsResourceWithStreamingResponse(self)
49
+
50
+ def create(
51
+ self,
52
+ *,
53
+ active: bool | NotGiven = NOT_GIVEN,
54
+ ad_id: int | NotGiven = NOT_GIVEN,
55
+ client_id: int | NotGiven = NOT_GIVEN,
56
+ client_user_id: int | NotGiven = NOT_GIVEN,
57
+ countdown: bool | NotGiven = NOT_GIVEN,
58
+ hls_cmaf_url: str | NotGiven = NOT_GIVEN,
59
+ hls_url: str | NotGiven = NOT_GIVEN,
60
+ iframe_url: str | NotGiven = NOT_GIVEN,
61
+ loop: bool | NotGiven = NOT_GIVEN,
62
+ name: str | NotGiven = NOT_GIVEN,
63
+ player_id: int | NotGiven = NOT_GIVEN,
64
+ playlist_type: Literal["live", "vod"] | NotGiven = NOT_GIVEN,
65
+ start_time: str | NotGiven = NOT_GIVEN,
66
+ video_ids: Iterable[int] | NotGiven = NOT_GIVEN,
67
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
+ # The extra values given here take precedence over values defined on the client or passed to this method.
69
+ extra_headers: Headers | None = None,
70
+ extra_query: Query | None = None,
71
+ extra_body: Body | None = None,
72
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
73
+ ) -> PlaylistCreate:
74
+ """
75
+ Playlist is a curated collection of video content organized in a sequential
76
+ manner. This method offers several advantages and features that are typical of
77
+ live streaming but with more control over the content. Here's how it works:
78
+
79
+ - Playlist always consists only of static VOD videos you previously uploaded to
80
+ the system.
81
+ - Playlist is always played as a "Live stream" for end-users, so without the
82
+ ability to fast forward the stream to the “future”. Manifest will contain
83
+ chunks as for live stream too.
84
+ - Playlist can be looped endlessly. In this case, all the videos in the list
85
+ will be constantly repeated through the list.
86
+ - Playlist can be programmed to be played at a specific time in the future. In
87
+ that case, before the start time there will be empty manifest. You can add new
88
+ videos to the list, remove unnecessary videos, or change the order of videos
89
+ in the list. But please pay attention to when the video list changes, it is
90
+ updated instantly on the server. This means that after saving the changed
91
+ list, the playlist will be reloaded for all users and it will start plays from
92
+ the very first element. Maximum video limit = 128 videos in a row.
93
+
94
+ Examples of usage:
95
+
96
+ - Looped video playback
97
+ - Scheduled playback **Looped video playback** It can be used to simulate TV
98
+ channel pre-programmed behaviour.
99
+ - Selection: Choose a series of videos, such as TV show episodes, movies,
100
+ tutorials, or any other relevant content.
101
+ - Order: Arrange the selected videos in the desired sequence, much like setting
102
+ a broadcast schedule.
103
+ - Looping: Optionally, the playlist can be set to loop, replaying the sequence
104
+ once it finishes to maintain a continuous stream. Example:
105
+
106
+ ```
107
+ active: true
108
+ loop: true
109
+ name: "Playlist: TV channel 'The world around us' (Programmed broadcast for 24 hours)"
110
+ ```
111
+
112
+ **Scheduled playback** It can be used to simulate live events such as virtual
113
+ concerts, webinars, or any special broadcasts without the logistical challenges
114
+ of an actual live stream.
115
+
116
+ - Timing: Set specific start time, creating the illusion of a live broadcast
117
+ schedule.
118
+ - Selection: Choose a video or series of videos to be played at the specified
119
+ time.
120
+ - No Pauses: Unlike on-demand streaming where users can pause and skip, this
121
+ emulated live stream runs continuously, mirroring the constraints of
122
+ traditional live broadcasts.
123
+
124
+ ```
125
+ active: true
126
+ loop: false
127
+ name: "Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'"
128
+ `start_time`: "2024-07-01T11:00:00Z"
129
+ ```
130
+
131
+ Args:
132
+ active:
133
+ Enables/Disables playlist. Has two possible values:
134
+
135
+ - true – Playlist can be played.
136
+ - false – Playlist is disabled. No broadcast while it's desabled.
137
+
138
+ ad_id: The advertisement ID that will be inserted into the video
139
+
140
+ client_id: Current playlist client ID
141
+
142
+ client_user_id: Custom field where you can specify user ID in your system
143
+
144
+ countdown: Enables countdown before playlist start with `playlist_type: live`
145
+
146
+ hls_cmaf_url: A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks
147
+ are in fMP4 container.
148
+
149
+ It is possible to use the same suffix-options as described in the "`hls_url`"
150
+ attribute.
151
+
152
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
153
+ and intended for your use. Any additional internal manifests, sub-manifests,
154
+ parameters, chunk names, file extensions, and related components are internal
155
+ infrastructure entities. These may undergo modifications without prior notice,
156
+ in any manner or form. It is strongly advised not to store them in your database
157
+ or cache them on your end.
158
+
159
+ hls_url: A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
160
+
161
+ This URL is a link to the main manifest. But you can also manually specify
162
+ suffix-options that will allow you to change the manifest to your request:
163
+ `` /playlists/{`client_id`}_{`playlist_id`}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8 ``
164
+ Please see the details in `hls_url` attribute of /videos/{id} method.
165
+
166
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
167
+ and intended for your use. Any additional internal manifests, sub-manifests,
168
+ parameters, chunk names, file extensions, and related components are internal
169
+ infrastructure entities. These may undergo modifications without prior notice,
170
+ in any manner or form. It is strongly advised not to store them in your database
171
+ or cache them on your end.
172
+
173
+ iframe_url: A URL to a built-in HTML video player with the video inside. It can be inserted
174
+ into an iframe on your website and the video will automatically play in all
175
+ browsers. The player can be opened or shared via this direct link. Also the
176
+ video player can be integrated into your web pages using the Iframe tag.
177
+
178
+ Please see the details in `iframe_url` attribute of /videos/{id} method.
179
+
180
+ loop: Enables/Disables playlist loop
181
+
182
+ name: Playlist name
183
+
184
+ player_id: The player ID with which the video will be played
185
+
186
+ playlist_type:
187
+ Determines whether the playlist:
188
+
189
+ - `live` - playlist for live-streaming
190
+ - `vod` - playlist is for video on demand access
191
+
192
+ start_time: Playlist start time. Playlist won't be available before the specified time.
193
+ Datetime in ISO 8601 format.
194
+
195
+ video_ids: A list of VOD IDs included in the playlist. Order of videos in a playlist
196
+ reflects the order of IDs in the array. Maximum video limit = 128.
197
+
198
+ extra_headers: Send extra headers
199
+
200
+ extra_query: Add additional query parameters to the request
201
+
202
+ extra_body: Add additional JSON properties to the request
203
+
204
+ timeout: Override the client-level default timeout for this request, in seconds
205
+ """
206
+ return self._post(
207
+ "/streaming/playlists",
208
+ body=maybe_transform(
209
+ {
210
+ "active": active,
211
+ "ad_id": ad_id,
212
+ "client_id": client_id,
213
+ "client_user_id": client_user_id,
214
+ "countdown": countdown,
215
+ "hls_cmaf_url": hls_cmaf_url,
216
+ "hls_url": hls_url,
217
+ "iframe_url": iframe_url,
218
+ "loop": loop,
219
+ "name": name,
220
+ "player_id": player_id,
221
+ "playlist_type": playlist_type,
222
+ "start_time": start_time,
223
+ "video_ids": video_ids,
224
+ },
225
+ playlist_create_params.PlaylistCreateParams,
226
+ ),
227
+ options=make_request_options(
228
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
229
+ ),
230
+ cast_to=PlaylistCreate,
231
+ )
232
+
233
+ def update(
234
+ self,
235
+ playlist_id: int,
236
+ *,
237
+ active: bool | NotGiven = NOT_GIVEN,
238
+ ad_id: int | NotGiven = NOT_GIVEN,
239
+ client_id: int | NotGiven = NOT_GIVEN,
240
+ client_user_id: int | NotGiven = NOT_GIVEN,
241
+ countdown: bool | NotGiven = NOT_GIVEN,
242
+ hls_cmaf_url: str | NotGiven = NOT_GIVEN,
243
+ hls_url: str | NotGiven = NOT_GIVEN,
244
+ iframe_url: str | NotGiven = NOT_GIVEN,
245
+ loop: bool | NotGiven = NOT_GIVEN,
246
+ name: str | NotGiven = NOT_GIVEN,
247
+ player_id: int | NotGiven = NOT_GIVEN,
248
+ playlist_type: Literal["live", "vod"] | NotGiven = NOT_GIVEN,
249
+ start_time: str | NotGiven = NOT_GIVEN,
250
+ video_ids: Iterable[int] | NotGiven = NOT_GIVEN,
251
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252
+ # The extra values given here take precedence over values defined on the client or passed to this method.
253
+ extra_headers: Headers | None = None,
254
+ extra_query: Query | None = None,
255
+ extra_body: Body | None = None,
256
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
257
+ ) -> Playlist:
258
+ """Change playlist
259
+
260
+ Args:
261
+ active:
262
+ Enables/Disables playlist.
263
+
264
+ Has two possible values:
265
+
266
+ - true – Playlist can be played.
267
+ - false – Playlist is disabled. No broadcast while it's desabled.
268
+
269
+ ad_id: The advertisement ID that will be inserted into the video
270
+
271
+ client_id: Current playlist client ID
272
+
273
+ client_user_id: Custom field where you can specify user ID in your system
274
+
275
+ countdown: Enables countdown before playlist start with `playlist_type: live`
276
+
277
+ hls_cmaf_url: A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks
278
+ are in fMP4 container.
279
+
280
+ It is possible to use the same suffix-options as described in the "`hls_url`"
281
+ attribute.
282
+
283
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
284
+ and intended for your use. Any additional internal manifests, sub-manifests,
285
+ parameters, chunk names, file extensions, and related components are internal
286
+ infrastructure entities. These may undergo modifications without prior notice,
287
+ in any manner or form. It is strongly advised not to store them in your database
288
+ or cache them on your end.
289
+
290
+ hls_url: A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
291
+
292
+ This URL is a link to the main manifest. But you can also manually specify
293
+ suffix-options that will allow you to change the manifest to your request:
294
+ `` /playlists/{`client_id`}_{`playlist_id`}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8 ``
295
+ Please see the details in `hls_url` attribute of /videos/{id} method.
296
+
297
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
298
+ and intended for your use. Any additional internal manifests, sub-manifests,
299
+ parameters, chunk names, file extensions, and related components are internal
300
+ infrastructure entities. These may undergo modifications without prior notice,
301
+ in any manner or form. It is strongly advised not to store them in your database
302
+ or cache them on your end.
303
+
304
+ iframe_url: A URL to a built-in HTML video player with the video inside. It can be inserted
305
+ into an iframe on your website and the video will automatically play in all
306
+ browsers. The player can be opened or shared via this direct link. Also the
307
+ video player can be integrated into your web pages using the Iframe tag.
308
+
309
+ Please see the details in `iframe_url` attribute of /videos/{id} method.
310
+
311
+ loop: Enables/Disables playlist loop
312
+
313
+ name: Playlist name
314
+
315
+ player_id: The player ID with which the video will be played
316
+
317
+ playlist_type:
318
+ Determines whether the playlist:
319
+
320
+ - `live` - playlist for live-streaming
321
+ - `vod` - playlist is for video on demand access
322
+
323
+ start_time: Playlist start time. Playlist won't be available before the specified time.
324
+ Datetime in ISO 8601 format.
325
+
326
+ video_ids: A list of VOD IDs included in the playlist. Order of videos in a playlist
327
+ reflects the order of IDs in the array. Maximum video limit = 128.
328
+
329
+ extra_headers: Send extra headers
330
+
331
+ extra_query: Add additional query parameters to the request
332
+
333
+ extra_body: Add additional JSON properties to the request
334
+
335
+ timeout: Override the client-level default timeout for this request, in seconds
336
+ """
337
+ return self._patch(
338
+ f"/streaming/playlists/{playlist_id}",
339
+ body=maybe_transform(
340
+ {
341
+ "active": active,
342
+ "ad_id": ad_id,
343
+ "client_id": client_id,
344
+ "client_user_id": client_user_id,
345
+ "countdown": countdown,
346
+ "hls_cmaf_url": hls_cmaf_url,
347
+ "hls_url": hls_url,
348
+ "iframe_url": iframe_url,
349
+ "loop": loop,
350
+ "name": name,
351
+ "player_id": player_id,
352
+ "playlist_type": playlist_type,
353
+ "start_time": start_time,
354
+ "video_ids": video_ids,
355
+ },
356
+ playlist_update_params.PlaylistUpdateParams,
357
+ ),
358
+ options=make_request_options(
359
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
360
+ ),
361
+ cast_to=Playlist,
362
+ )
363
+
364
+ def list(
365
+ self,
366
+ *,
367
+ page: int | NotGiven = NOT_GIVEN,
368
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
369
+ # The extra values given here take precedence over values defined on the client or passed to this method.
370
+ extra_headers: Headers | None = None,
371
+ extra_query: Query | None = None,
372
+ extra_body: Body | None = None,
373
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
374
+ ) -> SyncPageStreaming[Playlist]:
375
+ """Returns a list of created playlists
376
+
377
+ Args:
378
+ page: Query parameter.
379
+
380
+ Use it to list the paginated content
381
+
382
+ extra_headers: Send extra headers
383
+
384
+ extra_query: Add additional query parameters to the request
385
+
386
+ extra_body: Add additional JSON properties to the request
387
+
388
+ timeout: Override the client-level default timeout for this request, in seconds
389
+ """
390
+ return self._get_api_list(
391
+ "/streaming/playlists",
392
+ page=SyncPageStreaming[Playlist],
393
+ options=make_request_options(
394
+ extra_headers=extra_headers,
395
+ extra_query=extra_query,
396
+ extra_body=extra_body,
397
+ timeout=timeout,
398
+ query=maybe_transform({"page": page}, playlist_list_params.PlaylistListParams),
399
+ ),
400
+ model=Playlist,
401
+ )
402
+
403
+ def delete(
404
+ self,
405
+ playlist_id: int,
406
+ *,
407
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
408
+ # The extra values given here take precedence over values defined on the client or passed to this method.
409
+ extra_headers: Headers | None = None,
410
+ extra_query: Query | None = None,
411
+ extra_body: Body | None = None,
412
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
413
+ ) -> None:
414
+ """
415
+ Delete playlist
416
+
417
+ Args:
418
+ extra_headers: Send extra headers
419
+
420
+ extra_query: Add additional query parameters to the request
421
+
422
+ extra_body: Add additional JSON properties to the request
423
+
424
+ timeout: Override the client-level default timeout for this request, in seconds
425
+ """
426
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
427
+ return self._delete(
428
+ f"/streaming/playlists/{playlist_id}",
429
+ options=make_request_options(
430
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
431
+ ),
432
+ cast_to=NoneType,
433
+ )
434
+
435
+ def get(
436
+ self,
437
+ playlist_id: int,
438
+ *,
439
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
440
+ # The extra values given here take precedence over values defined on the client or passed to this method.
441
+ extra_headers: Headers | None = None,
442
+ extra_query: Query | None = None,
443
+ extra_body: Body | None = None,
444
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
445
+ ) -> Playlist:
446
+ """
447
+ Returns a playlist details
448
+
449
+ Args:
450
+ extra_headers: Send extra headers
451
+
452
+ extra_query: Add additional query parameters to the request
453
+
454
+ extra_body: Add additional JSON properties to the request
455
+
456
+ timeout: Override the client-level default timeout for this request, in seconds
457
+ """
458
+ return self._get(
459
+ f"/streaming/playlists/{playlist_id}",
460
+ options=make_request_options(
461
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
462
+ ),
463
+ cast_to=Playlist,
464
+ )
465
+
466
+ def list_videos(
467
+ self,
468
+ playlist_id: int,
469
+ *,
470
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
471
+ # The extra values given here take precedence over values defined on the client or passed to this method.
472
+ extra_headers: Headers | None = None,
473
+ extra_query: Query | None = None,
474
+ extra_body: Body | None = None,
475
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
476
+ ) -> PlaylistListVideosResponse:
477
+ """
478
+ Shows ordered array of playlist videos
479
+
480
+ Args:
481
+ extra_headers: Send extra headers
482
+
483
+ extra_query: Add additional query parameters to the request
484
+
485
+ extra_body: Add additional JSON properties to the request
486
+
487
+ timeout: Override the client-level default timeout for this request, in seconds
488
+ """
489
+ return self._get(
490
+ f"/streaming/playlists/{playlist_id}/videos",
491
+ options=make_request_options(
492
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
493
+ ),
494
+ cast_to=PlaylistListVideosResponse,
495
+ )
496
+
497
+
498
+ class AsyncPlaylistsResource(AsyncAPIResource):
499
+ @cached_property
500
+ def with_raw_response(self) -> AsyncPlaylistsResourceWithRawResponse:
501
+ """
502
+ This property can be used as a prefix for any HTTP method call to return
503
+ the raw response object instead of the parsed content.
504
+
505
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
506
+ """
507
+ return AsyncPlaylistsResourceWithRawResponse(self)
508
+
509
+ @cached_property
510
+ def with_streaming_response(self) -> AsyncPlaylistsResourceWithStreamingResponse:
511
+ """
512
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
513
+
514
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
515
+ """
516
+ return AsyncPlaylistsResourceWithStreamingResponse(self)
517
+
518
+ async def create(
519
+ self,
520
+ *,
521
+ active: bool | NotGiven = NOT_GIVEN,
522
+ ad_id: int | NotGiven = NOT_GIVEN,
523
+ client_id: int | NotGiven = NOT_GIVEN,
524
+ client_user_id: int | NotGiven = NOT_GIVEN,
525
+ countdown: bool | NotGiven = NOT_GIVEN,
526
+ hls_cmaf_url: str | NotGiven = NOT_GIVEN,
527
+ hls_url: str | NotGiven = NOT_GIVEN,
528
+ iframe_url: str | NotGiven = NOT_GIVEN,
529
+ loop: bool | NotGiven = NOT_GIVEN,
530
+ name: str | NotGiven = NOT_GIVEN,
531
+ player_id: int | NotGiven = NOT_GIVEN,
532
+ playlist_type: Literal["live", "vod"] | NotGiven = NOT_GIVEN,
533
+ start_time: str | NotGiven = NOT_GIVEN,
534
+ video_ids: Iterable[int] | NotGiven = NOT_GIVEN,
535
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
536
+ # The extra values given here take precedence over values defined on the client or passed to this method.
537
+ extra_headers: Headers | None = None,
538
+ extra_query: Query | None = None,
539
+ extra_body: Body | None = None,
540
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
541
+ ) -> PlaylistCreate:
542
+ """
543
+ Playlist is a curated collection of video content organized in a sequential
544
+ manner. This method offers several advantages and features that are typical of
545
+ live streaming but with more control over the content. Here's how it works:
546
+
547
+ - Playlist always consists only of static VOD videos you previously uploaded to
548
+ the system.
549
+ - Playlist is always played as a "Live stream" for end-users, so without the
550
+ ability to fast forward the stream to the “future”. Manifest will contain
551
+ chunks as for live stream too.
552
+ - Playlist can be looped endlessly. In this case, all the videos in the list
553
+ will be constantly repeated through the list.
554
+ - Playlist can be programmed to be played at a specific time in the future. In
555
+ that case, before the start time there will be empty manifest. You can add new
556
+ videos to the list, remove unnecessary videos, or change the order of videos
557
+ in the list. But please pay attention to when the video list changes, it is
558
+ updated instantly on the server. This means that after saving the changed
559
+ list, the playlist will be reloaded for all users and it will start plays from
560
+ the very first element. Maximum video limit = 128 videos in a row.
561
+
562
+ Examples of usage:
563
+
564
+ - Looped video playback
565
+ - Scheduled playback **Looped video playback** It can be used to simulate TV
566
+ channel pre-programmed behaviour.
567
+ - Selection: Choose a series of videos, such as TV show episodes, movies,
568
+ tutorials, or any other relevant content.
569
+ - Order: Arrange the selected videos in the desired sequence, much like setting
570
+ a broadcast schedule.
571
+ - Looping: Optionally, the playlist can be set to loop, replaying the sequence
572
+ once it finishes to maintain a continuous stream. Example:
573
+
574
+ ```
575
+ active: true
576
+ loop: true
577
+ name: "Playlist: TV channel 'The world around us' (Programmed broadcast for 24 hours)"
578
+ ```
579
+
580
+ **Scheduled playback** It can be used to simulate live events such as virtual
581
+ concerts, webinars, or any special broadcasts without the logistical challenges
582
+ of an actual live stream.
583
+
584
+ - Timing: Set specific start time, creating the illusion of a live broadcast
585
+ schedule.
586
+ - Selection: Choose a video or series of videos to be played at the specified
587
+ time.
588
+ - No Pauses: Unlike on-demand streaming where users can pause and skip, this
589
+ emulated live stream runs continuously, mirroring the constraints of
590
+ traditional live broadcasts.
591
+
592
+ ```
593
+ active: true
594
+ loop: false
595
+ name: "Playlist: Webinar 'Onboarding for new employees on working with the corporate portal'"
596
+ `start_time`: "2024-07-01T11:00:00Z"
597
+ ```
598
+
599
+ Args:
600
+ active:
601
+ Enables/Disables playlist. Has two possible values:
602
+
603
+ - true – Playlist can be played.
604
+ - false – Playlist is disabled. No broadcast while it's desabled.
605
+
606
+ ad_id: The advertisement ID that will be inserted into the video
607
+
608
+ client_id: Current playlist client ID
609
+
610
+ client_user_id: Custom field where you can specify user ID in your system
611
+
612
+ countdown: Enables countdown before playlist start with `playlist_type: live`
613
+
614
+ hls_cmaf_url: A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks
615
+ are in fMP4 container.
616
+
617
+ It is possible to use the same suffix-options as described in the "`hls_url`"
618
+ attribute.
619
+
620
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
621
+ and intended for your use. Any additional internal manifests, sub-manifests,
622
+ parameters, chunk names, file extensions, and related components are internal
623
+ infrastructure entities. These may undergo modifications without prior notice,
624
+ in any manner or form. It is strongly advised not to store them in your database
625
+ or cache them on your end.
626
+
627
+ hls_url: A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
628
+
629
+ This URL is a link to the main manifest. But you can also manually specify
630
+ suffix-options that will allow you to change the manifest to your request:
631
+ `` /playlists/{`client_id`}_{`playlist_id`}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8 ``
632
+ Please see the details in `hls_url` attribute of /videos/{id} method.
633
+
634
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
635
+ and intended for your use. Any additional internal manifests, sub-manifests,
636
+ parameters, chunk names, file extensions, and related components are internal
637
+ infrastructure entities. These may undergo modifications without prior notice,
638
+ in any manner or form. It is strongly advised not to store them in your database
639
+ or cache them on your end.
640
+
641
+ iframe_url: A URL to a built-in HTML video player with the video inside. It can be inserted
642
+ into an iframe on your website and the video will automatically play in all
643
+ browsers. The player can be opened or shared via this direct link. Also the
644
+ video player can be integrated into your web pages using the Iframe tag.
645
+
646
+ Please see the details in `iframe_url` attribute of /videos/{id} method.
647
+
648
+ loop: Enables/Disables playlist loop
649
+
650
+ name: Playlist name
651
+
652
+ player_id: The player ID with which the video will be played
653
+
654
+ playlist_type:
655
+ Determines whether the playlist:
656
+
657
+ - `live` - playlist for live-streaming
658
+ - `vod` - playlist is for video on demand access
659
+
660
+ start_time: Playlist start time. Playlist won't be available before the specified time.
661
+ Datetime in ISO 8601 format.
662
+
663
+ video_ids: A list of VOD IDs included in the playlist. Order of videos in a playlist
664
+ reflects the order of IDs in the array. Maximum video limit = 128.
665
+
666
+ extra_headers: Send extra headers
667
+
668
+ extra_query: Add additional query parameters to the request
669
+
670
+ extra_body: Add additional JSON properties to the request
671
+
672
+ timeout: Override the client-level default timeout for this request, in seconds
673
+ """
674
+ return await self._post(
675
+ "/streaming/playlists",
676
+ body=await async_maybe_transform(
677
+ {
678
+ "active": active,
679
+ "ad_id": ad_id,
680
+ "client_id": client_id,
681
+ "client_user_id": client_user_id,
682
+ "countdown": countdown,
683
+ "hls_cmaf_url": hls_cmaf_url,
684
+ "hls_url": hls_url,
685
+ "iframe_url": iframe_url,
686
+ "loop": loop,
687
+ "name": name,
688
+ "player_id": player_id,
689
+ "playlist_type": playlist_type,
690
+ "start_time": start_time,
691
+ "video_ids": video_ids,
692
+ },
693
+ playlist_create_params.PlaylistCreateParams,
694
+ ),
695
+ options=make_request_options(
696
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
697
+ ),
698
+ cast_to=PlaylistCreate,
699
+ )
700
+
701
+ async def update(
702
+ self,
703
+ playlist_id: int,
704
+ *,
705
+ active: bool | NotGiven = NOT_GIVEN,
706
+ ad_id: int | NotGiven = NOT_GIVEN,
707
+ client_id: int | NotGiven = NOT_GIVEN,
708
+ client_user_id: int | NotGiven = NOT_GIVEN,
709
+ countdown: bool | NotGiven = NOT_GIVEN,
710
+ hls_cmaf_url: str | NotGiven = NOT_GIVEN,
711
+ hls_url: str | NotGiven = NOT_GIVEN,
712
+ iframe_url: str | NotGiven = NOT_GIVEN,
713
+ loop: bool | NotGiven = NOT_GIVEN,
714
+ name: str | NotGiven = NOT_GIVEN,
715
+ player_id: int | NotGiven = NOT_GIVEN,
716
+ playlist_type: Literal["live", "vod"] | NotGiven = NOT_GIVEN,
717
+ start_time: str | NotGiven = NOT_GIVEN,
718
+ video_ids: Iterable[int] | NotGiven = NOT_GIVEN,
719
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
720
+ # The extra values given here take precedence over values defined on the client or passed to this method.
721
+ extra_headers: Headers | None = None,
722
+ extra_query: Query | None = None,
723
+ extra_body: Body | None = None,
724
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
725
+ ) -> Playlist:
726
+ """Change playlist
727
+
728
+ Args:
729
+ active:
730
+ Enables/Disables playlist.
731
+
732
+ Has two possible values:
733
+
734
+ - true – Playlist can be played.
735
+ - false – Playlist is disabled. No broadcast while it's desabled.
736
+
737
+ ad_id: The advertisement ID that will be inserted into the video
738
+
739
+ client_id: Current playlist client ID
740
+
741
+ client_user_id: Custom field where you can specify user ID in your system
742
+
743
+ countdown: Enables countdown before playlist start with `playlist_type: live`
744
+
745
+ hls_cmaf_url: A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks
746
+ are in fMP4 container.
747
+
748
+ It is possible to use the same suffix-options as described in the "`hls_url`"
749
+ attribute.
750
+
751
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
752
+ and intended for your use. Any additional internal manifests, sub-manifests,
753
+ parameters, chunk names, file extensions, and related components are internal
754
+ infrastructure entities. These may undergo modifications without prior notice,
755
+ in any manner or form. It is strongly advised not to store them in your database
756
+ or cache them on your end.
757
+
758
+ hls_url: A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
759
+
760
+ This URL is a link to the main manifest. But you can also manually specify
761
+ suffix-options that will allow you to change the manifest to your request:
762
+ `` /playlists/{`client_id`}_{`playlist_id`}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8 ``
763
+ Please see the details in `hls_url` attribute of /videos/{id} method.
764
+
765
+ Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented
766
+ and intended for your use. Any additional internal manifests, sub-manifests,
767
+ parameters, chunk names, file extensions, and related components are internal
768
+ infrastructure entities. These may undergo modifications without prior notice,
769
+ in any manner or form. It is strongly advised not to store them in your database
770
+ or cache them on your end.
771
+
772
+ iframe_url: A URL to a built-in HTML video player with the video inside. It can be inserted
773
+ into an iframe on your website and the video will automatically play in all
774
+ browsers. The player can be opened or shared via this direct link. Also the
775
+ video player can be integrated into your web pages using the Iframe tag.
776
+
777
+ Please see the details in `iframe_url` attribute of /videos/{id} method.
778
+
779
+ loop: Enables/Disables playlist loop
780
+
781
+ name: Playlist name
782
+
783
+ player_id: The player ID with which the video will be played
784
+
785
+ playlist_type:
786
+ Determines whether the playlist:
787
+
788
+ - `live` - playlist for live-streaming
789
+ - `vod` - playlist is for video on demand access
790
+
791
+ start_time: Playlist start time. Playlist won't be available before the specified time.
792
+ Datetime in ISO 8601 format.
793
+
794
+ video_ids: A list of VOD IDs included in the playlist. Order of videos in a playlist
795
+ reflects the order of IDs in the array. Maximum video limit = 128.
796
+
797
+ extra_headers: Send extra headers
798
+
799
+ extra_query: Add additional query parameters to the request
800
+
801
+ extra_body: Add additional JSON properties to the request
802
+
803
+ timeout: Override the client-level default timeout for this request, in seconds
804
+ """
805
+ return await self._patch(
806
+ f"/streaming/playlists/{playlist_id}",
807
+ body=await async_maybe_transform(
808
+ {
809
+ "active": active,
810
+ "ad_id": ad_id,
811
+ "client_id": client_id,
812
+ "client_user_id": client_user_id,
813
+ "countdown": countdown,
814
+ "hls_cmaf_url": hls_cmaf_url,
815
+ "hls_url": hls_url,
816
+ "iframe_url": iframe_url,
817
+ "loop": loop,
818
+ "name": name,
819
+ "player_id": player_id,
820
+ "playlist_type": playlist_type,
821
+ "start_time": start_time,
822
+ "video_ids": video_ids,
823
+ },
824
+ playlist_update_params.PlaylistUpdateParams,
825
+ ),
826
+ options=make_request_options(
827
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
828
+ ),
829
+ cast_to=Playlist,
830
+ )
831
+
832
+ def list(
833
+ self,
834
+ *,
835
+ page: int | NotGiven = NOT_GIVEN,
836
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
837
+ # The extra values given here take precedence over values defined on the client or passed to this method.
838
+ extra_headers: Headers | None = None,
839
+ extra_query: Query | None = None,
840
+ extra_body: Body | None = None,
841
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
842
+ ) -> AsyncPaginator[Playlist, AsyncPageStreaming[Playlist]]:
843
+ """Returns a list of created playlists
844
+
845
+ Args:
846
+ page: Query parameter.
847
+
848
+ Use it to list the paginated content
849
+
850
+ extra_headers: Send extra headers
851
+
852
+ extra_query: Add additional query parameters to the request
853
+
854
+ extra_body: Add additional JSON properties to the request
855
+
856
+ timeout: Override the client-level default timeout for this request, in seconds
857
+ """
858
+ return self._get_api_list(
859
+ "/streaming/playlists",
860
+ page=AsyncPageStreaming[Playlist],
861
+ options=make_request_options(
862
+ extra_headers=extra_headers,
863
+ extra_query=extra_query,
864
+ extra_body=extra_body,
865
+ timeout=timeout,
866
+ query=maybe_transform({"page": page}, playlist_list_params.PlaylistListParams),
867
+ ),
868
+ model=Playlist,
869
+ )
870
+
871
+ async def delete(
872
+ self,
873
+ playlist_id: int,
874
+ *,
875
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
876
+ # The extra values given here take precedence over values defined on the client or passed to this method.
877
+ extra_headers: Headers | None = None,
878
+ extra_query: Query | None = None,
879
+ extra_body: Body | None = None,
880
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
881
+ ) -> None:
882
+ """
883
+ Delete playlist
884
+
885
+ Args:
886
+ extra_headers: Send extra headers
887
+
888
+ extra_query: Add additional query parameters to the request
889
+
890
+ extra_body: Add additional JSON properties to the request
891
+
892
+ timeout: Override the client-level default timeout for this request, in seconds
893
+ """
894
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
895
+ return await self._delete(
896
+ f"/streaming/playlists/{playlist_id}",
897
+ options=make_request_options(
898
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
899
+ ),
900
+ cast_to=NoneType,
901
+ )
902
+
903
+ async def get(
904
+ self,
905
+ playlist_id: int,
906
+ *,
907
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
908
+ # The extra values given here take precedence over values defined on the client or passed to this method.
909
+ extra_headers: Headers | None = None,
910
+ extra_query: Query | None = None,
911
+ extra_body: Body | None = None,
912
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
913
+ ) -> Playlist:
914
+ """
915
+ Returns a playlist details
916
+
917
+ Args:
918
+ extra_headers: Send extra headers
919
+
920
+ extra_query: Add additional query parameters to the request
921
+
922
+ extra_body: Add additional JSON properties to the request
923
+
924
+ timeout: Override the client-level default timeout for this request, in seconds
925
+ """
926
+ return await self._get(
927
+ f"/streaming/playlists/{playlist_id}",
928
+ options=make_request_options(
929
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
930
+ ),
931
+ cast_to=Playlist,
932
+ )
933
+
934
+ async def list_videos(
935
+ self,
936
+ playlist_id: int,
937
+ *,
938
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
939
+ # The extra values given here take precedence over values defined on the client or passed to this method.
940
+ extra_headers: Headers | None = None,
941
+ extra_query: Query | None = None,
942
+ extra_body: Body | None = None,
943
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
944
+ ) -> PlaylistListVideosResponse:
945
+ """
946
+ Shows ordered array of playlist videos
947
+
948
+ Args:
949
+ extra_headers: Send extra headers
950
+
951
+ extra_query: Add additional query parameters to the request
952
+
953
+ extra_body: Add additional JSON properties to the request
954
+
955
+ timeout: Override the client-level default timeout for this request, in seconds
956
+ """
957
+ return await self._get(
958
+ f"/streaming/playlists/{playlist_id}/videos",
959
+ options=make_request_options(
960
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
961
+ ),
962
+ cast_to=PlaylistListVideosResponse,
963
+ )
964
+
965
+
966
+ class PlaylistsResourceWithRawResponse:
967
+ def __init__(self, playlists: PlaylistsResource) -> None:
968
+ self._playlists = playlists
969
+
970
+ self.create = to_raw_response_wrapper(
971
+ playlists.create,
972
+ )
973
+ self.update = to_raw_response_wrapper(
974
+ playlists.update,
975
+ )
976
+ self.list = to_raw_response_wrapper(
977
+ playlists.list,
978
+ )
979
+ self.delete = to_raw_response_wrapper(
980
+ playlists.delete,
981
+ )
982
+ self.get = to_raw_response_wrapper(
983
+ playlists.get,
984
+ )
985
+ self.list_videos = to_raw_response_wrapper(
986
+ playlists.list_videos,
987
+ )
988
+
989
+
990
+ class AsyncPlaylistsResourceWithRawResponse:
991
+ def __init__(self, playlists: AsyncPlaylistsResource) -> None:
992
+ self._playlists = playlists
993
+
994
+ self.create = async_to_raw_response_wrapper(
995
+ playlists.create,
996
+ )
997
+ self.update = async_to_raw_response_wrapper(
998
+ playlists.update,
999
+ )
1000
+ self.list = async_to_raw_response_wrapper(
1001
+ playlists.list,
1002
+ )
1003
+ self.delete = async_to_raw_response_wrapper(
1004
+ playlists.delete,
1005
+ )
1006
+ self.get = async_to_raw_response_wrapper(
1007
+ playlists.get,
1008
+ )
1009
+ self.list_videos = async_to_raw_response_wrapper(
1010
+ playlists.list_videos,
1011
+ )
1012
+
1013
+
1014
+ class PlaylistsResourceWithStreamingResponse:
1015
+ def __init__(self, playlists: PlaylistsResource) -> None:
1016
+ self._playlists = playlists
1017
+
1018
+ self.create = to_streamed_response_wrapper(
1019
+ playlists.create,
1020
+ )
1021
+ self.update = to_streamed_response_wrapper(
1022
+ playlists.update,
1023
+ )
1024
+ self.list = to_streamed_response_wrapper(
1025
+ playlists.list,
1026
+ )
1027
+ self.delete = to_streamed_response_wrapper(
1028
+ playlists.delete,
1029
+ )
1030
+ self.get = to_streamed_response_wrapper(
1031
+ playlists.get,
1032
+ )
1033
+ self.list_videos = to_streamed_response_wrapper(
1034
+ playlists.list_videos,
1035
+ )
1036
+
1037
+
1038
+ class AsyncPlaylistsResourceWithStreamingResponse:
1039
+ def __init__(self, playlists: AsyncPlaylistsResource) -> None:
1040
+ self._playlists = playlists
1041
+
1042
+ self.create = async_to_streamed_response_wrapper(
1043
+ playlists.create,
1044
+ )
1045
+ self.update = async_to_streamed_response_wrapper(
1046
+ playlists.update,
1047
+ )
1048
+ self.list = async_to_streamed_response_wrapper(
1049
+ playlists.list,
1050
+ )
1051
+ self.delete = async_to_streamed_response_wrapper(
1052
+ playlists.delete,
1053
+ )
1054
+ self.get = async_to_streamed_response_wrapper(
1055
+ playlists.get,
1056
+ )
1057
+ self.list_videos = async_to_streamed_response_wrapper(
1058
+ playlists.list_videos,
1059
+ )