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.
- gcore/_client.py +9 -0
- gcore/_models.py +24 -3
- gcore/_version.py +1 -1
- gcore/pagination.py +101 -1
- 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/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/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/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.7.0.dist-info}/METADATA +1 -1
- {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/RECORD +181 -33
- {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/WHEEL +0 -0
- {gcore-0.6.0.dist-info → gcore-0.7.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,515 @@
|
|
|
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 ..._base_client import make_request_options
|
|
18
|
+
from ...types.streaming import directory_create_params, directory_update_params
|
|
19
|
+
from ...types.streaming.directory_base import DirectoryBase
|
|
20
|
+
from ...types.streaming.directories_tree import DirectoriesTree
|
|
21
|
+
from ...types.streaming.directory_get_response import DirectoryGetResponse
|
|
22
|
+
|
|
23
|
+
__all__ = ["DirectoriesResource", "AsyncDirectoriesResource"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DirectoriesResource(SyncAPIResource):
|
|
27
|
+
@cached_property
|
|
28
|
+
def with_raw_response(self) -> DirectoriesResourceWithRawResponse:
|
|
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 DirectoriesResourceWithRawResponse(self)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_streaming_response(self) -> DirectoriesResourceWithStreamingResponse:
|
|
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 DirectoriesResourceWithStreamingResponse(self)
|
|
45
|
+
|
|
46
|
+
def create(
|
|
47
|
+
self,
|
|
48
|
+
*,
|
|
49
|
+
name: str,
|
|
50
|
+
parent_id: int | NotGiven = NOT_GIVEN,
|
|
51
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
52
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
53
|
+
extra_headers: Headers | None = None,
|
|
54
|
+
extra_query: Query | None = None,
|
|
55
|
+
extra_body: Body | None = None,
|
|
56
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
57
|
+
) -> DirectoryBase:
|
|
58
|
+
"""
|
|
59
|
+
Use this method to create a new directory entity.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
name: Title of the directory.
|
|
63
|
+
|
|
64
|
+
parent_id: ID of a parent directory. "null" if it's in the root.
|
|
65
|
+
|
|
66
|
+
extra_headers: Send extra headers
|
|
67
|
+
|
|
68
|
+
extra_query: Add additional query parameters to the request
|
|
69
|
+
|
|
70
|
+
extra_body: Add additional JSON properties to the request
|
|
71
|
+
|
|
72
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
73
|
+
"""
|
|
74
|
+
return self._post(
|
|
75
|
+
"/streaming/directories",
|
|
76
|
+
body=maybe_transform(
|
|
77
|
+
{
|
|
78
|
+
"name": name,
|
|
79
|
+
"parent_id": parent_id,
|
|
80
|
+
},
|
|
81
|
+
directory_create_params.DirectoryCreateParams,
|
|
82
|
+
),
|
|
83
|
+
options=make_request_options(
|
|
84
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
85
|
+
),
|
|
86
|
+
cast_to=DirectoryBase,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def update(
|
|
90
|
+
self,
|
|
91
|
+
directory_id: int,
|
|
92
|
+
*,
|
|
93
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
94
|
+
parent_id: int | NotGiven = NOT_GIVEN,
|
|
95
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
96
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
97
|
+
extra_headers: Headers | None = None,
|
|
98
|
+
extra_query: Query | None = None,
|
|
99
|
+
extra_body: Body | None = None,
|
|
100
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
101
|
+
) -> DirectoryBase:
|
|
102
|
+
"""
|
|
103
|
+
Change a directory name or move to another "`parent_id`".
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
name: Title of the directory. Omit this if you don't want to change.
|
|
107
|
+
|
|
108
|
+
parent_id: ID of a parent directory. "null" if it's in the root. Omit this if you don't
|
|
109
|
+
want to change.
|
|
110
|
+
|
|
111
|
+
extra_headers: Send extra headers
|
|
112
|
+
|
|
113
|
+
extra_query: Add additional query parameters to the request
|
|
114
|
+
|
|
115
|
+
extra_body: Add additional JSON properties to the request
|
|
116
|
+
|
|
117
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
118
|
+
"""
|
|
119
|
+
return self._patch(
|
|
120
|
+
f"/streaming/directories/{directory_id}",
|
|
121
|
+
body=maybe_transform(
|
|
122
|
+
{
|
|
123
|
+
"name": name,
|
|
124
|
+
"parent_id": parent_id,
|
|
125
|
+
},
|
|
126
|
+
directory_update_params.DirectoryUpdateParams,
|
|
127
|
+
),
|
|
128
|
+
options=make_request_options(
|
|
129
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
130
|
+
),
|
|
131
|
+
cast_to=DirectoryBase,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
def delete(
|
|
135
|
+
self,
|
|
136
|
+
directory_id: int,
|
|
137
|
+
*,
|
|
138
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
139
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
140
|
+
extra_headers: Headers | None = None,
|
|
141
|
+
extra_query: Query | None = None,
|
|
142
|
+
extra_body: Body | None = None,
|
|
143
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
144
|
+
) -> None:
|
|
145
|
+
"""
|
|
146
|
+
Delete a directory **and all entities inside**.
|
|
147
|
+
|
|
148
|
+
After its execution, all contents of the directory will be deleted recursively:
|
|
149
|
+
|
|
150
|
+
- Subdirectories
|
|
151
|
+
- Videos The directory and contents are deleted permanently and irreversibly.
|
|
152
|
+
Therefore, it is impossible to restore files after this. For details, see the
|
|
153
|
+
Product Documentation.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
extra_headers: Send extra headers
|
|
157
|
+
|
|
158
|
+
extra_query: Add additional query parameters to the request
|
|
159
|
+
|
|
160
|
+
extra_body: Add additional JSON properties to the request
|
|
161
|
+
|
|
162
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
163
|
+
"""
|
|
164
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
165
|
+
return self._delete(
|
|
166
|
+
f"/streaming/directories/{directory_id}",
|
|
167
|
+
options=make_request_options(
|
|
168
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
169
|
+
),
|
|
170
|
+
cast_to=NoneType,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
def get(
|
|
174
|
+
self,
|
|
175
|
+
directory_id: int,
|
|
176
|
+
*,
|
|
177
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
178
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
179
|
+
extra_headers: Headers | None = None,
|
|
180
|
+
extra_query: Query | None = None,
|
|
181
|
+
extra_body: Body | None = None,
|
|
182
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
183
|
+
) -> DirectoryGetResponse:
|
|
184
|
+
"""Complete directory structure with contents.
|
|
185
|
+
|
|
186
|
+
The structure contains both
|
|
187
|
+
subfolders and videos in a continuous list.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
extra_headers: Send extra headers
|
|
191
|
+
|
|
192
|
+
extra_query: Add additional query parameters to the request
|
|
193
|
+
|
|
194
|
+
extra_body: Add additional JSON properties to the request
|
|
195
|
+
|
|
196
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
197
|
+
"""
|
|
198
|
+
return self._get(
|
|
199
|
+
f"/streaming/directories/{directory_id}",
|
|
200
|
+
options=make_request_options(
|
|
201
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
202
|
+
),
|
|
203
|
+
cast_to=DirectoryGetResponse,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
def get_tree(
|
|
207
|
+
self,
|
|
208
|
+
*,
|
|
209
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
210
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
211
|
+
extra_headers: Headers | None = None,
|
|
212
|
+
extra_query: Query | None = None,
|
|
213
|
+
extra_body: Body | None = None,
|
|
214
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
215
|
+
) -> DirectoriesTree:
|
|
216
|
+
"""Tree structure of directories.
|
|
217
|
+
|
|
218
|
+
This endpoint returns hierarchical data about
|
|
219
|
+
directories in video hosting.
|
|
220
|
+
"""
|
|
221
|
+
return self._get(
|
|
222
|
+
"/streaming/directories/tree",
|
|
223
|
+
options=make_request_options(
|
|
224
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
225
|
+
),
|
|
226
|
+
cast_to=DirectoriesTree,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class AsyncDirectoriesResource(AsyncAPIResource):
|
|
231
|
+
@cached_property
|
|
232
|
+
def with_raw_response(self) -> AsyncDirectoriesResourceWithRawResponse:
|
|
233
|
+
"""
|
|
234
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
235
|
+
the raw response object instead of the parsed content.
|
|
236
|
+
|
|
237
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
238
|
+
"""
|
|
239
|
+
return AsyncDirectoriesResourceWithRawResponse(self)
|
|
240
|
+
|
|
241
|
+
@cached_property
|
|
242
|
+
def with_streaming_response(self) -> AsyncDirectoriesResourceWithStreamingResponse:
|
|
243
|
+
"""
|
|
244
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
245
|
+
|
|
246
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
247
|
+
"""
|
|
248
|
+
return AsyncDirectoriesResourceWithStreamingResponse(self)
|
|
249
|
+
|
|
250
|
+
async def create(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
name: str,
|
|
254
|
+
parent_id: int | NotGiven = NOT_GIVEN,
|
|
255
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
256
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
257
|
+
extra_headers: Headers | None = None,
|
|
258
|
+
extra_query: Query | None = None,
|
|
259
|
+
extra_body: Body | None = None,
|
|
260
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
261
|
+
) -> DirectoryBase:
|
|
262
|
+
"""
|
|
263
|
+
Use this method to create a new directory entity.
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
name: Title of the directory.
|
|
267
|
+
|
|
268
|
+
parent_id: ID of a parent directory. "null" if it's in the root.
|
|
269
|
+
|
|
270
|
+
extra_headers: Send extra headers
|
|
271
|
+
|
|
272
|
+
extra_query: Add additional query parameters to the request
|
|
273
|
+
|
|
274
|
+
extra_body: Add additional JSON properties to the request
|
|
275
|
+
|
|
276
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
277
|
+
"""
|
|
278
|
+
return await self._post(
|
|
279
|
+
"/streaming/directories",
|
|
280
|
+
body=await async_maybe_transform(
|
|
281
|
+
{
|
|
282
|
+
"name": name,
|
|
283
|
+
"parent_id": parent_id,
|
|
284
|
+
},
|
|
285
|
+
directory_create_params.DirectoryCreateParams,
|
|
286
|
+
),
|
|
287
|
+
options=make_request_options(
|
|
288
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
289
|
+
),
|
|
290
|
+
cast_to=DirectoryBase,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
async def update(
|
|
294
|
+
self,
|
|
295
|
+
directory_id: int,
|
|
296
|
+
*,
|
|
297
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
298
|
+
parent_id: int | NotGiven = NOT_GIVEN,
|
|
299
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
300
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
301
|
+
extra_headers: Headers | None = None,
|
|
302
|
+
extra_query: Query | None = None,
|
|
303
|
+
extra_body: Body | None = None,
|
|
304
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
305
|
+
) -> DirectoryBase:
|
|
306
|
+
"""
|
|
307
|
+
Change a directory name or move to another "`parent_id`".
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
name: Title of the directory. Omit this if you don't want to change.
|
|
311
|
+
|
|
312
|
+
parent_id: ID of a parent directory. "null" if it's in the root. Omit this if you don't
|
|
313
|
+
want to change.
|
|
314
|
+
|
|
315
|
+
extra_headers: Send extra headers
|
|
316
|
+
|
|
317
|
+
extra_query: Add additional query parameters to the request
|
|
318
|
+
|
|
319
|
+
extra_body: Add additional JSON properties to the request
|
|
320
|
+
|
|
321
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
322
|
+
"""
|
|
323
|
+
return await self._patch(
|
|
324
|
+
f"/streaming/directories/{directory_id}",
|
|
325
|
+
body=await async_maybe_transform(
|
|
326
|
+
{
|
|
327
|
+
"name": name,
|
|
328
|
+
"parent_id": parent_id,
|
|
329
|
+
},
|
|
330
|
+
directory_update_params.DirectoryUpdateParams,
|
|
331
|
+
),
|
|
332
|
+
options=make_request_options(
|
|
333
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
334
|
+
),
|
|
335
|
+
cast_to=DirectoryBase,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
async def delete(
|
|
339
|
+
self,
|
|
340
|
+
directory_id: int,
|
|
341
|
+
*,
|
|
342
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
343
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
344
|
+
extra_headers: Headers | None = None,
|
|
345
|
+
extra_query: Query | None = None,
|
|
346
|
+
extra_body: Body | None = None,
|
|
347
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
348
|
+
) -> None:
|
|
349
|
+
"""
|
|
350
|
+
Delete a directory **and all entities inside**.
|
|
351
|
+
|
|
352
|
+
After its execution, all contents of the directory will be deleted recursively:
|
|
353
|
+
|
|
354
|
+
- Subdirectories
|
|
355
|
+
- Videos The directory and contents are deleted permanently and irreversibly.
|
|
356
|
+
Therefore, it is impossible to restore files after this. For details, see the
|
|
357
|
+
Product Documentation.
|
|
358
|
+
|
|
359
|
+
Args:
|
|
360
|
+
extra_headers: Send extra headers
|
|
361
|
+
|
|
362
|
+
extra_query: Add additional query parameters to the request
|
|
363
|
+
|
|
364
|
+
extra_body: Add additional JSON properties to the request
|
|
365
|
+
|
|
366
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
367
|
+
"""
|
|
368
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
369
|
+
return await self._delete(
|
|
370
|
+
f"/streaming/directories/{directory_id}",
|
|
371
|
+
options=make_request_options(
|
|
372
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
373
|
+
),
|
|
374
|
+
cast_to=NoneType,
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
async def get(
|
|
378
|
+
self,
|
|
379
|
+
directory_id: int,
|
|
380
|
+
*,
|
|
381
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
382
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
383
|
+
extra_headers: Headers | None = None,
|
|
384
|
+
extra_query: Query | None = None,
|
|
385
|
+
extra_body: Body | None = None,
|
|
386
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
387
|
+
) -> DirectoryGetResponse:
|
|
388
|
+
"""Complete directory structure with contents.
|
|
389
|
+
|
|
390
|
+
The structure contains both
|
|
391
|
+
subfolders and videos in a continuous list.
|
|
392
|
+
|
|
393
|
+
Args:
|
|
394
|
+
extra_headers: Send extra headers
|
|
395
|
+
|
|
396
|
+
extra_query: Add additional query parameters to the request
|
|
397
|
+
|
|
398
|
+
extra_body: Add additional JSON properties to the request
|
|
399
|
+
|
|
400
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
401
|
+
"""
|
|
402
|
+
return await self._get(
|
|
403
|
+
f"/streaming/directories/{directory_id}",
|
|
404
|
+
options=make_request_options(
|
|
405
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
406
|
+
),
|
|
407
|
+
cast_to=DirectoryGetResponse,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
async def get_tree(
|
|
411
|
+
self,
|
|
412
|
+
*,
|
|
413
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
414
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
415
|
+
extra_headers: Headers | None = None,
|
|
416
|
+
extra_query: Query | None = None,
|
|
417
|
+
extra_body: Body | None = None,
|
|
418
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
419
|
+
) -> DirectoriesTree:
|
|
420
|
+
"""Tree structure of directories.
|
|
421
|
+
|
|
422
|
+
This endpoint returns hierarchical data about
|
|
423
|
+
directories in video hosting.
|
|
424
|
+
"""
|
|
425
|
+
return await self._get(
|
|
426
|
+
"/streaming/directories/tree",
|
|
427
|
+
options=make_request_options(
|
|
428
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
429
|
+
),
|
|
430
|
+
cast_to=DirectoriesTree,
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
class DirectoriesResourceWithRawResponse:
|
|
435
|
+
def __init__(self, directories: DirectoriesResource) -> None:
|
|
436
|
+
self._directories = directories
|
|
437
|
+
|
|
438
|
+
self.create = to_raw_response_wrapper(
|
|
439
|
+
directories.create,
|
|
440
|
+
)
|
|
441
|
+
self.update = to_raw_response_wrapper(
|
|
442
|
+
directories.update,
|
|
443
|
+
)
|
|
444
|
+
self.delete = to_raw_response_wrapper(
|
|
445
|
+
directories.delete,
|
|
446
|
+
)
|
|
447
|
+
self.get = to_raw_response_wrapper(
|
|
448
|
+
directories.get,
|
|
449
|
+
)
|
|
450
|
+
self.get_tree = to_raw_response_wrapper(
|
|
451
|
+
directories.get_tree,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
class AsyncDirectoriesResourceWithRawResponse:
|
|
456
|
+
def __init__(self, directories: AsyncDirectoriesResource) -> None:
|
|
457
|
+
self._directories = directories
|
|
458
|
+
|
|
459
|
+
self.create = async_to_raw_response_wrapper(
|
|
460
|
+
directories.create,
|
|
461
|
+
)
|
|
462
|
+
self.update = async_to_raw_response_wrapper(
|
|
463
|
+
directories.update,
|
|
464
|
+
)
|
|
465
|
+
self.delete = async_to_raw_response_wrapper(
|
|
466
|
+
directories.delete,
|
|
467
|
+
)
|
|
468
|
+
self.get = async_to_raw_response_wrapper(
|
|
469
|
+
directories.get,
|
|
470
|
+
)
|
|
471
|
+
self.get_tree = async_to_raw_response_wrapper(
|
|
472
|
+
directories.get_tree,
|
|
473
|
+
)
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
class DirectoriesResourceWithStreamingResponse:
|
|
477
|
+
def __init__(self, directories: DirectoriesResource) -> None:
|
|
478
|
+
self._directories = directories
|
|
479
|
+
|
|
480
|
+
self.create = to_streamed_response_wrapper(
|
|
481
|
+
directories.create,
|
|
482
|
+
)
|
|
483
|
+
self.update = to_streamed_response_wrapper(
|
|
484
|
+
directories.update,
|
|
485
|
+
)
|
|
486
|
+
self.delete = to_streamed_response_wrapper(
|
|
487
|
+
directories.delete,
|
|
488
|
+
)
|
|
489
|
+
self.get = to_streamed_response_wrapper(
|
|
490
|
+
directories.get,
|
|
491
|
+
)
|
|
492
|
+
self.get_tree = to_streamed_response_wrapper(
|
|
493
|
+
directories.get_tree,
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class AsyncDirectoriesResourceWithStreamingResponse:
|
|
498
|
+
def __init__(self, directories: AsyncDirectoriesResource) -> None:
|
|
499
|
+
self._directories = directories
|
|
500
|
+
|
|
501
|
+
self.create = async_to_streamed_response_wrapper(
|
|
502
|
+
directories.create,
|
|
503
|
+
)
|
|
504
|
+
self.update = async_to_streamed_response_wrapper(
|
|
505
|
+
directories.update,
|
|
506
|
+
)
|
|
507
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
508
|
+
directories.delete,
|
|
509
|
+
)
|
|
510
|
+
self.get = async_to_streamed_response_wrapper(
|
|
511
|
+
directories.get,
|
|
512
|
+
)
|
|
513
|
+
self.get_tree = async_to_streamed_response_wrapper(
|
|
514
|
+
directories.get_tree,
|
|
515
|
+
)
|