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.
Files changed (179) hide show
  1. chunkify_analytics/__init__.py +102 -0
  2. chunkify_analytics/_base_client.py +2153 -0
  3. chunkify_analytics/_client.py +1262 -0
  4. chunkify_analytics/_compat.py +226 -0
  5. chunkify_analytics/_constants.py +14 -0
  6. chunkify_analytics/_exceptions.py +108 -0
  7. chunkify_analytics/_files.py +173 -0
  8. chunkify_analytics/_models.py +964 -0
  9. chunkify_analytics/_qs.py +149 -0
  10. chunkify_analytics/_resource.py +43 -0
  11. chunkify_analytics/_response.py +835 -0
  12. chunkify_analytics/_streaming.py +338 -0
  13. chunkify_analytics/_types.py +274 -0
  14. chunkify_analytics/_utils/__init__.py +64 -0
  15. chunkify_analytics/_utils/_compat.py +45 -0
  16. chunkify_analytics/_utils/_datetime_parse.py +136 -0
  17. chunkify_analytics/_utils/_json.py +35 -0
  18. chunkify_analytics/_utils/_logs.py +25 -0
  19. chunkify_analytics/_utils/_path.py +127 -0
  20. chunkify_analytics/_utils/_proxy.py +65 -0
  21. chunkify_analytics/_utils/_reflection.py +42 -0
  22. chunkify_analytics/_utils/_resources_proxy.py +24 -0
  23. chunkify_analytics/_utils/_streams.py +12 -0
  24. chunkify_analytics/_utils/_sync.py +58 -0
  25. chunkify_analytics/_utils/_transform.py +457 -0
  26. chunkify_analytics/_utils/_typing.py +156 -0
  27. chunkify_analytics/_utils/_utils.py +433 -0
  28. chunkify_analytics/_version.py +4 -0
  29. chunkify_analytics/lib/.keep +4 -0
  30. chunkify_analytics/pagination.py +221 -0
  31. chunkify_analytics/py.typed +0 -0
  32. chunkify_analytics/resources/__init__.py +243 -0
  33. chunkify_analytics/resources/admin/__init__.py +33 -0
  34. chunkify_analytics/resources/admin/admin.py +253 -0
  35. chunkify_analytics/resources/admin/keys.py +283 -0
  36. chunkify_analytics/resources/dimensions.py +436 -0
  37. chunkify_analytics/resources/engagement.py +479 -0
  38. chunkify_analytics/resources/errors.py +400 -0
  39. chunkify_analytics/resources/events.py +562 -0
  40. chunkify_analytics/resources/exports.py +584 -0
  41. chunkify_analytics/resources/health.py +159 -0
  42. chunkify_analytics/resources/playback_rates.py +391 -0
  43. chunkify_analytics/resources/project/__init__.py +33 -0
  44. chunkify_analytics/resources/project/keys.py +379 -0
  45. chunkify_analytics/resources/project/project.py +322 -0
  46. chunkify_analytics/resources/quality.py +471 -0
  47. chunkify_analytics/resources/renditions.py +391 -0
  48. chunkify_analytics/resources/retention.py +377 -0
  49. chunkify_analytics/resources/subtitles.py +389 -0
  50. chunkify_analytics/resources/summary.py +469 -0
  51. chunkify_analytics/resources/timeseries.py +399 -0
  52. chunkify_analytics/resources/videos.py +424 -0
  53. chunkify_analytics/resources/views.py +579 -0
  54. chunkify_analytics/types/__init__.py +145 -0
  55. chunkify_analytics/types/admin/__init__.py +3 -0
  56. chunkify_analytics/types/admin_create_project_params.py +25 -0
  57. chunkify_analytics/types/analytics_event.py +32 -0
  58. chunkify_analytics/types/analytics_event_param.py +30 -0
  59. chunkify_analytics/types/created_project.py +37 -0
  60. chunkify_analytics/types/created_project_key.py +34 -0
  61. chunkify_analytics/types/deleted_project.py +18 -0
  62. chunkify_analytics/types/dimension_list_values_params.py +124 -0
  63. chunkify_analytics/types/dimension_values.py +42 -0
  64. chunkify_analytics/types/engagement.py +60 -0
  65. chunkify_analytics/types/engagement_breakdown_page.py +44 -0
  66. chunkify_analytics/types/engagement_response.py +11 -0
  67. chunkify_analytics/types/engagement_retrieve_params.py +158 -0
  68. chunkify_analytics/types/engagement_timeseries.py +28 -0
  69. chunkify_analytics/types/engagement_timeseries_bucket.py +63 -0
  70. chunkify_analytics/types/error_group.py +17 -0
  71. chunkify_analytics/types/error_list_params.py +124 -0
  72. chunkify_analytics/types/error_page.py +14 -0
  73. chunkify_analytics/types/event_ingest_params.py +19 -0
  74. chunkify_analytics/types/event_ingest_response.py +11 -0
  75. chunkify_analytics/types/event_list_params.py +146 -0
  76. chunkify_analytics/types/event_page.py +18 -0
  77. chunkify_analytics/types/export.py +18 -0
  78. chunkify_analytics/types/export_columns.py +12 -0
  79. chunkify_analytics/types/export_create_params.py +40 -0
  80. chunkify_analytics/types/export_download_response.py +7 -0
  81. chunkify_analytics/types/export_list_columns_params.py +69 -0
  82. chunkify_analytics/types/export_query_param.py +141 -0
  83. chunkify_analytics/types/health.py +11 -0
  84. chunkify_analytics/types/metrics.py +13 -0
  85. chunkify_analytics/types/metrics_breakdown_page.py +40 -0
  86. chunkify_analytics/types/metrics_response.py +11 -0
  87. chunkify_analytics/types/native_created.py +13 -0
  88. chunkify_analytics/types/native_duplicate.py +13 -0
  89. chunkify_analytics/types/playback_error.py +180 -0
  90. chunkify_analytics/types/playback_error_param.py +182 -0
  91. chunkify_analytics/types/playback_rate_changed.py +150 -0
  92. chunkify_analytics/types/playback_rate_changed_param.py +152 -0
  93. chunkify_analytics/types/playback_rate_metric.py +21 -0
  94. chunkify_analytics/types/playback_rate_report.py +31 -0
  95. chunkify_analytics/types/playback_rate_retrieve_params.py +117 -0
  96. chunkify_analytics/types/playback_state_changed.py +150 -0
  97. chunkify_analytics/types/playback_state_changed_param.py +156 -0
  98. chunkify_analytics/types/project/__init__.py +6 -0
  99. chunkify_analytics/types/project/key_create_params.py +21 -0
  100. chunkify_analytics/types/project/project.py +35 -0
  101. chunkify_analytics/types/project_key.py +21 -0
  102. chunkify_analytics/types/project_keys.py +14 -0
  103. chunkify_analytics/types/project_update_params.py +25 -0
  104. chunkify_analytics/types/quality.py +117 -0
  105. chunkify_analytics/types/quality_breakdown_page.py +44 -0
  106. chunkify_analytics/types/quality_response.py +11 -0
  107. chunkify_analytics/types/quality_retrieve_params.py +158 -0
  108. chunkify_analytics/types/quality_timeseries.py +28 -0
  109. chunkify_analytics/types/quality_timeseries_bucket.py +120 -0
  110. chunkify_analytics/types/rendition_changed.py +156 -0
  111. chunkify_analytics/types/rendition_changed_param.py +158 -0
  112. chunkify_analytics/types/rendition_metric.py +40 -0
  113. chunkify_analytics/types/rendition_report.py +43 -0
  114. chunkify_analytics/types/rendition_retrieve_params.py +117 -0
  115. chunkify_analytics/types/retention_bucket.py +22 -0
  116. chunkify_analytics/types/retention_report.py +33 -0
  117. chunkify_analytics/types/retention_retrieve_params.py +110 -0
  118. chunkify_analytics/types/rotated_project_key.py +29 -0
  119. chunkify_analytics/types/seek_completed.py +166 -0
  120. chunkify_analytics/types/seek_completed_param.py +168 -0
  121. chunkify_analytics/types/shared/__init__.py +24 -0
  122. chunkify_analytics/types/shared/browser_context.py +62 -0
  123. chunkify_analytics/types/shared/custom_dimensions.py +8 -0
  124. chunkify_analytics/types/shared/event_context.py +161 -0
  125. chunkify_analytics/types/shared/event_envelope.py +152 -0
  126. chunkify_analytics/types/shared/metric_count_ratio.py +18 -0
  127. chunkify_analytics/types/shared/otlp_any_value.py +56 -0
  128. chunkify_analytics/types/shared/otlp_attribute.py +24 -0
  129. chunkify_analytics/types/shared/otlp_attribute_value.py +136 -0
  130. chunkify_analytics/types/shared/otlp_context_attribute.py +22 -0
  131. chunkify_analytics/types/shared/otlp_log_record.py +48 -0
  132. chunkify_analytics/types/shared/otlp_resource.py +20 -0
  133. chunkify_analytics/types/shared/otlp_scope.py +24 -0
  134. chunkify_analytics/types/shared/playback_rate_playing_time.py +12 -0
  135. chunkify_analytics/types/shared/playback_score.py +28 -0
  136. chunkify_analytics/types/shared/played_range.py +13 -0
  137. chunkify_analytics/types/shared/progress_reached.py +39 -0
  138. chunkify_analytics/types/shared/rendition_playing_time.py +21 -0
  139. chunkify_analytics/types/shared/startup_outcomes.py +39 -0
  140. chunkify_analytics/types/shared/stored_otlp_context.py +50 -0
  141. chunkify_analytics/types/shared/subtitle_playing_time.py +14 -0
  142. chunkify_analytics/types/shared/view_metrics.py +100 -0
  143. chunkify_analytics/types/shared/watch_time_distribution.py +41 -0
  144. chunkify_analytics/types/shared_params/__init__.py +8 -0
  145. chunkify_analytics/types/shared_params/browser_context.py +62 -0
  146. chunkify_analytics/types/shared_params/custom_dimensions.py +10 -0
  147. chunkify_analytics/types/shared_params/playback_rate_playing_time.py +14 -0
  148. chunkify_analytics/types/shared_params/played_range.py +15 -0
  149. chunkify_analytics/types/shared_params/rendition_playing_time.py +22 -0
  150. chunkify_analytics/types/shared_params/subtitle_playing_time.py +15 -0
  151. chunkify_analytics/types/stored_event.py +44 -0
  152. chunkify_analytics/types/subtitle_changed.py +150 -0
  153. chunkify_analytics/types/subtitle_changed_param.py +152 -0
  154. chunkify_analytics/types/subtitle_metric.py +26 -0
  155. chunkify_analytics/types/subtitle_report.py +31 -0
  156. chunkify_analytics/types/subtitle_retrieve_params.py +117 -0
  157. chunkify_analytics/types/summary_retrieve_params.py +158 -0
  158. chunkify_analytics/types/time_bucket.py +22 -0
  159. chunkify_analytics/types/timeseries.py +28 -0
  160. chunkify_analytics/types/timeseries_response.py +12 -0
  161. chunkify_analytics/types/timesery_retrieve_params.py +115 -0
  162. chunkify_analytics/types/video_list_params.py +140 -0
  163. chunkify_analytics/types/video_metrics.py +23 -0
  164. chunkify_analytics/types/video_page.py +14 -0
  165. chunkify_analytics/types/view.py +43 -0
  166. chunkify_analytics/types/view_detail.py +21 -0
  167. chunkify_analytics/types/view_ended.py +180 -0
  168. chunkify_analytics/types/view_ended_param.py +182 -0
  169. chunkify_analytics/types/view_list_params.py +152 -0
  170. chunkify_analytics/types/view_page.py +14 -0
  171. chunkify_analytics/types/view_retrieve_params.py +23 -0
  172. chunkify_analytics/types/view_snapshot.py +180 -0
  173. chunkify_analytics/types/view_snapshot_param.py +182 -0
  174. chunkify_analytics/types/view_started.py +192 -0
  175. chunkify_analytics/types/view_started_param.py +194 -0
  176. chunkify_analytics_sdk-0.9.0.dist-info/METADATA +487 -0
  177. chunkify_analytics_sdk-0.9.0.dist-info/RECORD +179 -0
  178. chunkify_analytics_sdk-0.9.0.dist-info/WHEEL +4 -0
  179. chunkify_analytics_sdk-0.9.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,28 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["PlaybackScore"]
