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,399 @@
|
|
|
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 timesery_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.timeseries_response import TimeseriesResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["TimeseriesResource", "AsyncTimeseriesResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class TimeseriesResource(SyncAPIResource):
|
|
29
|
+
"""Private retained-event and view-cohort queries."""
|
|
30
|
+
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> TimeseriesResourceWithRawResponse:
|
|
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 TimeseriesResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> TimeseriesResourceWithStreamingResponse:
|
|
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 TimeseriesResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def retrieve(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
from_: Union[str, datetime],
|
|
54
|
+
interval: Literal["hour", "day"],
|
|
55
|
+
to: Union[str, datetime],
|
|
56
|
+
browser_name: str | Omit = omit,
|
|
57
|
+
city: str | Omit = omit,
|
|
58
|
+
continent: Literal["AF", "AN", "AS", "EU", "NA", "OC", "SA"] | Omit = omit,
|
|
59
|
+
country: str | Omit = omit,
|
|
60
|
+
device_type: Literal["desktop", "mobile", "tablet", "unknown"] | Omit = omit,
|
|
61
|
+
kind: Literal["summary", "quality", "engagement"] | Omit = omit,
|
|
62
|
+
os_name: str | Omit = omit,
|
|
63
|
+
page_origin: str | Omit = omit,
|
|
64
|
+
page_path: str | Omit = omit,
|
|
65
|
+
playback_rate: str | Omit = omit,
|
|
66
|
+
subtitle_language: str | Omit = omit,
|
|
67
|
+
user_id: str | Omit = omit,
|
|
68
|
+
video_id: str | Omit = omit,
|
|
69
|
+
video_title: str | Omit = omit,
|
|
70
|
+
view_id: str | Omit = omit,
|
|
71
|
+
viewer_id: str | Omit = omit,
|
|
72
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
73
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
74
|
+
extra_headers: Headers | None = None,
|
|
75
|
+
extra_query: Query | None = None,
|
|
76
|
+
extra_body: Body | None = None,
|
|
77
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
78
|
+
) -> TimeseriesResponse:
|
|
79
|
+
"""Supply from, to and interval=hour|day.
|
|
80
|
+
|
|
81
|
+
kind defaults to summary and also accepts
|
|
82
|
+
quality or engagement. Every bucket selects first retained starts in its UTC
|
|
83
|
+
interval and includes each selected view's whole retained measurement and
|
|
84
|
+
errors, even after to. Empty buckets have zero counts and null unavailable
|
|
85
|
+
measurements or ratios. At most 1000 buckets. Unique viewer counts are not
|
|
86
|
+
additive.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
from_: Inclusive view-start time in RFC3339 format with a timezone.
|
|
90
|
+
|
|
91
|
+
interval: UTC hour or day. The requested range can contain at most 1000 buckets.
|
|
92
|
+
|
|
93
|
+
to: Exclusive view-start time in RFC3339 format with a timezone. Must be later than
|
|
94
|
+
from.
|
|
95
|
+
|
|
96
|
+
browser_name: Exact browser name, such as Chrome. Missing values do not match.
|
|
97
|
+
|
|
98
|
+
city: Exact, case-sensitive city name from the local lookup, with 1 to 256 Unicode
|
|
99
|
+
characters. Use country alongside city to distinguish places with the same name.
|
|
100
|
+
Missing locations do not match.
|
|
101
|
+
|
|
102
|
+
continent: Exact continent code from the local lookup. Missing locations do not match.
|
|
103
|
+
|
|
104
|
+
country: Exact uppercase ISO 3166-1 alpha-2 country code, such as GB. Missing locations
|
|
105
|
+
do not match.
|
|
106
|
+
|
|
107
|
+
device_type: Exact device class. unknown matches an explicit unknown value.
|
|
108
|
+
|
|
109
|
+
kind: Metric set for every time bucket. Uses the same calculations and sample counts
|
|
110
|
+
as the corresponding totals route.
|
|
111
|
+
|
|
112
|
+
os_name: Exact operating-system name, such as macOS. Missing values do not match.
|
|
113
|
+
|
|
114
|
+
page_origin: Exact, case-sensitive page origin captured by the player, such as
|
|
115
|
+
https://example.com. Metrics use the first retained view start; raw events use
|
|
116
|
+
each event context. Missing values do not match.
|
|
117
|
+
|
|
118
|
+
page_path: Exact, case-sensitive page path captured by the player, such as /watch/video.
|
|
119
|
+
Filter by page_origin as well to distinguish identical paths on different sites.
|
|
120
|
+
Metrics use the first retained view start; raw events use each event context.
|
|
121
|
+
Missing values do not match.
|
|
122
|
+
|
|
123
|
+
playback_rate: Playback rate from 0.01 to 16 with at most two decimals, such as 1, 1.5 or 2;
|
|
124
|
+
2.0 and 2 are the same rate. Metrics use the rate on the first retained view
|
|
125
|
+
start; raw events use each event's value.
|
|
126
|
+
|
|
127
|
+
subtitle_language: Exact, case-sensitive, non-blank subtitle language tag, such as fr or en-US; und
|
|
128
|
+
for a subtitles track without a language. Metrics use the language showing on
|
|
129
|
+
the first retained view start; raw events use each event's value. Views without
|
|
130
|
+
subtitles at start do not match.
|
|
131
|
+
|
|
132
|
+
user_id: Exact integrator-supplied user ID. Selects views by their start event; event
|
|
133
|
+
lists match each event's own value. Missing/null user IDs do not match. Reports
|
|
134
|
+
with this filter read one stored row per view.
|
|
135
|
+
|
|
136
|
+
video_id: Exact video ID; must not be blank. Combined with all other filters using AND.
|
|
137
|
+
|
|
138
|
+
video_title: Exact, case-sensitive video title. Selects views by the title on their first
|
|
139
|
+
retained start; event lists match each event's own value. Views without a title
|
|
140
|
+
do not match. Reports with this filter read one stored row per view.
|
|
141
|
+
|
|
142
|
+
view_id: Filter one playback attempt by view ID. Metrics use its first retained start.
|
|
143
|
+
|
|
144
|
+
viewer_id: Exact viewer ID. The Chunkify player SDK generates one per browser; missing/null
|
|
145
|
+
viewer IDs do not match.
|
|
146
|
+
|
|
147
|
+
extra_headers: Send extra headers
|
|
148
|
+
|
|
149
|
+
extra_query: Add additional query parameters to the request
|
|
150
|
+
|
|
151
|
+
extra_body: Add additional JSON properties to the request
|
|
152
|
+
|
|
153
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
154
|
+
"""
|
|
155
|
+
return cast(
|
|
156
|
+
TimeseriesResponse,
|
|
157
|
+
self._get(
|
|
158
|
+
"/v1/timeseries",
|
|
159
|
+
options=make_request_options(
|
|
160
|
+
extra_headers=extra_headers,
|
|
161
|
+
extra_query=extra_query,
|
|
162
|
+
extra_body=extra_body,
|
|
163
|
+
timeout=timeout,
|
|
164
|
+
query=maybe_transform(
|
|
165
|
+
{
|
|
166
|
+
"from_": from_,
|
|
167
|
+
"interval": interval,
|
|
168
|
+
"to": to,
|
|
169
|
+
"browser_name": browser_name,
|
|
170
|
+
"city": city,
|
|
171
|
+
"continent": continent,
|
|
172
|
+
"country": country,
|
|
173
|
+
"device_type": device_type,
|
|
174
|
+
"kind": kind,
|
|
175
|
+
"os_name": os_name,
|
|
176
|
+
"page_origin": page_origin,
|
|
177
|
+
"page_path": page_path,
|
|
178
|
+
"playback_rate": playback_rate,
|
|
179
|
+
"subtitle_language": subtitle_language,
|
|
180
|
+
"user_id": user_id,
|
|
181
|
+
"video_id": video_id,
|
|
182
|
+
"video_title": video_title,
|
|
183
|
+
"view_id": view_id,
|
|
184
|
+
"viewer_id": viewer_id,
|
|
185
|
+
},
|
|
186
|
+
timesery_retrieve_params.TimeseryRetrieveParams,
|
|
187
|
+
),
|
|
188
|
+
security={"secret_key": True},
|
|
189
|
+
),
|
|
190
|
+
cast_to=cast(
|
|
191
|
+
Any, TimeseriesResponse
|
|
192
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
193
|
+
),
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class AsyncTimeseriesResource(AsyncAPIResource):
|
|
198
|
+
"""Private retained-event and view-cohort queries."""
|
|
199
|
+
|
|
200
|
+
@cached_property
|
|
201
|
+
def with_raw_response(self) -> AsyncTimeseriesResourceWithRawResponse:
|
|
202
|
+
"""
|
|
203
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
204
|
+
the raw response object instead of the parsed content.
|
|
205
|
+
|
|
206
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#accessing-raw-response-data-eg-headers
|
|
207
|
+
"""
|
|
208
|
+
return AsyncTimeseriesResourceWithRawResponse(self)
|
|
209
|
+
|
|
210
|
+
@cached_property
|
|
211
|
+
def with_streaming_response(self) -> AsyncTimeseriesResourceWithStreamingResponse:
|
|
212
|
+
"""
|
|
213
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
214
|
+
|
|
215
|
+
For more information, see https://www.github.com/chunkifydev/chunkify-analytics-python#with_streaming_response
|
|
216
|
+
"""
|
|
217
|
+
return AsyncTimeseriesResourceWithStreamingResponse(self)
|
|
218
|
+
|
|
219
|
+
async def retrieve(
|
|
220
|
+
self,
|
|
221
|
+
*,
|
|
222
|
+
from_: Union[str, datetime],
|
|
223
|
+
interval: Literal["hour", "day"],
|
|
224
|
+
to: Union[str, datetime],
|
|
225
|
+
browser_name: str | Omit = omit,
|
|
226
|
+
city: str | Omit = omit,
|
|
227
|
+
continent: Literal["AF", "AN", "AS", "EU", "NA", "OC", "SA"] | Omit = omit,
|
|
228
|
+
country: str | Omit = omit,
|
|
229
|
+
device_type: Literal["desktop", "mobile", "tablet", "unknown"] | Omit = omit,
|
|
230
|
+
kind: Literal["summary", "quality", "engagement"] | Omit = omit,
|
|
231
|
+
os_name: str | Omit = omit,
|
|
232
|
+
page_origin: str | Omit = omit,
|
|
233
|
+
page_path: str | Omit = omit,
|
|
234
|
+
playback_rate: str | Omit = omit,
|
|
235
|
+
subtitle_language: str | Omit = omit,
|
|
236
|
+
user_id: str | Omit = omit,
|
|
237
|
+
video_id: str | Omit = omit,
|
|
238
|
+
video_title: str | Omit = omit,
|
|
239
|
+
view_id: str | Omit = omit,
|
|
240
|
+
viewer_id: str | Omit = omit,
|
|
241
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
242
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
243
|
+
extra_headers: Headers | None = None,
|
|
244
|
+
extra_query: Query | None = None,
|
|
245
|
+
extra_body: Body | None = None,
|
|
246
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
247
|
+
) -> TimeseriesResponse:
|
|
248
|
+
"""Supply from, to and interval=hour|day.
|
|
249
|
+
|
|
250
|
+
kind defaults to summary and also accepts
|
|
251
|
+
quality or engagement. Every bucket selects first retained starts in its UTC
|
|
252
|
+
interval and includes each selected view's whole retained measurement and
|
|
253
|
+
errors, even after to. Empty buckets have zero counts and null unavailable
|
|
254
|
+
measurements or ratios. At most 1000 buckets. Unique viewer counts are not
|
|
255
|
+
additive.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
from_: Inclusive view-start time in RFC3339 format with a timezone.
|
|
259
|
+
|
|
260
|
+
interval: UTC hour or day. The requested range can contain at most 1000 buckets.
|
|
261
|
+
|
|
262
|
+
to: Exclusive view-start time in RFC3339 format with a timezone. Must be later than
|
|
263
|
+
from.
|
|
264
|
+
|
|
265
|
+
browser_name: Exact browser name, such as Chrome. Missing values do not match.
|
|
266
|
+
|
|
267
|
+
city: Exact, case-sensitive city name from the local lookup, with 1 to 256 Unicode
|
|
268
|
+
characters. Use country alongside city to distinguish places with the same name.
|
|
269
|
+
Missing locations do not match.
|
|
270
|
+
|
|
271
|
+
continent: Exact continent code from the local lookup. Missing locations do not match.
|
|
272
|
+
|
|
273
|
+
country: Exact uppercase ISO 3166-1 alpha-2 country code, such as GB. Missing locations
|
|
274
|
+
do not match.
|
|
275
|
+
|
|
276
|
+
device_type: Exact device class. unknown matches an explicit unknown value.
|
|
277
|
+
|
|
278
|
+
kind: Metric set for every time bucket. Uses the same calculations and sample counts
|
|
279
|
+
as the corresponding totals route.
|
|
280
|
+
|
|
281
|
+
os_name: Exact operating-system name, such as macOS. Missing values do not match.
|
|
282
|
+
|
|
283
|
+
page_origin: Exact, case-sensitive page origin captured by the player, such as
|
|
284
|
+
https://example.com. Metrics use the first retained view start; raw events use
|
|
285
|
+
each event context. Missing values do not match.
|
|
286
|
+
|
|
287
|
+
page_path: Exact, case-sensitive page path captured by the player, such as /watch/video.
|
|
288
|
+
Filter by page_origin as well to distinguish identical paths on different sites.
|
|
289
|
+
Metrics use the first retained view start; raw events use each event context.
|
|
290
|
+
Missing values do not match.
|
|
291
|
+
|
|
292
|
+
playback_rate: Playback rate from 0.01 to 16 with at most two decimals, such as 1, 1.5 or 2;
|
|
293
|
+
2.0 and 2 are the same rate. Metrics use the rate on the first retained view
|
|
294
|
+
start; raw events use each event's value.
|
|
295
|
+
|
|
296
|
+
subtitle_language: Exact, case-sensitive, non-blank subtitle language tag, such as fr or en-US; und
|
|
297
|
+
for a subtitles track without a language. Metrics use the language showing on
|
|
298
|
+
the first retained view start; raw events use each event's value. Views without
|
|
299
|
+
subtitles at start do not match.
|
|
300
|
+
|
|
301
|
+
user_id: Exact integrator-supplied user ID. Selects views by their start event; event
|
|
302
|
+
lists match each event's own value. Missing/null user IDs do not match. Reports
|
|
303
|
+
with this filter read one stored row per view.
|
|
304
|
+
|
|
305
|
+
video_id: Exact video ID; must not be blank. Combined with all other filters using AND.
|
|
306
|
+
|
|
307
|
+
video_title: Exact, case-sensitive video title. Selects views by the title on their first
|
|
308
|
+
retained start; event lists match each event's own value. Views without a title
|
|
309
|
+
do not match. Reports with this filter read one stored row per view.
|
|
310
|
+
|
|
311
|
+
view_id: Filter one playback attempt by view ID. Metrics use its first retained start.
|
|
312
|
+
|
|
313
|
+
viewer_id: Exact viewer ID. The Chunkify player SDK generates one per browser; missing/null
|
|
314
|
+
viewer IDs do not match.
|
|
315
|
+
|
|
316
|
+
extra_headers: Send extra headers
|
|
317
|
+
|
|
318
|
+
extra_query: Add additional query parameters to the request
|
|
319
|
+
|
|
320
|
+
extra_body: Add additional JSON properties to the request
|
|
321
|
+
|
|
322
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
323
|
+
"""
|
|
324
|
+
return cast(
|
|
325
|
+
TimeseriesResponse,
|
|
326
|
+
await self._get(
|
|
327
|
+
"/v1/timeseries",
|
|
328
|
+
options=make_request_options(
|
|
329
|
+
extra_headers=extra_headers,
|
|
330
|
+
extra_query=extra_query,
|
|
331
|
+
extra_body=extra_body,
|
|
332
|
+
timeout=timeout,
|
|
333
|
+
query=await async_maybe_transform(
|
|
334
|
+
{
|
|
335
|
+
"from_": from_,
|
|
336
|
+
"interval": interval,
|
|
337
|
+
"to": to,
|
|
338
|
+
"browser_name": browser_name,
|
|
339
|
+
"city": city,
|
|
340
|
+
"continent": continent,
|
|
341
|
+
"country": country,
|
|
342
|
+
"device_type": device_type,
|
|
343
|
+
"kind": kind,
|
|
344
|
+
"os_name": os_name,
|
|
345
|
+
"page_origin": page_origin,
|
|
346
|
+
"page_path": page_path,
|
|
347
|
+
"playback_rate": playback_rate,
|
|
348
|
+
"subtitle_language": subtitle_language,
|
|
349
|
+
"user_id": user_id,
|
|
350
|
+
"video_id": video_id,
|
|
351
|
+
"video_title": video_title,
|
|
352
|
+
"view_id": view_id,
|
|
353
|
+
"viewer_id": viewer_id,
|
|
354
|
+
},
|
|
355
|
+
timesery_retrieve_params.TimeseryRetrieveParams,
|
|
356
|
+
),
|
|
357
|
+
security={"secret_key": True},
|
|
358
|
+
),
|
|
359
|
+
cast_to=cast(
|
|
360
|
+
Any, TimeseriesResponse
|
|
361
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
362
|
+
),
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
class TimeseriesResourceWithRawResponse:
|
|
367
|
+
def __init__(self, timeseries: TimeseriesResource) -> None:
|
|
368
|
+
self._timeseries = timeseries
|
|
369
|
+
|
|
370
|
+
self.retrieve = to_raw_response_wrapper(
|
|
371
|
+
timeseries.retrieve,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
class AsyncTimeseriesResourceWithRawResponse:
|
|
376
|
+
def __init__(self, timeseries: AsyncTimeseriesResource) -> None:
|
|
377
|
+
self._timeseries = timeseries
|
|
378
|
+
|
|
379
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
380
|
+
timeseries.retrieve,
|
|
381
|
+
)
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class TimeseriesResourceWithStreamingResponse:
|
|
385
|
+
def __init__(self, timeseries: TimeseriesResource) -> None:
|
|
386
|
+
self._timeseries = timeseries
|
|
387
|
+
|
|
388
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
389
|
+
timeseries.retrieve,
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
class AsyncTimeseriesResourceWithStreamingResponse:
|
|
394
|
+
def __init__(self, timeseries: AsyncTimeseriesResource) -> None:
|
|
395
|
+
self._timeseries = timeseries
|
|
396
|
+
|
|
397
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
398
|
+
timeseries.retrieve,
|
|
399
|
+
)
|