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,337 @@
|
|
|
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 List, Union, Iterable, Optional
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
12
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
13
|
+
from ..._compat import cached_property
|
|
14
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from ..._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from ...types.cloud import usage_report_get_params
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.cloud.usage_report import UsageReport
|
|
24
|
+
|
|
25
|
+
__all__ = ["UsageReportsResource", "AsyncUsageReportsResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class UsageReportsResource(SyncAPIResource):
|
|
29
|
+
@cached_property
|
|
30
|
+
def with_raw_response(self) -> UsageReportsResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
37
|
+
return UsageReportsResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> UsageReportsResourceWithStreamingResponse:
|
|
41
|
+
"""
|
|
42
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
|
+
|
|
44
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
45
|
+
"""
|
|
46
|
+
return UsageReportsResourceWithStreamingResponse(self)
|
|
47
|
+
|
|
48
|
+
def get(
|
|
49
|
+
self,
|
|
50
|
+
*,
|
|
51
|
+
time_from: Union[str, datetime],
|
|
52
|
+
time_to: Union[str, datetime],
|
|
53
|
+
enable_last_day: bool | NotGiven = NOT_GIVEN,
|
|
54
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
55
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
56
|
+
projects: Optional[Iterable[int]] | NotGiven = NOT_GIVEN,
|
|
57
|
+
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
58
|
+
schema_filter: usage_report_get_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
59
|
+
sorting: Iterable[usage_report_get_params.Sorting] | NotGiven = NOT_GIVEN,
|
|
60
|
+
tags: usage_report_get_params.Tags | NotGiven = NOT_GIVEN,
|
|
61
|
+
types: List[
|
|
62
|
+
Literal[
|
|
63
|
+
"ai_cluster",
|
|
64
|
+
"ai_virtual_cluster",
|
|
65
|
+
"backup",
|
|
66
|
+
"baremetal",
|
|
67
|
+
"basic_vm",
|
|
68
|
+
"containers",
|
|
69
|
+
"dbaas_postgresql_connection_pooler",
|
|
70
|
+
"dbaas_postgresql_cpu",
|
|
71
|
+
"dbaas_postgresql_memory",
|
|
72
|
+
"dbaas_postgresql_public_network",
|
|
73
|
+
"dbaas_postgresql_volume",
|
|
74
|
+
"egress_traffic",
|
|
75
|
+
"external_ip",
|
|
76
|
+
"file_share",
|
|
77
|
+
"floatingip",
|
|
78
|
+
"functions",
|
|
79
|
+
"functions_calls",
|
|
80
|
+
"functions_traffic",
|
|
81
|
+
"image",
|
|
82
|
+
"inference",
|
|
83
|
+
"instance",
|
|
84
|
+
"load_balancer",
|
|
85
|
+
"log_index",
|
|
86
|
+
"snapshot",
|
|
87
|
+
"volume",
|
|
88
|
+
]
|
|
89
|
+
]
|
|
90
|
+
| NotGiven = NOT_GIVEN,
|
|
91
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
92
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
93
|
+
extra_headers: Headers | None = None,
|
|
94
|
+
extra_query: Query | None = None,
|
|
95
|
+
extra_body: Body | None = None,
|
|
96
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
97
|
+
) -> UsageReport:
|
|
98
|
+
"""Receiving data from the past hour might lead to incomplete statistics.
|
|
99
|
+
|
|
100
|
+
For the
|
|
101
|
+
most accurate data, we recommend accessing the statistics after at least one
|
|
102
|
+
hour. Typically, updates are available within a 24-hour period, although the
|
|
103
|
+
frequency can vary. Maintenance periods or other exceptions may cause delays,
|
|
104
|
+
potentially extending beyond 24 hours until the servers are back online and the
|
|
105
|
+
missing data is filled in.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
time_from: The start date of the report period (ISO 8601). The report starts from the
|
|
109
|
+
beginning of this day.
|
|
110
|
+
|
|
111
|
+
time_to: The end date of the report period (ISO 8601). The report ends just before the
|
|
112
|
+
beginning of this day.
|
|
113
|
+
|
|
114
|
+
enable_last_day: Expenses for the last specified day are taken into account. As the default,
|
|
115
|
+
False.
|
|
116
|
+
|
|
117
|
+
limit: The response resources limit. Defaults to 10.
|
|
118
|
+
|
|
119
|
+
offset: The response resources offset.
|
|
120
|
+
|
|
121
|
+
projects: List of project IDs
|
|
122
|
+
|
|
123
|
+
regions: List of region IDs.
|
|
124
|
+
|
|
125
|
+
schema_filter: Extended filter for field filtering.
|
|
126
|
+
|
|
127
|
+
sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
|
|
128
|
+
|
|
129
|
+
tags: Filter by tags
|
|
130
|
+
|
|
131
|
+
types: List of resource types to be filtered in the report.
|
|
132
|
+
|
|
133
|
+
extra_headers: Send extra headers
|
|
134
|
+
|
|
135
|
+
extra_query: Add additional query parameters to the request
|
|
136
|
+
|
|
137
|
+
extra_body: Add additional JSON properties to the request
|
|
138
|
+
|
|
139
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
140
|
+
"""
|
|
141
|
+
return self._post(
|
|
142
|
+
"/cloud/v1/usage_report",
|
|
143
|
+
body=maybe_transform(
|
|
144
|
+
{
|
|
145
|
+
"time_from": time_from,
|
|
146
|
+
"time_to": time_to,
|
|
147
|
+
"enable_last_day": enable_last_day,
|
|
148
|
+
"limit": limit,
|
|
149
|
+
"offset": offset,
|
|
150
|
+
"projects": projects,
|
|
151
|
+
"regions": regions,
|
|
152
|
+
"schema_filter": schema_filter,
|
|
153
|
+
"sorting": sorting,
|
|
154
|
+
"tags": tags,
|
|
155
|
+
"types": types,
|
|
156
|
+
},
|
|
157
|
+
usage_report_get_params.UsageReportGetParams,
|
|
158
|
+
),
|
|
159
|
+
options=make_request_options(
|
|
160
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
161
|
+
),
|
|
162
|
+
cast_to=UsageReport,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class AsyncUsageReportsResource(AsyncAPIResource):
|
|
167
|
+
@cached_property
|
|
168
|
+
def with_raw_response(self) -> AsyncUsageReportsResourceWithRawResponse:
|
|
169
|
+
"""
|
|
170
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
171
|
+
the raw response object instead of the parsed content.
|
|
172
|
+
|
|
173
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
174
|
+
"""
|
|
175
|
+
return AsyncUsageReportsResourceWithRawResponse(self)
|
|
176
|
+
|
|
177
|
+
@cached_property
|
|
178
|
+
def with_streaming_response(self) -> AsyncUsageReportsResourceWithStreamingResponse:
|
|
179
|
+
"""
|
|
180
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
181
|
+
|
|
182
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
183
|
+
"""
|
|
184
|
+
return AsyncUsageReportsResourceWithStreamingResponse(self)
|
|
185
|
+
|
|
186
|
+
async def get(
|
|
187
|
+
self,
|
|
188
|
+
*,
|
|
189
|
+
time_from: Union[str, datetime],
|
|
190
|
+
time_to: Union[str, datetime],
|
|
191
|
+
enable_last_day: bool | NotGiven = NOT_GIVEN,
|
|
192
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
193
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
194
|
+
projects: Optional[Iterable[int]] | NotGiven = NOT_GIVEN,
|
|
195
|
+
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
196
|
+
schema_filter: usage_report_get_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
197
|
+
sorting: Iterable[usage_report_get_params.Sorting] | NotGiven = NOT_GIVEN,
|
|
198
|
+
tags: usage_report_get_params.Tags | NotGiven = NOT_GIVEN,
|
|
199
|
+
types: List[
|
|
200
|
+
Literal[
|
|
201
|
+
"ai_cluster",
|
|
202
|
+
"ai_virtual_cluster",
|
|
203
|
+
"backup",
|
|
204
|
+
"baremetal",
|
|
205
|
+
"basic_vm",
|
|
206
|
+
"containers",
|
|
207
|
+
"dbaas_postgresql_connection_pooler",
|
|
208
|
+
"dbaas_postgresql_cpu",
|
|
209
|
+
"dbaas_postgresql_memory",
|
|
210
|
+
"dbaas_postgresql_public_network",
|
|
211
|
+
"dbaas_postgresql_volume",
|
|
212
|
+
"egress_traffic",
|
|
213
|
+
"external_ip",
|
|
214
|
+
"file_share",
|
|
215
|
+
"floatingip",
|
|
216
|
+
"functions",
|
|
217
|
+
"functions_calls",
|
|
218
|
+
"functions_traffic",
|
|
219
|
+
"image",
|
|
220
|
+
"inference",
|
|
221
|
+
"instance",
|
|
222
|
+
"load_balancer",
|
|
223
|
+
"log_index",
|
|
224
|
+
"snapshot",
|
|
225
|
+
"volume",
|
|
226
|
+
]
|
|
227
|
+
]
|
|
228
|
+
| NotGiven = NOT_GIVEN,
|
|
229
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
230
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
231
|
+
extra_headers: Headers | None = None,
|
|
232
|
+
extra_query: Query | None = None,
|
|
233
|
+
extra_body: Body | None = None,
|
|
234
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
235
|
+
) -> UsageReport:
|
|
236
|
+
"""Receiving data from the past hour might lead to incomplete statistics.
|
|
237
|
+
|
|
238
|
+
For the
|
|
239
|
+
most accurate data, we recommend accessing the statistics after at least one
|
|
240
|
+
hour. Typically, updates are available within a 24-hour period, although the
|
|
241
|
+
frequency can vary. Maintenance periods or other exceptions may cause delays,
|
|
242
|
+
potentially extending beyond 24 hours until the servers are back online and the
|
|
243
|
+
missing data is filled in.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
time_from: The start date of the report period (ISO 8601). The report starts from the
|
|
247
|
+
beginning of this day.
|
|
248
|
+
|
|
249
|
+
time_to: The end date of the report period (ISO 8601). The report ends just before the
|
|
250
|
+
beginning of this day.
|
|
251
|
+
|
|
252
|
+
enable_last_day: Expenses for the last specified day are taken into account. As the default,
|
|
253
|
+
False.
|
|
254
|
+
|
|
255
|
+
limit: The response resources limit. Defaults to 10.
|
|
256
|
+
|
|
257
|
+
offset: The response resources offset.
|
|
258
|
+
|
|
259
|
+
projects: List of project IDs
|
|
260
|
+
|
|
261
|
+
regions: List of region IDs.
|
|
262
|
+
|
|
263
|
+
schema_filter: Extended filter for field filtering.
|
|
264
|
+
|
|
265
|
+
sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
|
|
266
|
+
|
|
267
|
+
tags: Filter by tags
|
|
268
|
+
|
|
269
|
+
types: List of resource types to be filtered in the report.
|
|
270
|
+
|
|
271
|
+
extra_headers: Send extra headers
|
|
272
|
+
|
|
273
|
+
extra_query: Add additional query parameters to the request
|
|
274
|
+
|
|
275
|
+
extra_body: Add additional JSON properties to the request
|
|
276
|
+
|
|
277
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
278
|
+
"""
|
|
279
|
+
return await self._post(
|
|
280
|
+
"/cloud/v1/usage_report",
|
|
281
|
+
body=await async_maybe_transform(
|
|
282
|
+
{
|
|
283
|
+
"time_from": time_from,
|
|
284
|
+
"time_to": time_to,
|
|
285
|
+
"enable_last_day": enable_last_day,
|
|
286
|
+
"limit": limit,
|
|
287
|
+
"offset": offset,
|
|
288
|
+
"projects": projects,
|
|
289
|
+
"regions": regions,
|
|
290
|
+
"schema_filter": schema_filter,
|
|
291
|
+
"sorting": sorting,
|
|
292
|
+
"tags": tags,
|
|
293
|
+
"types": types,
|
|
294
|
+
},
|
|
295
|
+
usage_report_get_params.UsageReportGetParams,
|
|
296
|
+
),
|
|
297
|
+
options=make_request_options(
|
|
298
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
299
|
+
),
|
|
300
|
+
cast_to=UsageReport,
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class UsageReportsResourceWithRawResponse:
|
|
305
|
+
def __init__(self, usage_reports: UsageReportsResource) -> None:
|
|
306
|
+
self._usage_reports = usage_reports
|
|
307
|
+
|
|
308
|
+
self.get = to_raw_response_wrapper(
|
|
309
|
+
usage_reports.get,
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
class AsyncUsageReportsResourceWithRawResponse:
|
|
314
|
+
def __init__(self, usage_reports: AsyncUsageReportsResource) -> None:
|
|
315
|
+
self._usage_reports = usage_reports
|
|
316
|
+
|
|
317
|
+
self.get = async_to_raw_response_wrapper(
|
|
318
|
+
usage_reports.get,
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class UsageReportsResourceWithStreamingResponse:
|
|
323
|
+
def __init__(self, usage_reports: UsageReportsResource) -> None:
|
|
324
|
+
self._usage_reports = usage_reports
|
|
325
|
+
|
|
326
|
+
self.get = to_streamed_response_wrapper(
|
|
327
|
+
usage_reports.get,
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class AsyncUsageReportsResourceWithStreamingResponse:
|
|
332
|
+
def __init__(self, usage_reports: AsyncUsageReportsResource) -> None:
|
|
333
|
+
self._usage_reports = usage_reports
|
|
334
|
+
|
|
335
|
+
self.get = async_to_streamed_response_wrapper(
|
|
336
|
+
usage_reports.get,
|
|
337
|
+
)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .videos import (
|
|
4
|
+
VideosResource,
|
|
5
|
+
AsyncVideosResource,
|
|
6
|
+
VideosResourceWithRawResponse,
|
|
7
|
+
AsyncVideosResourceWithRawResponse,
|
|
8
|
+
VideosResourceWithStreamingResponse,
|
|
9
|
+
AsyncVideosResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .players import (
|
|
12
|
+
PlayersResource,
|
|
13
|
+
AsyncPlayersResource,
|
|
14
|
+
PlayersResourceWithRawResponse,
|
|
15
|
+
AsyncPlayersResourceWithRawResponse,
|
|
16
|
+
PlayersResourceWithStreamingResponse,
|
|
17
|
+
AsyncPlayersResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
from .streams import (
|
|
20
|
+
StreamsResource,
|
|
21
|
+
AsyncStreamsResource,
|
|
22
|
+
StreamsResourceWithRawResponse,
|
|
23
|
+
AsyncStreamsResourceWithRawResponse,
|
|
24
|
+
StreamsResourceWithStreamingResponse,
|
|
25
|
+
AsyncStreamsResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
27
|
+
from .ai_tasks import (
|
|
28
|
+
AITasksResource,
|
|
29
|
+
AsyncAITasksResource,
|
|
30
|
+
AITasksResourceWithRawResponse,
|
|
31
|
+
AsyncAITasksResourceWithRawResponse,
|
|
32
|
+
AITasksResourceWithStreamingResponse,
|
|
33
|
+
AsyncAITasksResourceWithStreamingResponse,
|
|
34
|
+
)
|
|
35
|
+
from .playlists import (
|
|
36
|
+
PlaylistsResource,
|
|
37
|
+
AsyncPlaylistsResource,
|
|
38
|
+
PlaylistsResourceWithRawResponse,
|
|
39
|
+
AsyncPlaylistsResourceWithRawResponse,
|
|
40
|
+
PlaylistsResourceWithStreamingResponse,
|
|
41
|
+
AsyncPlaylistsResourceWithStreamingResponse,
|
|
42
|
+
)
|
|
43
|
+
from .restreams import (
|
|
44
|
+
RestreamsResource,
|
|
45
|
+
AsyncRestreamsResource,
|
|
46
|
+
RestreamsResourceWithRawResponse,
|
|
47
|
+
AsyncRestreamsResourceWithRawResponse,
|
|
48
|
+
RestreamsResourceWithStreamingResponse,
|
|
49
|
+
AsyncRestreamsResourceWithStreamingResponse,
|
|
50
|
+
)
|
|
51
|
+
from .streaming import (
|
|
52
|
+
StreamingResource,
|
|
53
|
+
AsyncStreamingResource,
|
|
54
|
+
StreamingResourceWithRawResponse,
|
|
55
|
+
AsyncStreamingResourceWithRawResponse,
|
|
56
|
+
StreamingResourceWithStreamingResponse,
|
|
57
|
+
AsyncStreamingResourceWithStreamingResponse,
|
|
58
|
+
)
|
|
59
|
+
from .broadcasts import (
|
|
60
|
+
BroadcastsResource,
|
|
61
|
+
AsyncBroadcastsResource,
|
|
62
|
+
BroadcastsResourceWithRawResponse,
|
|
63
|
+
AsyncBroadcastsResourceWithRawResponse,
|
|
64
|
+
BroadcastsResourceWithStreamingResponse,
|
|
65
|
+
AsyncBroadcastsResourceWithStreamingResponse,
|
|
66
|
+
)
|
|
67
|
+
from .statistics import (
|
|
68
|
+
StatisticsResource,
|
|
69
|
+
AsyncStatisticsResource,
|
|
70
|
+
StatisticsResourceWithRawResponse,
|
|
71
|
+
AsyncStatisticsResourceWithRawResponse,
|
|
72
|
+
StatisticsResourceWithStreamingResponse,
|
|
73
|
+
AsyncStatisticsResourceWithStreamingResponse,
|
|
74
|
+
)
|
|
75
|
+
from .directories import (
|
|
76
|
+
DirectoriesResource,
|
|
77
|
+
AsyncDirectoriesResource,
|
|
78
|
+
DirectoriesResourceWithRawResponse,
|
|
79
|
+
AsyncDirectoriesResourceWithRawResponse,
|
|
80
|
+
DirectoriesResourceWithStreamingResponse,
|
|
81
|
+
AsyncDirectoriesResourceWithStreamingResponse,
|
|
82
|
+
)
|
|
83
|
+
from .quality_sets import (
|
|
84
|
+
QualitySetsResource,
|
|
85
|
+
AsyncQualitySetsResource,
|
|
86
|
+
QualitySetsResourceWithRawResponse,
|
|
87
|
+
AsyncQualitySetsResourceWithRawResponse,
|
|
88
|
+
QualitySetsResourceWithStreamingResponse,
|
|
89
|
+
AsyncQualitySetsResourceWithStreamingResponse,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
__all__ = [
|
|
93
|
+
"AITasksResource",
|
|
94
|
+
"AsyncAITasksResource",
|
|
95
|
+
"AITasksResourceWithRawResponse",
|
|
96
|
+
"AsyncAITasksResourceWithRawResponse",
|
|
97
|
+
"AITasksResourceWithStreamingResponse",
|
|
98
|
+
"AsyncAITasksResourceWithStreamingResponse",
|
|
99
|
+
"BroadcastsResource",
|
|
100
|
+
"AsyncBroadcastsResource",
|
|
101
|
+
"BroadcastsResourceWithRawResponse",
|
|
102
|
+
"AsyncBroadcastsResourceWithRawResponse",
|
|
103
|
+
"BroadcastsResourceWithStreamingResponse",
|
|
104
|
+
"AsyncBroadcastsResourceWithStreamingResponse",
|
|
105
|
+
"DirectoriesResource",
|
|
106
|
+
"AsyncDirectoriesResource",
|
|
107
|
+
"DirectoriesResourceWithRawResponse",
|
|
108
|
+
"AsyncDirectoriesResourceWithRawResponse",
|
|
109
|
+
"DirectoriesResourceWithStreamingResponse",
|
|
110
|
+
"AsyncDirectoriesResourceWithStreamingResponse",
|
|
111
|
+
"PlayersResource",
|
|
112
|
+
"AsyncPlayersResource",
|
|
113
|
+
"PlayersResourceWithRawResponse",
|
|
114
|
+
"AsyncPlayersResourceWithRawResponse",
|
|
115
|
+
"PlayersResourceWithStreamingResponse",
|
|
116
|
+
"AsyncPlayersResourceWithStreamingResponse",
|
|
117
|
+
"QualitySetsResource",
|
|
118
|
+
"AsyncQualitySetsResource",
|
|
119
|
+
"QualitySetsResourceWithRawResponse",
|
|
120
|
+
"AsyncQualitySetsResourceWithRawResponse",
|
|
121
|
+
"QualitySetsResourceWithStreamingResponse",
|
|
122
|
+
"AsyncQualitySetsResourceWithStreamingResponse",
|
|
123
|
+
"PlaylistsResource",
|
|
124
|
+
"AsyncPlaylistsResource",
|
|
125
|
+
"PlaylistsResourceWithRawResponse",
|
|
126
|
+
"AsyncPlaylistsResourceWithRawResponse",
|
|
127
|
+
"PlaylistsResourceWithStreamingResponse",
|
|
128
|
+
"AsyncPlaylistsResourceWithStreamingResponse",
|
|
129
|
+
"VideosResource",
|
|
130
|
+
"AsyncVideosResource",
|
|
131
|
+
"VideosResourceWithRawResponse",
|
|
132
|
+
"AsyncVideosResourceWithRawResponse",
|
|
133
|
+
"VideosResourceWithStreamingResponse",
|
|
134
|
+
"AsyncVideosResourceWithStreamingResponse",
|
|
135
|
+
"StreamsResource",
|
|
136
|
+
"AsyncStreamsResource",
|
|
137
|
+
"StreamsResourceWithRawResponse",
|
|
138
|
+
"AsyncStreamsResourceWithRawResponse",
|
|
139
|
+
"StreamsResourceWithStreamingResponse",
|
|
140
|
+
"AsyncStreamsResourceWithStreamingResponse",
|
|
141
|
+
"RestreamsResource",
|
|
142
|
+
"AsyncRestreamsResource",
|
|
143
|
+
"RestreamsResourceWithRawResponse",
|
|
144
|
+
"AsyncRestreamsResourceWithRawResponse",
|
|
145
|
+
"RestreamsResourceWithStreamingResponse",
|
|
146
|
+
"AsyncRestreamsResourceWithStreamingResponse",
|
|
147
|
+
"StatisticsResource",
|
|
148
|
+
"AsyncStatisticsResource",
|
|
149
|
+
"StatisticsResourceWithRawResponse",
|
|
150
|
+
"AsyncStatisticsResourceWithRawResponse",
|
|
151
|
+
"StatisticsResourceWithStreamingResponse",
|
|
152
|
+
"AsyncStatisticsResourceWithStreamingResponse",
|
|
153
|
+
"StreamingResource",
|
|
154
|
+
"AsyncStreamingResource",
|
|
155
|
+
"StreamingResourceWithRawResponse",
|
|
156
|
+
"AsyncStreamingResourceWithRawResponse",
|
|
157
|
+
"StreamingResourceWithStreamingResponse",
|
|
158
|
+
"AsyncStreamingResourceWithStreamingResponse",
|
|
159
|
+
]
|