chunkify-analytics-sdk 0.9.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.
- chunkify_analytics/__init__.py +102 -0
- chunkify_analytics/_base_client.py +2153 -0
- chunkify_analytics/_client.py +1262 -0
- chunkify_analytics/_compat.py +226 -0
- chunkify_analytics/_constants.py +14 -0
- chunkify_analytics/_exceptions.py +108 -0
- chunkify_analytics/_files.py +173 -0
- chunkify_analytics/_models.py +964 -0
- chunkify_analytics/_qs.py +149 -0
- chunkify_analytics/_resource.py +43 -0
- chunkify_analytics/_response.py +835 -0
- chunkify_analytics/_streaming.py +338 -0
- chunkify_analytics/_types.py +274 -0
- chunkify_analytics/_utils/__init__.py +64 -0
- chunkify_analytics/_utils/_compat.py +45 -0
- chunkify_analytics/_utils/_datetime_parse.py +136 -0
- chunkify_analytics/_utils/_json.py +35 -0
- chunkify_analytics/_utils/_logs.py +25 -0
- chunkify_analytics/_utils/_path.py +127 -0
- chunkify_analytics/_utils/_proxy.py +65 -0
- chunkify_analytics/_utils/_reflection.py +42 -0
- chunkify_analytics/_utils/_resources_proxy.py +24 -0
- chunkify_analytics/_utils/_streams.py +12 -0
- chunkify_analytics/_utils/_sync.py +58 -0
- chunkify_analytics/_utils/_transform.py +457 -0
- chunkify_analytics/_utils/_typing.py +156 -0
- chunkify_analytics/_utils/_utils.py +433 -0
- chunkify_analytics/_version.py +4 -0
- chunkify_analytics/lib/.keep +4 -0
- chunkify_analytics/pagination.py +221 -0
- chunkify_analytics/py.typed +0 -0
- chunkify_analytics/resources/__init__.py +243 -0
- chunkify_analytics/resources/admin/__init__.py +33 -0
- chunkify_analytics/resources/admin/admin.py +253 -0
- chunkify_analytics/resources/admin/keys.py +283 -0
- chunkify_analytics/resources/dimensions.py +436 -0
- chunkify_analytics/resources/engagement.py +479 -0
- chunkify_analytics/resources/errors.py +400 -0
- chunkify_analytics/resources/events.py +562 -0
- chunkify_analytics/resources/exports.py +584 -0
- chunkify_analytics/resources/health.py +159 -0
- chunkify_analytics/resources/playback_rates.py +391 -0
- chunkify_analytics/resources/project/__init__.py +33 -0
- chunkify_analytics/resources/project/keys.py +379 -0
- chunkify_analytics/resources/project/project.py +322 -0
- chunkify_analytics/resources/quality.py +471 -0
- chunkify_analytics/resources/renditions.py +391 -0
- chunkify_analytics/resources/retention.py +377 -0
- chunkify_analytics/resources/subtitles.py +389 -0
- chunkify_analytics/resources/summary.py +469 -0
- chunkify_analytics/resources/timeseries.py +399 -0
- chunkify_analytics/resources/videos.py +424 -0
- chunkify_analytics/resources/views.py +579 -0
- chunkify_analytics/types/__init__.py +145 -0
- chunkify_analytics/types/admin/__init__.py +3 -0
- chunkify_analytics/types/admin_create_project_params.py +25 -0
- chunkify_analytics/types/analytics_event.py +32 -0
- chunkify_analytics/types/analytics_event_param.py +30 -0
- chunkify_analytics/types/created_project.py +37 -0
- chunkify_analytics/types/created_project_key.py +34 -0
- chunkify_analytics/types/deleted_project.py +18 -0
- chunkify_analytics/types/dimension_list_values_params.py +124 -0
- chunkify_analytics/types/dimension_values.py +42 -0
- chunkify_analytics/types/engagement.py +60 -0
- chunkify_analytics/types/engagement_breakdown_page.py +44 -0
- chunkify_analytics/types/engagement_response.py +11 -0
- chunkify_analytics/types/engagement_retrieve_params.py +158 -0
- chunkify_analytics/types/engagement_timeseries.py +28 -0
- chunkify_analytics/types/engagement_timeseries_bucket.py +63 -0
- chunkify_analytics/types/error_group.py +17 -0
- chunkify_analytics/types/error_list_params.py +124 -0
- chunkify_analytics/types/error_page.py +14 -0
- chunkify_analytics/types/event_ingest_params.py +19 -0
- chunkify_analytics/types/event_ingest_response.py +11 -0
- chunkify_analytics/types/event_list_params.py +146 -0
- chunkify_analytics/types/event_page.py +18 -0
- chunkify_analytics/types/export.py +18 -0
- chunkify_analytics/types/export_columns.py +12 -0
- chunkify_analytics/types/export_create_params.py +40 -0
- chunkify_analytics/types/export_download_response.py +7 -0
- chunkify_analytics/types/export_list_columns_params.py +69 -0
- chunkify_analytics/types/export_query_param.py +141 -0
- chunkify_analytics/types/health.py +11 -0
- chunkify_analytics/types/metrics.py +13 -0
- chunkify_analytics/types/metrics_breakdown_page.py +40 -0
- chunkify_analytics/types/metrics_response.py +11 -0
- chunkify_analytics/types/native_created.py +13 -0
- chunkify_analytics/types/native_duplicate.py +13 -0
- chunkify_analytics/types/playback_error.py +180 -0
- chunkify_analytics/types/playback_error_param.py +182 -0
- chunkify_analytics/types/playback_rate_changed.py +150 -0
- chunkify_analytics/types/playback_rate_changed_param.py +152 -0
- chunkify_analytics/types/playback_rate_metric.py +21 -0
- chunkify_analytics/types/playback_rate_report.py +31 -0
- chunkify_analytics/types/playback_rate_retrieve_params.py +117 -0
- chunkify_analytics/types/playback_state_changed.py +150 -0
- chunkify_analytics/types/playback_state_changed_param.py +156 -0
- chunkify_analytics/types/project/__init__.py +6 -0
- chunkify_analytics/types/project/key_create_params.py +21 -0
- chunkify_analytics/types/project/project.py +35 -0
- chunkify_analytics/types/project_key.py +21 -0
- chunkify_analytics/types/project_keys.py +14 -0
- chunkify_analytics/types/project_update_params.py +25 -0
- chunkify_analytics/types/quality.py +117 -0
- chunkify_analytics/types/quality_breakdown_page.py +44 -0
- chunkify_analytics/types/quality_response.py +11 -0
- chunkify_analytics/types/quality_retrieve_params.py +158 -0
- chunkify_analytics/types/quality_timeseries.py +28 -0
- chunkify_analytics/types/quality_timeseries_bucket.py +120 -0
- chunkify_analytics/types/rendition_changed.py +156 -0
- chunkify_analytics/types/rendition_changed_param.py +158 -0
- chunkify_analytics/types/rendition_metric.py +40 -0
- chunkify_analytics/types/rendition_report.py +43 -0
- chunkify_analytics/types/rendition_retrieve_params.py +117 -0
- chunkify_analytics/types/retention_bucket.py +22 -0
- chunkify_analytics/types/retention_report.py +33 -0
- chunkify_analytics/types/retention_retrieve_params.py +110 -0
- chunkify_analytics/types/rotated_project_key.py +29 -0
- chunkify_analytics/types/seek_completed.py +166 -0
- chunkify_analytics/types/seek_completed_param.py +168 -0
- chunkify_analytics/types/shared/__init__.py +24 -0
- chunkify_analytics/types/shared/browser_context.py +62 -0
- chunkify_analytics/types/shared/custom_dimensions.py +8 -0
- chunkify_analytics/types/shared/event_context.py +161 -0
- chunkify_analytics/types/shared/event_envelope.py +152 -0
- chunkify_analytics/types/shared/metric_count_ratio.py +18 -0
- chunkify_analytics/types/shared/otlp_any_value.py +56 -0
- chunkify_analytics/types/shared/otlp_attribute.py +24 -0
- chunkify_analytics/types/shared/otlp_attribute_value.py +136 -0
- chunkify_analytics/types/shared/otlp_context_attribute.py +22 -0
- chunkify_analytics/types/shared/otlp_log_record.py +48 -0
- chunkify_analytics/types/shared/otlp_resource.py +20 -0
- chunkify_analytics/types/shared/otlp_scope.py +24 -0
- chunkify_analytics/types/shared/playback_rate_playing_time.py +12 -0
- chunkify_analytics/types/shared/playback_score.py +28 -0
- chunkify_analytics/types/shared/played_range.py +13 -0
- chunkify_analytics/types/shared/progress_reached.py +39 -0
- chunkify_analytics/types/shared/rendition_playing_time.py +21 -0
- chunkify_analytics/types/shared/startup_outcomes.py +39 -0
- chunkify_analytics/types/shared/stored_otlp_context.py +50 -0
- chunkify_analytics/types/shared/subtitle_playing_time.py +14 -0
- chunkify_analytics/types/shared/view_metrics.py +100 -0
- chunkify_analytics/types/shared/watch_time_distribution.py +41 -0
- chunkify_analytics/types/shared_params/__init__.py +8 -0
- chunkify_analytics/types/shared_params/browser_context.py +62 -0
- chunkify_analytics/types/shared_params/custom_dimensions.py +10 -0
- chunkify_analytics/types/shared_params/playback_rate_playing_time.py +14 -0
- chunkify_analytics/types/shared_params/played_range.py +15 -0
- chunkify_analytics/types/shared_params/rendition_playing_time.py +22 -0
- chunkify_analytics/types/shared_params/subtitle_playing_time.py +15 -0
- chunkify_analytics/types/stored_event.py +44 -0
- chunkify_analytics/types/subtitle_changed.py +150 -0
- chunkify_analytics/types/subtitle_changed_param.py +152 -0
- chunkify_analytics/types/subtitle_metric.py +26 -0
- chunkify_analytics/types/subtitle_report.py +31 -0
- chunkify_analytics/types/subtitle_retrieve_params.py +117 -0
- chunkify_analytics/types/summary_retrieve_params.py +158 -0
- chunkify_analytics/types/time_bucket.py +22 -0
- chunkify_analytics/types/timeseries.py +28 -0
- chunkify_analytics/types/timeseries_response.py +12 -0
- chunkify_analytics/types/timesery_retrieve_params.py +115 -0
- chunkify_analytics/types/video_list_params.py +140 -0
- chunkify_analytics/types/video_metrics.py +23 -0
- chunkify_analytics/types/video_page.py +14 -0
- chunkify_analytics/types/view.py +43 -0
- chunkify_analytics/types/view_detail.py +21 -0
- chunkify_analytics/types/view_ended.py +180 -0
- chunkify_analytics/types/view_ended_param.py +182 -0
- chunkify_analytics/types/view_list_params.py +152 -0
- chunkify_analytics/types/view_page.py +14 -0
- chunkify_analytics/types/view_retrieve_params.py +23 -0
- chunkify_analytics/types/view_snapshot.py +180 -0
- chunkify_analytics/types/view_snapshot_param.py +182 -0
- chunkify_analytics/types/view_started.py +192 -0
- chunkify_analytics/types/view_started_param.py +194 -0
- chunkify_analytics_sdk-0.9.0.dist-info/METADATA +487 -0
- chunkify_analytics_sdk-0.9.0.dist-info/RECORD +179 -0
- chunkify_analytics_sdk-0.9.0.dist-info/WHEEL +4 -0
- chunkify_analytics_sdk-0.9.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,471 @@
|
|
|
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 Any, Union, cast
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ..types import quality_retrieve_params
|
|
12
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
13
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
14
|
+
from .._compat import cached_property
|
|
15
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from .._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from .._base_client import make_request_options
|
|
23
|
+
from ..types.quality_response import QualityResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["QualityResource", "AsyncQualityResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class QualityResource(SyncAPIResource):
|
|
29
|
+
"""Private retained-event and view-cohort queries."""
|
|
30
|
+
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> QualityResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return QualityResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> QualityResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return QualityResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def retrieve(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
browser_name: str | Omit = omit,
|
|
54
|
+
city: str | Omit = omit,
|
|
55
|
+
continent: Literal["AF", "AN", "AS", "EU", "NA", "OC", "SA"] | Omit = omit,
|
|
56
|
+
country: str | Omit = omit,
|
|
57
|
+
cursor: str | Omit = omit,
|
|
58
|
+
device_type: Literal["desktop", "mobile", "tablet", "unknown"] | Omit = omit,
|
|
59
|
+
from_: Union[str, datetime] | Omit = omit,
|
|
60
|
+
group_by: Union[
|
|
61
|
+
Literal[
|
|
62
|
+
"browser_name",
|
|
63
|
+
"os_name",
|
|
64
|
+
"device_type",
|
|
65
|
+
"continent",
|
|
66
|
+
"country",
|
|
67
|
+
"city",
|
|
68
|
+
"page_origin",
|
|
69
|
+
"page_path",
|
|
70
|
+
"subtitle_language",
|
|
71
|
+
"playback_rate",
|
|
72
|
+
"video_title",
|
|
73
|
+
"user_id",
|
|
74
|
+
],
|
|
75
|
+
str,
|
|
76
|
+
]
|
|
77
|
+
| Omit = omit,
|
|
78
|
+
limit: int | Omit = omit,
|
|
79
|
+
os_name: str | Omit = omit,
|
|
80
|
+
page_origin: str | Omit = omit,
|
|
81
|
+
page_path: str | Omit = omit,
|
|
82
|
+
playback_rate: str | Omit = omit,
|
|
83
|
+
subtitle_language: str | Omit = omit,
|
|
84
|
+
to: Union[str, datetime] | Omit = omit,
|
|
85
|
+
user_id: str | Omit = omit,
|
|
86
|
+
video_id: str | Omit = omit,
|
|
87
|
+
video_title: str | Omit = omit,
|
|
88
|
+
view_id: str | Omit = omit,
|
|
89
|
+
viewer_id: str | Omit = omit,
|
|
90
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
91
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
92
|
+
extra_headers: Headers | None = None,
|
|
93
|
+
extra_query: Query | None = None,
|
|
94
|
+
extra_body: Body | None = None,
|
|
95
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
96
|
+
) -> QualityResponse:
|
|
97
|
+
"""
|
|
98
|
+
Get startup time, buffering, and observed fatal errors for matching playback
|
|
99
|
+
attempts. Null means unavailable. Optionally group the full filtered view-start
|
|
100
|
+
cohort with group_by=browser_name, os_name, device_type, continent, country or
|
|
101
|
+
city. Without group_by the totals response is unchanged. With group_by, return
|
|
102
|
+
paginated groups sorted by views descending. Equal view counts sort by value
|
|
103
|
+
ascending, null first. Context comes from the first retained start; missing,
|
|
104
|
+
null and nonstring values form a null group. Keep group_by and filters unchanged
|
|
105
|
+
with each cursor. Unique viewers must not be summed across groups. Includes
|
|
106
|
+
mutually exclusive startup outcomes; unknown outcomes remain explicit.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
browser_name: Exact browser name, such as Chrome. Missing values do not match.
|
|
110
|
+
|
|
111
|
+
city: Exact, case-sensitive city name from the local lookup, with 1 to 256 Unicode
|
|
112
|
+
characters. Use country alongside city to distinguish places with the same name.
|
|
113
|
+
Missing locations do not match.
|
|
114
|
+
|
|
115
|
+
continent: Exact continent code from the local lookup. Missing locations do not match.
|
|
116
|
+
|
|
117
|
+
country: Exact uppercase ISO 3166-1 alpha-2 country code, such as GB. Missing locations
|
|
118
|
+
do not match.
|
|
119
|
+
|
|
120
|
+
cursor: Use next_cursor from the previous page. Keep the same filters, sort_by and
|
|
121
|
+
order. Video cursors from earlier versions are invalid; start a new pagination
|
|
122
|
+
sequence after upgrading.
|
|
123
|
+
|
|
124
|
+
device_type: Exact device class. unknown matches an explicit unknown value.
|
|
125
|
+
|
|
126
|
+
from_: Inclusive RFC3339 occurrence-time lower bound, with timezone. Summary/video
|
|
127
|
+
queries apply it to the selected view_started event. Must be before to.
|
|
128
|
+
|
|
129
|
+
group_by: Optional on summary, quality and engagement. Group views by this field on their
|
|
130
|
+
first retained start. Missing, null and nonstring context forms a null group;
|
|
131
|
+
the literal device type unknown stays separate. Groups sort by views descending,
|
|
132
|
+
then value ascending with null first for ties. Pagination is available only with
|
|
133
|
+
group_by. Location uses the first retained start too. City groups use the stored
|
|
134
|
+
name; filter by country to avoid combining names shared by different countries.
|
|
135
|
+
Page groups use the first retained start even if playback continues after
|
|
136
|
+
navigation. Filter by page_origin when grouping page_path to distinguish
|
|
137
|
+
identical paths on different sites. video_title groups by the title on each
|
|
138
|
+
view's first retained start, so a renamed video counts each view under the title
|
|
139
|
+
it started with. user_id groups by the user ID on each view's first retained
|
|
140
|
+
start. Use custom.<key>, such as custom.plan, to group by a custom dimension;
|
|
141
|
+
views without the key form the null group.
|
|
142
|
+
|
|
143
|
+
limit: Maximum rows on this page. Events and videos always support pagination; summary,
|
|
144
|
+
quality and engagement support it only with group_by.
|
|
145
|
+
|
|
146
|
+
os_name: Exact operating-system name, such as macOS. Missing values do not match.
|
|
147
|
+
|
|
148
|
+
page_origin: Exact, case-sensitive page origin captured by the player, such as
|
|
149
|
+
https://example.com. Metrics use the first retained view start; raw events use
|
|
150
|
+
each event context. Missing values do not match.
|
|
151
|
+
|
|
152
|
+
page_path: Exact, case-sensitive page path captured by the player, such as /watch/video.
|
|
153
|
+
Filter by page_origin as well to distinguish identical paths on different sites.
|
|
154
|
+
Metrics use the first retained view start; raw events use each event context.
|
|
155
|
+
Missing values do not match.
|
|
156
|
+
|
|
157
|
+
playback_rate: Playback rate from 0.01 to 16 with at most two decimals, such as 1, 1.5 or 2;
|
|
158
|
+
2.0 and 2 are the same rate. Metrics use the rate on the first retained view
|
|
159
|
+
start; raw events use each event's value.
|
|
160
|
+
|
|
161
|
+
subtitle_language: Exact, case-sensitive, non-blank subtitle language tag, such as fr or en-US; und
|
|
162
|
+
for a subtitles track without a language. Metrics use the language showing on
|
|
163
|
+
the first retained view start; raw events use each event's value. Views without
|
|
164
|
+
subtitles at start do not match.
|
|
165
|
+
|
|
166
|
+
to: Exclusive RFC3339 occurrence-time upper bound, with timezone. Summary/video
|
|
167
|
+
queries apply it to the selected view_started event.
|
|
168
|
+
|
|
169
|
+
user_id: Exact integrator-supplied user ID. Selects views by their start event; event
|
|
170
|
+
lists match each event's own value. Missing/null user IDs do not match. Reports
|
|
171
|
+
with this filter read one stored row per view.
|
|
172
|
+
|
|
173
|
+
video_id: Exact video ID; must not be blank. Combined with all other filters using AND.
|
|
174
|
+
|
|
175
|
+
video_title: Exact, case-sensitive video title. Selects views by the title on their first
|
|
176
|
+
retained start; event lists match each event's own value. Views without a title
|
|
177
|
+
do not match. Reports with this filter read one stored row per view.
|
|
178
|
+
|
|
179
|
+
view_id: Filter one playback attempt by view ID. Metrics use its first retained start.
|
|
180
|
+
|
|
181
|
+
viewer_id: Exact viewer ID. The Chunkify player SDK generates one per browser; missing/null
|
|
182
|
+
viewer IDs do not match.
|
|
183
|
+
|
|
184
|
+
extra_headers: Send extra headers
|
|
185
|
+
|
|
186
|
+
extra_query: Add additional query parameters to the request
|
|
187
|
+
|
|
188
|
+
extra_body: Add additional JSON properties to the request
|
|
189
|
+
|
|
190
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
191
|
+
"""
|
|
192
|
+
return cast(
|
|
193
|
+
QualityResponse,
|
|
194
|
+
self._get(
|
|
195
|
+
"/v1/quality",
|
|
196
|
+
options=make_request_options(
|
|
197
|
+
extra_headers=extra_headers,
|
|
198
|
+
extra_query=extra_query,
|
|
199
|
+
extra_body=extra_body,
|
|
200
|
+
timeout=timeout,
|
|
201
|
+
query=maybe_transform(
|
|
202
|
+
{
|
|
203
|
+
"browser_name": browser_name,
|
|
204
|
+
"city": city,
|
|
205
|
+
"continent": continent,
|
|
206
|
+
"country": country,
|
|
207
|
+
"cursor": cursor,
|
|
208
|
+
"device_type": device_type,
|
|
209
|
+
"from_": from_,
|
|
210
|
+
"group_by": group_by,
|
|
211
|
+
"limit": limit,
|
|
212
|
+
"os_name": os_name,
|
|
213
|
+
"page_origin": page_origin,
|
|
214
|
+
"page_path": page_path,
|
|
215
|
+
"playback_rate": playback_rate,
|
|
216
|
+
"subtitle_language": subtitle_language,
|
|
217
|
+
"to": to,
|
|
218
|
+
"user_id": user_id,
|
|
219
|
+
"video_id": video_id,
|
|
220
|
+
"video_title": video_title,
|
|
221
|
+
"view_id": view_id,
|
|
222
|
+
"viewer_id": viewer_id,
|
|
223
|
+
},
|
|
224
|
+
quality_retrieve_params.QualityRetrieveParams,
|
|
225
|
+
),
|
|
226
|
+
security={"secret_key": True},
|
|
227
|
+
),
|
|
228
|
+
cast_to=cast(Any, QualityResponse), # Union types cannot be passed in as arguments in the type system
|
|
229
|
+
),
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class AsyncQualityResource(AsyncAPIResource):
|
|
234
|
+
"""Private retained-event and view-cohort queries."""
|
|
235
|
+
|
|
236
|
+
@cached_property
|
|
237
|
+
def with_raw_response(self) -> AsyncQualityResourceWithRawResponse:
|
|
238
|
+
"""
|
|
239
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
240
|
+
the raw response object instead of the parsed content.
|
|
241
|
+
|
|
242
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#accessing-raw-response-data-eg-headers
|
|
243
|
+
"""
|
|
244
|
+
return AsyncQualityResourceWithRawResponse(self)
|
|
245
|
+
|
|
246
|
+
@cached_property
|
|
247
|
+
def with_streaming_response(self) -> AsyncQualityResourceWithStreamingResponse:
|
|
248
|
+
"""
|
|
249
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
250
|
+
|
|
251
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#with_streaming_response
|
|
252
|
+
"""
|
|
253
|
+
return AsyncQualityResourceWithStreamingResponse(self)
|
|
254
|
+
|
|
255
|
+
async def retrieve(
|
|
256
|
+
self,
|
|
257
|
+
*,
|
|
258
|
+
browser_name: str | Omit = omit,
|
|
259
|
+
city: str | Omit = omit,
|
|
260
|
+
continent: Literal["AF", "AN", "AS", "EU", "NA", "OC", "SA"] | Omit = omit,
|
|
261
|
+
country: str | Omit = omit,
|
|
262
|
+
cursor: str | Omit = omit,
|
|
263
|
+
device_type: Literal["desktop", "mobile", "tablet", "unknown"] | Omit = omit,
|
|
264
|
+
from_: Union[str, datetime] | Omit = omit,
|
|
265
|
+
group_by: Union[
|
|
266
|
+
Literal[
|
|
267
|
+
"browser_name",
|
|
268
|
+
"os_name",
|
|
269
|
+
"device_type",
|
|
270
|
+
"continent",
|
|
271
|
+
"country",
|
|
272
|
+
"city",
|
|
273
|
+
"page_origin",
|
|
274
|
+
"page_path",
|
|
275
|
+
"subtitle_language",
|
|
276
|
+
"playback_rate",
|
|
277
|
+
"video_title",
|
|
278
|
+
"user_id",
|
|
279
|
+
],
|
|
280
|
+
str,
|
|
281
|
+
]
|
|
282
|
+
| Omit = omit,
|
|
283
|
+
limit: int | Omit = omit,
|
|
284
|
+
os_name: str | Omit = omit,
|
|
285
|
+
page_origin: str | Omit = omit,
|
|
286
|
+
page_path: str | Omit = omit,
|
|
287
|
+
playback_rate: str | Omit = omit,
|
|
288
|
+
subtitle_language: str | Omit = omit,
|
|
289
|
+
to: Union[str, datetime] | Omit = omit,
|
|
290
|
+
user_id: str | Omit = omit,
|
|
291
|
+
video_id: str | Omit = omit,
|
|
292
|
+
video_title: str | Omit = omit,
|
|
293
|
+
view_id: str | Omit = omit,
|
|
294
|
+
viewer_id: str | Omit = omit,
|
|
295
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
296
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
297
|
+
extra_headers: Headers | None = None,
|
|
298
|
+
extra_query: Query | None = None,
|
|
299
|
+
extra_body: Body | None = None,
|
|
300
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
301
|
+
) -> QualityResponse:
|
|
302
|
+
"""
|
|
303
|
+
Get startup time, buffering, and observed fatal errors for matching playback
|
|
304
|
+
attempts. Null means unavailable. Optionally group the full filtered view-start
|
|
305
|
+
cohort with group_by=browser_name, os_name, device_type, continent, country or
|
|
306
|
+
city. Without group_by the totals response is unchanged. With group_by, return
|
|
307
|
+
paginated groups sorted by views descending. Equal view counts sort by value
|
|
308
|
+
ascending, null first. Context comes from the first retained start; missing,
|
|
309
|
+
null and nonstring values form a null group. Keep group_by and filters unchanged
|
|
310
|
+
with each cursor. Unique viewers must not be summed across groups. Includes
|
|
311
|
+
mutually exclusive startup outcomes; unknown outcomes remain explicit.
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
browser_name: Exact browser name, such as Chrome. Missing values do not match.
|
|
315
|
+
|
|
316
|
+
city: Exact, case-sensitive city name from the local lookup, with 1 to 256 Unicode
|
|
317
|
+
characters. Use country alongside city to distinguish places with the same name.
|
|
318
|
+
Missing locations do not match.
|
|
319
|
+
|
|
320
|
+
continent: Exact continent code from the local lookup. Missing locations do not match.
|
|
321
|
+
|
|
322
|
+
country: Exact uppercase ISO 3166-1 alpha-2 country code, such as GB. Missing locations
|
|
323
|
+
do not match.
|
|
324
|
+
|
|
325
|
+
cursor: Use next_cursor from the previous page. Keep the same filters, sort_by and
|
|
326
|
+
order. Video cursors from earlier versions are invalid; start a new pagination
|
|
327
|
+
sequence after upgrading.
|
|
328
|
+
|
|
329
|
+
device_type: Exact device class. unknown matches an explicit unknown value.
|
|
330
|
+
|
|
331
|
+
from_: Inclusive RFC3339 occurrence-time lower bound, with timezone. Summary/video
|
|
332
|
+
queries apply it to the selected view_started event. Must be before to.
|
|
333
|
+
|
|
334
|
+
group_by: Optional on summary, quality and engagement. Group views by this field on their
|
|
335
|
+
first retained start. Missing, null and nonstring context forms a null group;
|
|
336
|
+
the literal device type unknown stays separate. Groups sort by views descending,
|
|
337
|
+
then value ascending with null first for ties. Pagination is available only with
|
|
338
|
+
group_by. Location uses the first retained start too. City groups use the stored
|
|
339
|
+
name; filter by country to avoid combining names shared by different countries.
|
|
340
|
+
Page groups use the first retained start even if playback continues after
|
|
341
|
+
navigation. Filter by page_origin when grouping page_path to distinguish
|
|
342
|
+
identical paths on different sites. video_title groups by the title on each
|
|
343
|
+
view's first retained start, so a renamed video counts each view under the title
|
|
344
|
+
it started with. user_id groups by the user ID on each view's first retained
|
|
345
|
+
start. Use custom.<key>, such as custom.plan, to group by a custom dimension;
|
|
346
|
+
views without the key form the null group.
|
|
347
|
+
|
|
348
|
+
limit: Maximum rows on this page. Events and videos always support pagination; summary,
|
|
349
|
+
quality and engagement support it only with group_by.
|
|
350
|
+
|
|
351
|
+
os_name: Exact operating-system name, such as macOS. Missing values do not match.
|
|
352
|
+
|
|
353
|
+
page_origin: Exact, case-sensitive page origin captured by the player, such as
|
|
354
|
+
https://example.com. Metrics use the first retained view start; raw events use
|
|
355
|
+
each event context. Missing values do not match.
|
|
356
|
+
|
|
357
|
+
page_path: Exact, case-sensitive page path captured by the player, such as /watch/video.
|
|
358
|
+
Filter by page_origin as well to distinguish identical paths on different sites.
|
|
359
|
+
Metrics use the first retained view start; raw events use each event context.
|
|
360
|
+
Missing values do not match.
|
|
361
|
+
|
|
362
|
+
playback_rate: Playback rate from 0.01 to 16 with at most two decimals, such as 1, 1.5 or 2;
|
|
363
|
+
2.0 and 2 are the same rate. Metrics use the rate on the first retained view
|
|
364
|
+
start; raw events use each event's value.
|
|
365
|
+
|
|
366
|
+
subtitle_language: Exact, case-sensitive, non-blank subtitle language tag, such as fr or en-US; und
|
|
367
|
+
for a subtitles track without a language. Metrics use the language showing on
|
|
368
|
+
the first retained view start; raw events use each event's value. Views without
|
|
369
|
+
subtitles at start do not match.
|
|
370
|
+
|
|
371
|
+
to: Exclusive RFC3339 occurrence-time upper bound, with timezone. Summary/video
|
|
372
|
+
queries apply it to the selected view_started event.
|
|
373
|
+
|
|
374
|
+
user_id: Exact integrator-supplied user ID. Selects views by their start event; event
|
|
375
|
+
lists match each event's own value. Missing/null user IDs do not match. Reports
|
|
376
|
+
with this filter read one stored row per view.
|
|
377
|
+
|
|
378
|
+
video_id: Exact video ID; must not be blank. Combined with all other filters using AND.
|
|
379
|
+
|
|
380
|
+
video_title: Exact, case-sensitive video title. Selects views by the title on their first
|
|
381
|
+
retained start; event lists match each event's own value. Views without a title
|
|
382
|
+
do not match. Reports with this filter read one stored row per view.
|
|
383
|
+
|
|
384
|
+
view_id: Filter one playback attempt by view ID. Metrics use its first retained start.
|
|
385
|
+
|
|
386
|
+
viewer_id: Exact viewer ID. The Chunkify player SDK generates one per browser; missing/null
|
|
387
|
+
viewer IDs do not match.
|
|
388
|
+
|
|
389
|
+
extra_headers: Send extra headers
|
|
390
|
+
|
|
391
|
+
extra_query: Add additional query parameters to the request
|
|
392
|
+
|
|
393
|
+
extra_body: Add additional JSON properties to the request
|
|
394
|
+
|
|
395
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
396
|
+
"""
|
|
397
|
+
return cast(
|
|
398
|
+
QualityResponse,
|
|
399
|
+
await self._get(
|
|
400
|
+
"/v1/quality",
|
|
401
|
+
options=make_request_options(
|
|
402
|
+
extra_headers=extra_headers,
|
|
403
|
+
extra_query=extra_query,
|
|
404
|
+
extra_body=extra_body,
|
|
405
|
+
timeout=timeout,
|
|
406
|
+
query=await async_maybe_transform(
|
|
407
|
+
{
|
|
408
|
+
"browser_name": browser_name,
|
|
409
|
+
"city": city,
|
|
410
|
+
"continent": continent,
|
|
411
|
+
"country": country,
|
|
412
|
+
"cursor": cursor,
|
|
413
|
+
"device_type": device_type,
|
|
414
|
+
"from_": from_,
|
|
415
|
+
"group_by": group_by,
|
|
416
|
+
"limit": limit,
|
|
417
|
+
"os_name": os_name,
|
|
418
|
+
"page_origin": page_origin,
|
|
419
|
+
"page_path": page_path,
|
|
420
|
+
"playback_rate": playback_rate,
|
|
421
|
+
"subtitle_language": subtitle_language,
|
|
422
|
+
"to": to,
|
|
423
|
+
"user_id": user_id,
|
|
424
|
+
"video_id": video_id,
|
|
425
|
+
"video_title": video_title,
|
|
426
|
+
"view_id": view_id,
|
|
427
|
+
"viewer_id": viewer_id,
|
|
428
|
+
},
|
|
429
|
+
quality_retrieve_params.QualityRetrieveParams,
|
|
430
|
+
),
|
|
431
|
+
security={"secret_key": True},
|
|
432
|
+
),
|
|
433
|
+
cast_to=cast(Any, QualityResponse), # Union types cannot be passed in as arguments in the type system
|
|
434
|
+
),
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
class QualityResourceWithRawResponse:
|
|
439
|
+
def __init__(self, quality: QualityResource) -> None:
|
|
440
|
+
self._quality = quality
|
|
441
|
+
|
|
442
|
+
self.retrieve = to_raw_response_wrapper(
|
|
443
|
+
quality.retrieve,
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class AsyncQualityResourceWithRawResponse:
|
|
448
|
+
def __init__(self, quality: AsyncQualityResource) -> None:
|
|
449
|
+
self._quality = quality
|
|
450
|
+
|
|
451
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
452
|
+
quality.retrieve,
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
class QualityResourceWithStreamingResponse:
|
|
457
|
+
def __init__(self, quality: QualityResource) -> None:
|
|
458
|
+
self._quality = quality
|
|
459
|
+
|
|
460
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
461
|
+
quality.retrieve,
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
class AsyncQualityResourceWithStreamingResponse:
|
|
466
|
+
def __init__(self, quality: AsyncQualityResource) -> None:
|
|
467
|
+
self._quality = quality
|
|
468
|
+
|
|
469
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
470
|
+
quality.retrieve,
|
|
471
|
+
)
|