gcore 0.6.0__py3-none-any.whl → 0.8.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.
- gcore/_client.py +9 -0
- gcore/_models.py +24 -3
- gcore/_version.py +1 -1
- gcore/pagination.py +101 -63
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/__init__.py +28 -0
- gcore/resources/cloud/cloud.py +64 -0
- gcore/resources/cloud/cost_reports.py +811 -0
- gcore/resources/cloud/file_shares/file_shares.py +10 -0
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +61 -26
- gcore/resources/cloud/inference/registry_credentials.py +4 -6
- gcore/resources/cloud/usage_reports.py +337 -0
- gcore/resources/iam/users.py +5 -5
- gcore/resources/streaming/__init__.py +159 -0
- gcore/resources/streaming/ai_tasks.py +1288 -0
- gcore/resources/streaming/broadcasts.py +579 -0
- gcore/resources/streaming/directories.py +515 -0
- gcore/resources/streaming/players.py +577 -0
- gcore/resources/streaming/playlists.py +1059 -0
- gcore/resources/streaming/quality_sets.py +331 -0
- gcore/resources/streaming/restreams.py +484 -0
- gcore/resources/streaming/statistics.py +3224 -0
- gcore/resources/streaming/streaming.py +390 -0
- gcore/resources/streaming/streams/__init__.py +33 -0
- gcore/resources/streaming/streams/overlays.py +716 -0
- gcore/resources/streaming/streams/streams.py +1592 -0
- gcore/resources/streaming/videos/__init__.py +33 -0
- gcore/resources/streaming/videos/subtitles.py +623 -0
- gcore/resources/streaming/videos/videos.py +1553 -0
- gcore/resources/waap/ip_info.py +28 -10
- gcore/types/cloud/__init__.py +10 -0
- gcore/types/cloud/cost_report_aggregated.py +865 -0
- gcore/types/cloud/cost_report_aggregated_monthly.py +865 -0
- gcore/types/cloud/cost_report_detailed.py +1343 -0
- gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +394 -0
- gcore/types/cloud/cost_report_get_aggregated_params.py +409 -0
- gcore/types/cloud/cost_report_get_detailed_params.py +435 -0
- gcore/types/cloud/file_share.py +37 -3
- gcore/types/cloud/file_share_create_params.py +16 -0
- gcore/types/cloud/floating_ip.py +0 -9
- gcore/types/cloud/floating_ip_detailed.py +0 -9
- gcore/types/cloud/gpu_baremetal_cluster.py +2 -2
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +9 -0
- gcore/types/cloud/quota_get_all_response.py +24 -2
- gcore/types/cloud/quota_get_by_region_response.py +24 -2
- gcore/types/cloud/quotas/request_create_params.py +12 -1
- gcore/types/cloud/quotas/request_get_response.py +12 -1
- gcore/types/cloud/quotas/request_list_response.py +12 -1
- gcore/types/cloud/subnet.py +1 -1
- gcore/types/cloud/usage_report.py +1612 -0
- gcore/types/cloud/usage_report_get_params.py +432 -0
- gcore/types/streaming/__init__.py +143 -0
- gcore/types/streaming/ai_contentmoderation_casm.py +39 -0
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +54 -0
- gcore/types/streaming/ai_contentmoderation_nsfw.py +39 -0
- gcore/types/streaming/ai_contentmoderation_softnudity.py +66 -0
- gcore/types/streaming/ai_contentmoderation_sport.py +39 -0
- gcore/types/streaming/ai_contentmoderation_weapon.py +39 -0
- gcore/types/streaming/ai_task.py +205 -0
- gcore/types/streaming/ai_task_cancel_response.py +12 -0
- gcore/types/streaming/ai_task_create_params.py +168 -0
- gcore/types/streaming/ai_task_create_response.py +10 -0
- gcore/types/streaming/ai_task_get_ai_settings_params.py +27 -0
- gcore/types/streaming/ai_task_get_ai_settings_response.py +12 -0
- gcore/types/streaming/ai_task_get_response.py +313 -0
- gcore/types/streaming/ai_task_list_params.py +50 -0
- gcore/types/streaming/broadcast.py +71 -0
- gcore/types/streaming/broadcast_create_params.py +76 -0
- gcore/types/streaming/broadcast_list_params.py +12 -0
- gcore/types/streaming/broadcast_spectators_count.py +12 -0
- gcore/types/streaming/broadcast_update_params.py +76 -0
- gcore/types/streaming/clip.py +78 -0
- gcore/types/streaming/create_video_param.py +214 -0
- gcore/types/streaming/direct_upload_parameters.py +33 -0
- gcore/types/streaming/directories_tree.py +19 -0
- gcore/types/streaming/directory_base.py +31 -0
- gcore/types/streaming/directory_create_params.py +15 -0
- gcore/types/streaming/directory_get_response.py +19 -0
- gcore/types/streaming/directory_item.py +13 -0
- gcore/types/streaming/directory_update_params.py +18 -0
- gcore/types/streaming/directory_video.py +13 -0
- gcore/types/streaming/ffprobes.py +25 -0
- gcore/types/streaming/max_stream_series.py +21 -0
- gcore/types/streaming/meet_series.py +23 -0
- gcore/types/streaming/player.py +114 -0
- gcore/types/streaming/player_create_params.py +18 -0
- gcore/types/streaming/player_list_params.py +12 -0
- gcore/types/streaming/player_param.py +114 -0
- gcore/types/streaming/player_update_params.py +18 -0
- gcore/types/streaming/playlist.py +102 -0
- gcore/types/streaming/playlist_create.py +12 -0
- gcore/types/streaming/playlist_create_params.py +102 -0
- gcore/types/streaming/playlist_list_params.py +12 -0
- gcore/types/streaming/playlist_list_videos_response.py +10 -0
- gcore/types/streaming/playlist_update_params.py +102 -0
- gcore/types/streaming/playlist_video.py +215 -0
- gcore/types/streaming/popular_videos.py +17 -0
- gcore/types/streaming/quality_set_set_default_params.py +23 -0
- gcore/types/streaming/quality_sets.py +57 -0
- gcore/types/streaming/restream.py +37 -0
- gcore/types/streaming/restream_create_params.py +41 -0
- gcore/types/streaming/restream_list_params.py +12 -0
- gcore/types/streaming/restream_update_params.py +41 -0
- gcore/types/streaming/statistic_get_ffprobes_params.py +22 -0
- gcore/types/streaming/statistic_get_live_unique_viewers_params.py +26 -0
- gcore/types/streaming/statistic_get_live_unique_viewers_response.py +25 -0
- gcore/types/streaming/statistic_get_live_watch_time_cdn_params.py +32 -0
- gcore/types/streaming/statistic_get_live_watch_time_total_cdn_params.py +30 -0
- gcore/types/streaming/statistic_get_max_streams_series_params.py +20 -0
- gcore/types/streaming/statistic_get_meet_series_params.py +20 -0
- gcore/types/streaming/statistic_get_popular_videos_params.py +15 -0
- gcore/types/streaming/statistic_get_storage_series_params.py +20 -0
- gcore/types/streaming/statistic_get_stream_series_params.py +20 -0
- gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +27 -0
- gcore/types/streaming/statistic_get_unique_viewers_params.py +34 -0
- gcore/types/streaming/statistic_get_views_by_browsers_params.py +15 -0
- gcore/types/streaming/statistic_get_views_by_country_params.py +15 -0
- gcore/types/streaming/statistic_get_views_by_hostname_params.py +15 -0
- gcore/types/streaming/statistic_get_views_by_operating_system_params.py +15 -0
- gcore/types/streaming/statistic_get_views_by_referer_params.py +15 -0
- gcore/types/streaming/statistic_get_views_by_region_params.py +15 -0
- gcore/types/streaming/statistic_get_views_heatmap_params.py +21 -0
- gcore/types/streaming/statistic_get_views_params.py +34 -0
- gcore/types/streaming/statistic_get_vod_storage_volume_params.py +17 -0
- gcore/types/streaming/statistic_get_vod_transcoding_duration_params.py +17 -0
- gcore/types/streaming/statistic_get_vod_unique_viewers_cdn_params.py +26 -0
- gcore/types/streaming/statistic_get_vod_watch_time_cdn_params.py +32 -0
- gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_params.py +30 -0
- gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_response.py +22 -0
- gcore/types/streaming/storage_series.py +23 -0
- gcore/types/streaming/stream.py +420 -0
- gcore/types/streaming/stream_create_clip_params.py +48 -0
- gcore/types/streaming/stream_create_params.py +165 -0
- gcore/types/streaming/stream_list_clips_response.py +10 -0
- gcore/types/streaming/stream_list_params.py +18 -0
- gcore/types/streaming/stream_series.py +21 -0
- gcore/types/streaming/stream_start_recording_response.py +76 -0
- gcore/types/streaming/stream_update_params.py +169 -0
- gcore/types/streaming/streams/__init__.py +11 -0
- gcore/types/streaming/streams/overlay.py +43 -0
- gcore/types/streaming/streams/overlay_create_params.py +36 -0
- gcore/types/streaming/streams/overlay_create_response.py +10 -0
- gcore/types/streaming/streams/overlay_list_response.py +10 -0
- gcore/types/streaming/streams/overlay_update_multiple_params.py +39 -0
- gcore/types/streaming/streams/overlay_update_multiple_response.py +10 -0
- gcore/types/streaming/streams/overlay_update_params.py +33 -0
- gcore/types/streaming/subtitle.py +12 -0
- gcore/types/streaming/subtitle_base.py +18 -0
- gcore/types/streaming/subtitle_base_param.py +18 -0
- gcore/types/streaming/unique_viewers.py +35 -0
- gcore/types/streaming/unique_viewers_cdn.py +17 -0
- gcore/types/streaming/video.py +444 -0
- gcore/types/streaming/video_create_multiple_params.py +28 -0
- gcore/types/streaming/video_create_multiple_response.py +10 -0
- gcore/types/streaming/video_create_params.py +13 -0
- gcore/types/streaming/video_create_response.py +10 -0
- gcore/types/streaming/video_list_names_params.py +13 -0
- gcore/types/streaming/video_list_params.py +59 -0
- gcore/types/streaming/video_update_params.py +214 -0
- gcore/types/streaming/videos/__init__.py +7 -0
- gcore/types/streaming/videos/subtitle_create_params.py +17 -0
- gcore/types/streaming/videos/subtitle_list_response.py +10 -0
- gcore/types/streaming/videos/subtitle_update_params.py +20 -0
- gcore/types/streaming/views.py +35 -0
- gcore/types/streaming/views_by_browser.py +17 -0
- gcore/types/streaming/views_by_country.py +19 -0
- gcore/types/streaming/views_by_hostname.py +17 -0
- gcore/types/streaming/views_by_operating_system.py +17 -0
- gcore/types/streaming/views_by_referer.py +17 -0
- gcore/types/streaming/views_by_region.py +19 -0
- gcore/types/streaming/views_heatmap.py +19 -0
- gcore/types/streaming/vod_statistics_series.py +21 -0
- gcore/types/streaming/vod_total_stream_duration_series.py +22 -0
- gcore/types/waap/domains/custom_rule_create_params.py +4 -4
- gcore/types/waap/domains/custom_rule_update_params.py +4 -4
- gcore/types/waap/ip_info_get_blocked_requests_params.py +5 -1
- gcore/types/waap/ip_info_get_counts_params.py +2 -1
- gcore/types/waap/ip_info_get_top_sessions_params.py +5 -1
- gcore/types/waap/ip_info_get_top_urls_params.py +5 -1
- gcore/types/waap/ip_info_get_top_user_agents_params.py +5 -1
- gcore/types/waap/waap_custom_rule.py +4 -4
- {gcore-0.6.0.dist-info → gcore-0.8.0.dist-info}/METADATA +1 -1
- {gcore-0.6.0.dist-info → gcore-0.8.0.dist-info}/RECORD +185 -37
- {gcore-0.6.0.dist-info → gcore-0.8.0.dist-info}/WHEEL +0 -0
- {gcore-0.6.0.dist-info → gcore-0.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
8
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
9
|
+
from ..._compat import cached_property
|
|
10
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ..._response import (
|
|
12
|
+
to_raw_response_wrapper,
|
|
13
|
+
to_streamed_response_wrapper,
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
)
|
|
17
|
+
from ...pagination import SyncPageStreaming, AsyncPageStreaming
|
|
18
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
19
|
+
from ...types.streaming import broadcast_list_params, broadcast_create_params, broadcast_update_params
|
|
20
|
+
from ...types.streaming.broadcast import Broadcast
|
|
21
|
+
from ...types.streaming.broadcast_spectators_count import BroadcastSpectatorsCount
|
|
22
|
+
|
|
23
|
+
__all__ = ["BroadcastsResource", "AsyncBroadcastsResource"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BroadcastsResource(SyncAPIResource):
|
|
27
|
+
@cached_property
|
|
28
|
+
def with_raw_response(self) -> BroadcastsResourceWithRawResponse:
|
|
29
|
+
"""
|
|
30
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
31
|
+
the raw response object instead of the parsed content.
|
|
32
|
+
|
|
33
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
34
|
+
"""
|
|
35
|
+
return BroadcastsResourceWithRawResponse(self)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_streaming_response(self) -> BroadcastsResourceWithStreamingResponse:
|
|
39
|
+
"""
|
|
40
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
41
|
+
|
|
42
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
43
|
+
"""
|
|
44
|
+
return BroadcastsResourceWithStreamingResponse(self)
|
|
45
|
+
|
|
46
|
+
def create(
|
|
47
|
+
self,
|
|
48
|
+
*,
|
|
49
|
+
broadcast: broadcast_create_params.Broadcast | NotGiven = NOT_GIVEN,
|
|
50
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
51
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
52
|
+
extra_headers: Headers | None = None,
|
|
53
|
+
extra_query: Query | None = None,
|
|
54
|
+
extra_body: Body | None = None,
|
|
55
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
56
|
+
) -> None:
|
|
57
|
+
"""
|
|
58
|
+
Broadcast entity is for setting up HTML video player, which serves to combine:
|
|
59
|
+
|
|
60
|
+
- many live streams,
|
|
61
|
+
- advertising,
|
|
62
|
+
- and design in one config. If you use other players or you get streams by
|
|
63
|
+
direct .m3u8/.mpd links, then you will not need this entity.
|
|
64
|
+
|
|
65
|
+
Scheme of "broadcast" entity using:
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
extra_headers: Send extra headers
|
|
70
|
+
|
|
71
|
+
extra_query: Add additional query parameters to the request
|
|
72
|
+
|
|
73
|
+
extra_body: Add additional JSON properties to the request
|
|
74
|
+
|
|
75
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
76
|
+
"""
|
|
77
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
78
|
+
return self._post(
|
|
79
|
+
"/streaming/broadcasts",
|
|
80
|
+
body=maybe_transform({"broadcast": broadcast}, broadcast_create_params.BroadcastCreateParams),
|
|
81
|
+
options=make_request_options(
|
|
82
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
83
|
+
),
|
|
84
|
+
cast_to=NoneType,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
def update(
|
|
88
|
+
self,
|
|
89
|
+
broadcast_id: int,
|
|
90
|
+
*,
|
|
91
|
+
broadcast: broadcast_update_params.Broadcast | NotGiven = NOT_GIVEN,
|
|
92
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
93
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
94
|
+
extra_headers: Headers | None = None,
|
|
95
|
+
extra_query: Query | None = None,
|
|
96
|
+
extra_body: Body | None = None,
|
|
97
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
98
|
+
) -> Broadcast:
|
|
99
|
+
"""
|
|
100
|
+
Updates broadcast settings
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
extra_headers: Send extra headers
|
|
104
|
+
|
|
105
|
+
extra_query: Add additional query parameters to the request
|
|
106
|
+
|
|
107
|
+
extra_body: Add additional JSON properties to the request
|
|
108
|
+
|
|
109
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
110
|
+
"""
|
|
111
|
+
return self._patch(
|
|
112
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
113
|
+
body=maybe_transform({"broadcast": broadcast}, broadcast_update_params.BroadcastUpdateParams),
|
|
114
|
+
options=make_request_options(
|
|
115
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
116
|
+
),
|
|
117
|
+
cast_to=Broadcast,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
def list(
|
|
121
|
+
self,
|
|
122
|
+
*,
|
|
123
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
124
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
125
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
126
|
+
extra_headers: Headers | None = None,
|
|
127
|
+
extra_query: Query | None = None,
|
|
128
|
+
extra_body: Body | None = None,
|
|
129
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
130
|
+
) -> SyncPageStreaming[Broadcast]:
|
|
131
|
+
"""
|
|
132
|
+
Note: Feature "Broadcast" is outdated, soon it will be replaced by
|
|
133
|
+
"Multicamera".
|
|
134
|
+
|
|
135
|
+
Returns a list of broadcasts. Please see description in POST method.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
page: Query parameter. Use it to list the paginated content
|
|
139
|
+
|
|
140
|
+
extra_headers: Send extra headers
|
|
141
|
+
|
|
142
|
+
extra_query: Add additional query parameters to the request
|
|
143
|
+
|
|
144
|
+
extra_body: Add additional JSON properties to the request
|
|
145
|
+
|
|
146
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
147
|
+
"""
|
|
148
|
+
return self._get_api_list(
|
|
149
|
+
"/streaming/broadcasts",
|
|
150
|
+
page=SyncPageStreaming[Broadcast],
|
|
151
|
+
options=make_request_options(
|
|
152
|
+
extra_headers=extra_headers,
|
|
153
|
+
extra_query=extra_query,
|
|
154
|
+
extra_body=extra_body,
|
|
155
|
+
timeout=timeout,
|
|
156
|
+
query=maybe_transform({"page": page}, broadcast_list_params.BroadcastListParams),
|
|
157
|
+
),
|
|
158
|
+
model=Broadcast,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
def delete(
|
|
162
|
+
self,
|
|
163
|
+
broadcast_id: int,
|
|
164
|
+
*,
|
|
165
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
166
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
167
|
+
extra_headers: Headers | None = None,
|
|
168
|
+
extra_query: Query | None = None,
|
|
169
|
+
extra_body: Body | None = None,
|
|
170
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
171
|
+
) -> None:
|
|
172
|
+
"""
|
|
173
|
+
Delete broadcast
|
|
174
|
+
|
|
175
|
+
Args:
|
|
176
|
+
extra_headers: Send extra headers
|
|
177
|
+
|
|
178
|
+
extra_query: Add additional query parameters to the request
|
|
179
|
+
|
|
180
|
+
extra_body: Add additional JSON properties to the request
|
|
181
|
+
|
|
182
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
183
|
+
"""
|
|
184
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
185
|
+
return self._delete(
|
|
186
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
187
|
+
options=make_request_options(
|
|
188
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
189
|
+
),
|
|
190
|
+
cast_to=NoneType,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
def get(
|
|
194
|
+
self,
|
|
195
|
+
broadcast_id: int,
|
|
196
|
+
*,
|
|
197
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
198
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
199
|
+
extra_headers: Headers | None = None,
|
|
200
|
+
extra_query: Query | None = None,
|
|
201
|
+
extra_body: Body | None = None,
|
|
202
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
203
|
+
) -> Broadcast:
|
|
204
|
+
"""
|
|
205
|
+
Returns broadcast details
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
extra_headers: Send extra headers
|
|
209
|
+
|
|
210
|
+
extra_query: Add additional query parameters to the request
|
|
211
|
+
|
|
212
|
+
extra_body: Add additional JSON properties to the request
|
|
213
|
+
|
|
214
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
215
|
+
"""
|
|
216
|
+
return self._get(
|
|
217
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
218
|
+
options=make_request_options(
|
|
219
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
220
|
+
),
|
|
221
|
+
cast_to=Broadcast,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
def get_spectators_count(
|
|
225
|
+
self,
|
|
226
|
+
broadcast_id: int,
|
|
227
|
+
*,
|
|
228
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
229
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
230
|
+
extra_headers: Headers | None = None,
|
|
231
|
+
extra_query: Query | None = None,
|
|
232
|
+
extra_body: Body | None = None,
|
|
233
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
234
|
+
) -> BroadcastSpectatorsCount:
|
|
235
|
+
"""
|
|
236
|
+
Returns number of simultaneous broadcast viewers at the current moment
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
extra_headers: Send extra headers
|
|
240
|
+
|
|
241
|
+
extra_query: Add additional query parameters to the request
|
|
242
|
+
|
|
243
|
+
extra_body: Add additional JSON properties to the request
|
|
244
|
+
|
|
245
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
246
|
+
"""
|
|
247
|
+
return self._get(
|
|
248
|
+
f"/streaming/broadcasts/{broadcast_id}/spectators",
|
|
249
|
+
options=make_request_options(
|
|
250
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
251
|
+
),
|
|
252
|
+
cast_to=BroadcastSpectatorsCount,
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class AsyncBroadcastsResource(AsyncAPIResource):
|
|
257
|
+
@cached_property
|
|
258
|
+
def with_raw_response(self) -> AsyncBroadcastsResourceWithRawResponse:
|
|
259
|
+
"""
|
|
260
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
261
|
+
the raw response object instead of the parsed content.
|
|
262
|
+
|
|
263
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
264
|
+
"""
|
|
265
|
+
return AsyncBroadcastsResourceWithRawResponse(self)
|
|
266
|
+
|
|
267
|
+
@cached_property
|
|
268
|
+
def with_streaming_response(self) -> AsyncBroadcastsResourceWithStreamingResponse:
|
|
269
|
+
"""
|
|
270
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
271
|
+
|
|
272
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
273
|
+
"""
|
|
274
|
+
return AsyncBroadcastsResourceWithStreamingResponse(self)
|
|
275
|
+
|
|
276
|
+
async def create(
|
|
277
|
+
self,
|
|
278
|
+
*,
|
|
279
|
+
broadcast: broadcast_create_params.Broadcast | NotGiven = NOT_GIVEN,
|
|
280
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
281
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
282
|
+
extra_headers: Headers | None = None,
|
|
283
|
+
extra_query: Query | None = None,
|
|
284
|
+
extra_body: Body | None = None,
|
|
285
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
286
|
+
) -> None:
|
|
287
|
+
"""
|
|
288
|
+
Broadcast entity is for setting up HTML video player, which serves to combine:
|
|
289
|
+
|
|
290
|
+
- many live streams,
|
|
291
|
+
- advertising,
|
|
292
|
+
- and design in one config. If you use other players or you get streams by
|
|
293
|
+
direct .m3u8/.mpd links, then you will not need this entity.
|
|
294
|
+
|
|
295
|
+
Scheme of "broadcast" entity using:
|
|
296
|
+

|
|
297
|
+
|
|
298
|
+
Args:
|
|
299
|
+
extra_headers: Send extra headers
|
|
300
|
+
|
|
301
|
+
extra_query: Add additional query parameters to the request
|
|
302
|
+
|
|
303
|
+
extra_body: Add additional JSON properties to the request
|
|
304
|
+
|
|
305
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
306
|
+
"""
|
|
307
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
308
|
+
return await self._post(
|
|
309
|
+
"/streaming/broadcasts",
|
|
310
|
+
body=await async_maybe_transform({"broadcast": broadcast}, broadcast_create_params.BroadcastCreateParams),
|
|
311
|
+
options=make_request_options(
|
|
312
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
313
|
+
),
|
|
314
|
+
cast_to=NoneType,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
async def update(
|
|
318
|
+
self,
|
|
319
|
+
broadcast_id: int,
|
|
320
|
+
*,
|
|
321
|
+
broadcast: broadcast_update_params.Broadcast | NotGiven = NOT_GIVEN,
|
|
322
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
|
+
extra_headers: Headers | None = None,
|
|
325
|
+
extra_query: Query | None = None,
|
|
326
|
+
extra_body: Body | None = None,
|
|
327
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
328
|
+
) -> Broadcast:
|
|
329
|
+
"""
|
|
330
|
+
Updates broadcast settings
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
extra_headers: Send extra headers
|
|
334
|
+
|
|
335
|
+
extra_query: Add additional query parameters to the request
|
|
336
|
+
|
|
337
|
+
extra_body: Add additional JSON properties to the request
|
|
338
|
+
|
|
339
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
340
|
+
"""
|
|
341
|
+
return await self._patch(
|
|
342
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
343
|
+
body=await async_maybe_transform({"broadcast": broadcast}, broadcast_update_params.BroadcastUpdateParams),
|
|
344
|
+
options=make_request_options(
|
|
345
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
346
|
+
),
|
|
347
|
+
cast_to=Broadcast,
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
def list(
|
|
351
|
+
self,
|
|
352
|
+
*,
|
|
353
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
354
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
355
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
356
|
+
extra_headers: Headers | None = None,
|
|
357
|
+
extra_query: Query | None = None,
|
|
358
|
+
extra_body: Body | None = None,
|
|
359
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
360
|
+
) -> AsyncPaginator[Broadcast, AsyncPageStreaming[Broadcast]]:
|
|
361
|
+
"""
|
|
362
|
+
Note: Feature "Broadcast" is outdated, soon it will be replaced by
|
|
363
|
+
"Multicamera".
|
|
364
|
+
|
|
365
|
+
Returns a list of broadcasts. Please see description in POST method.
|
|
366
|
+
|
|
367
|
+
Args:
|
|
368
|
+
page: Query parameter. Use it to list the paginated content
|
|
369
|
+
|
|
370
|
+
extra_headers: Send extra headers
|
|
371
|
+
|
|
372
|
+
extra_query: Add additional query parameters to the request
|
|
373
|
+
|
|
374
|
+
extra_body: Add additional JSON properties to the request
|
|
375
|
+
|
|
376
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
377
|
+
"""
|
|
378
|
+
return self._get_api_list(
|
|
379
|
+
"/streaming/broadcasts",
|
|
380
|
+
page=AsyncPageStreaming[Broadcast],
|
|
381
|
+
options=make_request_options(
|
|
382
|
+
extra_headers=extra_headers,
|
|
383
|
+
extra_query=extra_query,
|
|
384
|
+
extra_body=extra_body,
|
|
385
|
+
timeout=timeout,
|
|
386
|
+
query=maybe_transform({"page": page}, broadcast_list_params.BroadcastListParams),
|
|
387
|
+
),
|
|
388
|
+
model=Broadcast,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
async def delete(
|
|
392
|
+
self,
|
|
393
|
+
broadcast_id: int,
|
|
394
|
+
*,
|
|
395
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
396
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
397
|
+
extra_headers: Headers | None = None,
|
|
398
|
+
extra_query: Query | None = None,
|
|
399
|
+
extra_body: Body | None = None,
|
|
400
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
401
|
+
) -> None:
|
|
402
|
+
"""
|
|
403
|
+
Delete broadcast
|
|
404
|
+
|
|
405
|
+
Args:
|
|
406
|
+
extra_headers: Send extra headers
|
|
407
|
+
|
|
408
|
+
extra_query: Add additional query parameters to the request
|
|
409
|
+
|
|
410
|
+
extra_body: Add additional JSON properties to the request
|
|
411
|
+
|
|
412
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
413
|
+
"""
|
|
414
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
415
|
+
return await self._delete(
|
|
416
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
417
|
+
options=make_request_options(
|
|
418
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
419
|
+
),
|
|
420
|
+
cast_to=NoneType,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
async def get(
|
|
424
|
+
self,
|
|
425
|
+
broadcast_id: int,
|
|
426
|
+
*,
|
|
427
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
428
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
429
|
+
extra_headers: Headers | None = None,
|
|
430
|
+
extra_query: Query | None = None,
|
|
431
|
+
extra_body: Body | None = None,
|
|
432
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
433
|
+
) -> Broadcast:
|
|
434
|
+
"""
|
|
435
|
+
Returns broadcast details
|
|
436
|
+
|
|
437
|
+
Args:
|
|
438
|
+
extra_headers: Send extra headers
|
|
439
|
+
|
|
440
|
+
extra_query: Add additional query parameters to the request
|
|
441
|
+
|
|
442
|
+
extra_body: Add additional JSON properties to the request
|
|
443
|
+
|
|
444
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
445
|
+
"""
|
|
446
|
+
return await self._get(
|
|
447
|
+
f"/streaming/broadcasts/{broadcast_id}",
|
|
448
|
+
options=make_request_options(
|
|
449
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
450
|
+
),
|
|
451
|
+
cast_to=Broadcast,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
async def get_spectators_count(
|
|
455
|
+
self,
|
|
456
|
+
broadcast_id: int,
|
|
457
|
+
*,
|
|
458
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
459
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
460
|
+
extra_headers: Headers | None = None,
|
|
461
|
+
extra_query: Query | None = None,
|
|
462
|
+
extra_body: Body | None = None,
|
|
463
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
464
|
+
) -> BroadcastSpectatorsCount:
|
|
465
|
+
"""
|
|
466
|
+
Returns number of simultaneous broadcast viewers at the current moment
|
|
467
|
+
|
|
468
|
+
Args:
|
|
469
|
+
extra_headers: Send extra headers
|
|
470
|
+
|
|
471
|
+
extra_query: Add additional query parameters to the request
|
|
472
|
+
|
|
473
|
+
extra_body: Add additional JSON properties to the request
|
|
474
|
+
|
|
475
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
476
|
+
"""
|
|
477
|
+
return await self._get(
|
|
478
|
+
f"/streaming/broadcasts/{broadcast_id}/spectators",
|
|
479
|
+
options=make_request_options(
|
|
480
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
481
|
+
),
|
|
482
|
+
cast_to=BroadcastSpectatorsCount,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
class BroadcastsResourceWithRawResponse:
|
|
487
|
+
def __init__(self, broadcasts: BroadcastsResource) -> None:
|
|
488
|
+
self._broadcasts = broadcasts
|
|
489
|
+
|
|
490
|
+
self.create = to_raw_response_wrapper(
|
|
491
|
+
broadcasts.create,
|
|
492
|
+
)
|
|
493
|
+
self.update = to_raw_response_wrapper(
|
|
494
|
+
broadcasts.update,
|
|
495
|
+
)
|
|
496
|
+
self.list = to_raw_response_wrapper(
|
|
497
|
+
broadcasts.list,
|
|
498
|
+
)
|
|
499
|
+
self.delete = to_raw_response_wrapper(
|
|
500
|
+
broadcasts.delete,
|
|
501
|
+
)
|
|
502
|
+
self.get = to_raw_response_wrapper(
|
|
503
|
+
broadcasts.get,
|
|
504
|
+
)
|
|
505
|
+
self.get_spectators_count = to_raw_response_wrapper(
|
|
506
|
+
broadcasts.get_spectators_count,
|
|
507
|
+
)
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
class AsyncBroadcastsResourceWithRawResponse:
|
|
511
|
+
def __init__(self, broadcasts: AsyncBroadcastsResource) -> None:
|
|
512
|
+
self._broadcasts = broadcasts
|
|
513
|
+
|
|
514
|
+
self.create = async_to_raw_response_wrapper(
|
|
515
|
+
broadcasts.create,
|
|
516
|
+
)
|
|
517
|
+
self.update = async_to_raw_response_wrapper(
|
|
518
|
+
broadcasts.update,
|
|
519
|
+
)
|
|
520
|
+
self.list = async_to_raw_response_wrapper(
|
|
521
|
+
broadcasts.list,
|
|
522
|
+
)
|
|
523
|
+
self.delete = async_to_raw_response_wrapper(
|
|
524
|
+
broadcasts.delete,
|
|
525
|
+
)
|
|
526
|
+
self.get = async_to_raw_response_wrapper(
|
|
527
|
+
broadcasts.get,
|
|
528
|
+
)
|
|
529
|
+
self.get_spectators_count = async_to_raw_response_wrapper(
|
|
530
|
+
broadcasts.get_spectators_count,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
class BroadcastsResourceWithStreamingResponse:
|
|
535
|
+
def __init__(self, broadcasts: BroadcastsResource) -> None:
|
|
536
|
+
self._broadcasts = broadcasts
|
|
537
|
+
|
|
538
|
+
self.create = to_streamed_response_wrapper(
|
|
539
|
+
broadcasts.create,
|
|
540
|
+
)
|
|
541
|
+
self.update = to_streamed_response_wrapper(
|
|
542
|
+
broadcasts.update,
|
|
543
|
+
)
|
|
544
|
+
self.list = to_streamed_response_wrapper(
|
|
545
|
+
broadcasts.list,
|
|
546
|
+
)
|
|
547
|
+
self.delete = to_streamed_response_wrapper(
|
|
548
|
+
broadcasts.delete,
|
|
549
|
+
)
|
|
550
|
+
self.get = to_streamed_response_wrapper(
|
|
551
|
+
broadcasts.get,
|
|
552
|
+
)
|
|
553
|
+
self.get_spectators_count = to_streamed_response_wrapper(
|
|
554
|
+
broadcasts.get_spectators_count,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
class AsyncBroadcastsResourceWithStreamingResponse:
|
|
559
|
+
def __init__(self, broadcasts: AsyncBroadcastsResource) -> None:
|
|
560
|
+
self._broadcasts = broadcasts
|
|
561
|
+
|
|
562
|
+
self.create = async_to_streamed_response_wrapper(
|
|
563
|
+
broadcasts.create,
|
|
564
|
+
)
|
|
565
|
+
self.update = async_to_streamed_response_wrapper(
|
|
566
|
+
broadcasts.update,
|
|
567
|
+
)
|
|
568
|
+
self.list = async_to_streamed_response_wrapper(
|
|
569
|
+
broadcasts.list,
|
|
570
|
+
)
|
|
571
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
572
|
+
broadcasts.delete,
|
|
573
|
+
)
|
|
574
|
+
self.get = async_to_streamed_response_wrapper(
|
|
575
|
+
broadcasts.get,
|
|
576
|
+
)
|
|
577
|
+
self.get_spectators_count = async_to_streamed_response_wrapper(
|
|
578
|
+
broadcasts.get_spectators_count,
|
|
579
|
+
)
|