8
+
9
+
10
+ class PlaybackScore(BaseModel):
11
+ sample_views: int
12
+ """Sessions contributing a score, including recorded failures.
13
+
14
+ A per-session result is zero or one.
15
+ """
16
+
17
+ value: Optional[float] = None
18
+ """Mean of measured per-session playback scores, or null without scored sessions.
19
+
20
+ Each session uses startup = 8 / (8 + startup_time_ms / 1000), smoothness =
21
+ exp(-10 _ buffering_ratio), and scores 100 _ startup^0.30 \\** smoothness^0.70.
22
+ Buffering ratio is rebuffer duration divided by playing plus rebuffer duration.
23
+ The 30% startup and 70% smoothness weights are heuristic. A recorded fatal error
24
+ or failed_before_start outcome scores zero. Other sessions require positive
25
+ playing time and known startup and rebuffer durations; ended_before_start and
26
+ unknown outcomes are unscored. Buffering excludes startup, pauses and seeks. The
27
+ score does not use interruption count or measure picture quality.
28
+ """
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["PlayedRange"]
6
+
7
+
8
+ class PlayedRange(BaseModel):
9
+ end_seconds: float
10
+ """Exclusive media position in seconds, greater than start_seconds."""
11
+
12
+ start_seconds: float
13
+ """Inclusive media position in seconds."""
@@ -0,0 +1,39 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+ from .metric_count_ratio import MetricCountRatio
5
+
6
+ __all__ = ["ProgressReached"]
7
+
8
+
9
+ class ProgressReached(BaseModel):
10
+ """Furthest progress on the selected final event or latest snapshot.
11
+
12
+ Only views with a positive known media duration and a progress ratio in [0,1] are samples. Each milestone ratio uses sample_views. Seeking can count; this is not watched coverage or audience retention.
13
+ """
14
+
15
+ at_100_percent: MetricCountRatio
16
+ """View count and fraction of its documented denominator.
17
+
18
+ The ratio is null when that denominator is zero.
19
+ """
20
+
21
+ at_25_percent: MetricCountRatio
22
+ """View count and fraction of its documented denominator.
23
+
24
+ The ratio is null when that denominator is zero.
25
+ """
26
+
27
+ at_50_percent: MetricCountRatio
28
+ """View count and fraction of its documented denominator.
29
+
30
+ The ratio is null when that denominator is zero.
31
+ """
32
+
33
+ at_75_percent: MetricCountRatio
34
+ """View count and fraction of its documented denominator.
35
+
36
+ The ratio is null when that denominator is zero.
37
+ """
38
+
39
+ sample_views: int
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["RenditionPlayingTime"]
8
+
9
+
10
+ class RenditionPlayingTime(BaseModel):
11
+ bitrate_bps: Optional[float] = None
12
+
13
+ codec: Optional[str] = None
14
+
15
+ frame_rate: Optional[float] = None
16
+
17
+ height: Optional[float] = None
18
+
19
+ playing_time_ms: float
20
+
21
+ width: Optional[float] = None
@@ -0,0 +1,39 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+ from .metric_count_ratio import MetricCountRatio
5
+
6
+ __all__ = ["StartupOutcomes"]
7
+
8
+
9
+ class StartupOutcomes(BaseModel):
10
+ """Mutually exclusive outcomes.
11
+
12
+ An explicit startup_outcome on the selected final event takes precedence. Otherwise an available startup time, including zero, or positive playing time on the selected measurement proves started. All other views are unknown. sample_views excludes unknown; every ratio uses all selected attempts, including unknown. Missing final delivery does not prove an exit or failure.
13
+ """
14
+
15
+ ended_before_start: MetricCountRatio
16
+ """View count and fraction of its documented denominator.
17
+
18
+ The ratio is null when that denominator is zero.
19
+ """
20
+
21
+ failed_before_start: MetricCountRatio
22
+ """View count and fraction of its documented denominator.
23
+
24
+ The ratio is null when that denominator is zero.
25
+ """
26
+
27
+ sample_views: int
28
+
29
+ started: MetricCountRatio
30
+ """View count and fraction of its documented denominator.
31
+
32
+ The ratio is null when that denominator is zero.
33
+ """
34
+
35
+ unknown: MetricCountRatio
36
+ """View count and fraction of its documented denominator.
37
+
38
+ The ratio is null when that denominator is zero.
39
+ """
@@ -0,0 +1,50 @@
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 Optional
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from ..._models import BaseModel
10
+
11
+ __all__ = ["StoredOtlpContext", "ResourceLogs", "ScopeLogs"]
12
+
13
+
14
+ class ResourceLogs(BaseModel):
15
+ """Original resource group excluding scopeLogs."""
16
+
17
+ resource: Optional["OtlpResource"] = None
18
+
19
+ schema_url: Optional[str] = FieldInfo(alias="schemaUrl", default=None)
20
+
21
+
22
+ class ScopeLogs(BaseModel):
23
+ """Original scope group excluding logRecords."""
24
+
25
+ schema_url: Optional[str] = FieldInfo(alias="schemaUrl", default=None)
26
+
27
+ scope: Optional["OtlpScope"] = None
28
+
29
+
30
+ class StoredOtlpContext(BaseModel):
31
+ """
32
+ Legacy context present for an event received through OTLP by an earlier collector version. Existing context remains readable; new ingestion accepts native JSON events only.
33
+ """
34
+
35
+ log_record: "OtlpLogRecord"
36
+ """A playback event in log attributes.
37
+
38
+ Duplicate attributes and invalid event fields reject the request.
39
+ """
40
+
41
+ resource_logs: ResourceLogs
42
+ """Original resource group excluding scopeLogs."""
43
+
44
+ scope_logs: ScopeLogs
45
+ """Original scope group excluding logRecords."""
46
+
47
+
48
+ from .otlp_scope import OtlpScope
49
+ from .otlp_resource import OtlpResource
50
+ from .otlp_log_record import OtlpLogRecord
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["SubtitlePlayingTime"]
8
+
9
+
10
+ class SubtitlePlayingTime(BaseModel):
11
+ language: Optional[str] = None
12
+ """Subtitle language tag, or null for subtitles off."""
13
+
14
+ playing_time_ms: float
@@ -0,0 +1,100 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+
5
+ from ..._models import BaseModel
6
+ from .played_range import PlayedRange
7
+ from .subtitle_playing_time import SubtitlePlayingTime
8
+ from .rendition_playing_time import RenditionPlayingTime
9
+ from .playback_rate_playing_time import PlaybackRatePlayingTime
10
+
11
+ __all__ = ["ViewMetrics"]
12
+
13
+
14
+ class ViewMetrics(BaseModel):
15
+ delivery_request_count: Optional[float] = None
16
+
17
+ delivery_throughput_bps: Optional[float] = None
18
+
19
+ delivery_transferred_bytes: Optional[float] = None
20
+
21
+ dropped_video_frames: Optional[float] = None
22
+
23
+ first_video_frame_time_ms: Optional[float] = None
24
+
25
+ furthest_progress_ratio: Optional[float] = None
26
+
27
+ maximum_playhead_seconds: float
28
+
29
+ media_duration_seconds: Optional[float] = None
30
+
31
+ media_height_px: Optional[float] = None
32
+
33
+ media_width_px: Optional[float] = None
34
+
35
+ player_height_px: Optional[float] = None
36
+
37
+ player_width_px: Optional[float] = None
38
+
39
+ playing_time_ms: float
40
+
41
+ rebuffer_count: float
42
+
43
+ rebuffer_duration_ms: float
44
+
45
+ rebuffer_ratio: Optional[float] = None
46
+
47
+ rendition_playing_time: Optional[List[RenditionPlayingTime]] = None
48
+
49
+ rendition_switch_count: Optional[float] = None
50
+
51
+ seek_count: float
52
+
53
+ seek_duration_ms: float
54
+
55
+ selected_rendition_bitrate_bps: Optional[float] = None
56
+
57
+ selected_rendition_codec: Optional[str] = None
58
+
59
+ selected_rendition_height: Optional[float] = None
60
+
61
+ selected_rendition_width: Optional[float] = None
62
+
63
+ startup_time_ms: Optional[float] = None
64
+
65
+ total_video_frames: Optional[float] = None
66
+
67
+ playback_rate: Optional[float] = None
68
+ """
69
+ Current playback rate, rounded to two decimals, such as 1, 1.5 or 2; from 0.01
70
+ to 16. Optional.
71
+ """
72
+
73
+ playback_rate_playing_time: Optional[List[PlaybackRatePlayingTime]] = None
74
+ """Cumulative playing time per playback rate for this attempt.
75
+
76
+ At most 32 entries. Optional.
77
+ """
78
+
79
+ played_ranges: Optional[List[PlayedRange]] = None
80
+ """
81
+ Cumulative played media ranges for this attempt, sorted and merged without
82
+ overlaps. Seeking, pauses and buffering are excluded. Missing or null means
83
+ unavailable; an empty array means measured but no section played. Replaying a
84
+ section does not add another range.
85
+ """
86
+
87
+ playhead_seconds: Optional[float] = None
88
+ """Current media position at this event, not the maximum reached."""
89
+
90
+ subtitle_language: Optional[str] = None
91
+ """
92
+ Language tag (BCP 47) of the showing subtitles or captions track; und when the
93
+ track declares no language; null when subtitles are off. Optional.
94
+ """
95
+
96
+ subtitle_playing_time: Optional[List[SubtitlePlayingTime]] = None
97
+ """
98
+ Cumulative playing time per subtitle language for this attempt, null language
99
+ meaning subtitles off. At most 32 entries. Optional.
100
+ """
@@ -0,0 +1,41 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["WatchTimeDistribution", "Distribution"]
8
+
9
+
10
+ class Distribution(BaseModel):
11
+ """
12
+ Mutually exclusive playing-time buckets: [0,10s), [10s,30s), [30s,60s), [1m,5m), [5m,infinity). Counts sum to sample_views.
13
+ """
14
+
15
+ at_least_5_minutes: int
16
+
17
+ from_1_to_5_minutes: int
18
+
19
+ from_10_to_30_seconds: int
20
+
21
+ from_30_to_60_seconds: int
22
+
23
+ under_10_seconds: int
24
+
25
+
26
+ class WatchTimeDistribution(BaseModel):
27
+ """
28
+ Playing time in milliseconds from one selected final event or latest snapshot per view. Measured zero is included; missing measurements are excluded. Percentiles use linear interpolation and are null without samples. This sample denominator differs from average_playing_time_ms, which uses all attempts.
29
+ """
30
+
31
+ distribution: Distribution
32
+ """
33
+ Mutually exclusive playing-time buckets: [0,10s), [10s,30s), [30s,60s), [1m,5m),
34
+ [5m,infinity). Counts sum to sample_views.
35
+ """
36
+
37
+ median: Optional[float] = None
38
+
39
+ p95: Optional[float] = None
40
+
41
+ sample_views: int
@@ -0,0 +1,8 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .played_range import PlayedRange as PlayedRange
4
+ from .browser_context import BrowserContext as BrowserContext
5
+ from .custom_dimensions import CustomDimensions as CustomDimensions
6
+ from .subtitle_playing_time import SubtitlePlayingTime as SubtitlePlayingTime
7
+ from .rendition_playing_time import RenditionPlayingTime as RenditionPlayingTime
8
+ from .playback_rate_playing_time import PlaybackRatePlayingTime as PlaybackRatePlayingTime
@@ -0,0 +1,62 @@
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 Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ __all__ = ["BrowserContext"]
9
+
10
+
11
+ class BrowserContext(TypedDict, total=False):
12
+ """Browser and device information.
13
+
14
+ The Chunkify player sends every field, with null for unavailable measurements. Other integrations may omit any field except schema_version. Extra properties are preserved.
15
+ """
16
+
17
+ schema_version: Required[Literal[1]]
18
+
19
+ browser_name: Optional[str]
20
+
21
+ browser_version: Optional[str]
22
+
23
+ device_family: Optional[str]
24
+
25
+ device_type: Literal["desktop", "mobile", "tablet", "unknown"]
26
+
27
+ language: Optional[str]
28
+
29
+ language_prefix: Optional[str]
30
+
31
+ os_name: Optional[str]
32
+
33
+ os_version: Optional[str]
34
+
35
+ page_origin: Optional[str]
36
+ """Current document HTTP(S) origin, without credentials.
37
+
38
+ Null when unavailable or longer than 2048 characters.
39
+ """
40
+
41
+ page_path: Optional[str]
42
+ """Current document pathname, without query parameters or fragment.
43
+
44
+ Null when unavailable or longer than 2048 characters. Paths may contain
45
+ application-defined identifiers.
46
+ """
47
+
48
+ pixel_ratio: Optional[float]
49
+
50
+ screen_height_px: Optional[int]
51
+
52
+ screen_width_px: Optional[int]
53
+
54
+ timezone: Optional[str]
55
+
56
+ timezone_offset_minutes: Optional[int]
57
+
58
+ user_agent: Optional[str]
59
+
60
+ viewport_height_px: Optional[int]
61
+
62
+ viewport_width_px: Optional[int]
@@ -0,0 +1,10 @@
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 Dict, Union
6
+ from typing_extensions import TypeAlias
7
+
8
+ __all__ = ["CustomDimensions"]
9
+
10
+ CustomDimensions: TypeAlias = Dict[str, Union[str, float, bool]]
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["PlaybackRatePlayingTime"]
8
+
9
+
10
+ class PlaybackRatePlayingTime(TypedDict, total=False):
11
+ playing_time_ms: Required[float]
12
+
13
+ rate: Required[float]
14
+ """Playback rate, rounded to two decimals."""
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["PlayedRange"]
8
+
9
+
10
+ class PlayedRange(TypedDict, total=False):
11
+ end_seconds: Required[float]
12
+ """Exclusive media position in seconds, greater than start_seconds."""
13
+
14
+ start_seconds: Required[float]
15
+ """Inclusive media position in seconds."""
@@ -0,0 +1,22 @@
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 Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ __all__ = ["RenditionPlayingTime"]
9
+
10
+
11
+ class RenditionPlayingTime(TypedDict, total=False):
12
+ bitrate_bps: Required[Optional[float]]
13
+
14
+ codec: Required[Optional[str]]
15
+
16
+ frame_rate: Required[Optional[float]]
17
+
18
+ height: Required[Optional[float]]
19
+
20
+ playing_time_ms: Required[float]
21
+
22
+ width: Required[Optional[float]]
@@ -0,0 +1,15 @@
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 Optional
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ __all__ = ["SubtitlePlayingTime"]
9
+
10
+
11
+ class SubtitlePlayingTime(TypedDict, total=False):
12
+ language: Required[Optional[str]]
13
+ """Subtitle language tag, or null for subtitles off."""
14
+
15
+ playing_time_ms: Required[float]
@@ -0,0 +1,44 @@
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 Optional
6
+ from datetime import datetime
7
+
8
+ from .._models import BaseModel
9
+ from .analytics_event import AnalyticsEvent
10
+ from .shared.event_context import EventContext
11
+
12
+ __all__ = ["StoredEvent"]
13
+
14
+
15
+ class StoredEvent(BaseModel):
16
+ event: AnalyticsEvent
17
+ """A schema version 1 playback event. Extra properties are preserved."""
18
+
19
+ ingest_key_id: Optional[str] = None
20
+ """ID of the public key used to receive this event. Null when unavailable."""
21
+
22
+ project_id: str
23
+ """Trusted project identifier resolved from the public key.
24
+
25
+ Historical events migrate to default.
26
+ """
27
+
28
+ received_at: datetime
29
+
30
+ event_context: Optional[EventContext] = None
31
+ """Browser context and locally derived continent/country/city.
32
+
33
+ Request IP addresses are never added to events or stored context.
34
+ """
35
+
36
+ otlp: Optional["StoredOtlpContext"] = None
37
+ """
38
+ Legacy context present for an event received through OTLP by an earlier
39
+ collector version. Existing context remains readable; new ingestion accepts
40
+ native JSON events only.
41
+ """
42
+
43
+
44
+ from .shared.stored_otlp_context import StoredOtlpContext