trustcomponent 0.0.1b0__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 (89) hide show
  1. trustcomponent/__init__.py +7 -0
  2. trustcomponent/_client.py +54 -0
  3. trustcomponent/_generated/__init__.py +186 -0
  4. trustcomponent/_generated/api/__init__.py +12 -0
  5. trustcomponent/_generated/api/analytics_server_events_api.py +330 -0
  6. trustcomponent/_generated/api/analytics_websites_api.py +2006 -0
  7. trustcomponent/_generated/api/captcha_verifications_api.py +335 -0
  8. trustcomponent/_generated/api/monitoring_heartbeats_api.py +315 -0
  9. trustcomponent/_generated/api/platform_events_api.py +381 -0
  10. trustcomponent/_generated/api/tax_validation_schedules_api.py +579 -0
  11. trustcomponent/_generated/api/tax_validation_validation_results_api.py +305 -0
  12. trustcomponent/_generated/api/tax_validation_validations_api.py +609 -0
  13. trustcomponent/_generated/api_client.py +819 -0
  14. trustcomponent/_generated/api_response.py +21 -0
  15. trustcomponent/_generated/configuration.py +630 -0
  16. trustcomponent/_generated/exceptions.py +218 -0
  17. trustcomponent/_generated/models/__init__.py +78 -0
  18. trustcomponent/_generated/models/analytics_event_category_enum.py +49 -0
  19. trustcomponent/_generated/models/analytics_realtime.py +110 -0
  20. trustcomponent/_generated/models/analytics_realtime_page.py +90 -0
  21. trustcomponent/_generated/models/analytics_realtime_point.py +90 -0
  22. trustcomponent/_generated/models/analytics_server_event_batch_create_params.py +106 -0
  23. trustcomponent/_generated/models/analytics_server_event_batch_event_commerce_create_params.py +113 -0
  24. trustcomponent/_generated/models/analytics_server_event_batch_event_commerce_product_create_params.py +97 -0
  25. trustcomponent/_generated/models/analytics_server_event_batch_event_create_params.py +131 -0
  26. trustcomponent/_generated/models/analytics_server_event_batch_event_error_create_params.py +95 -0
  27. trustcomponent/_generated/models/analytics_server_event_batch_event_refund_create_params.py +91 -0
  28. trustcomponent/_generated/models/analytics_server_event_batch_result.py +98 -0
  29. trustcomponent/_generated/models/analytics_server_event_batch_result_drop_reason_enum.py +49 -0
  30. trustcomponent/_generated/models/analytics_server_event_batch_result_dropped.py +91 -0
  31. trustcomponent/_generated/models/analytics_stats_breakdown.py +109 -0
  32. trustcomponent/_generated/models/analytics_stats_breakdown_row.py +100 -0
  33. trustcomponent/_generated/models/analytics_stats_breakdown_row_page.py +111 -0
  34. trustcomponent/_generated/models/analytics_stats_conversions.py +102 -0
  35. trustcomponent/_generated/models/analytics_stats_conversions_goal.py +110 -0
  36. trustcomponent/_generated/models/analytics_stats_conversions_goal_revenue.py +90 -0
  37. trustcomponent/_generated/models/analytics_stats_dimension_enum.py +66 -0
  38. trustcomponent/_generated/models/analytics_stats_filter_match_mode_enum.py +37 -0
  39. trustcomponent/_generated/models/analytics_stats_filter_operator_enum.py +42 -0
  40. trustcomponent/_generated/models/analytics_stats_granularity_enum.py +37 -0
  41. trustcomponent/_generated/models/analytics_stats_overview.py +105 -0
  42. trustcomponent/_generated/models/analytics_stats_timeseries.py +103 -0
  43. trustcomponent/_generated/models/analytics_stats_timeseries_point.py +94 -0
  44. trustcomponent/_generated/models/analytics_stats_totals.py +117 -0
  45. trustcomponent/_generated/models/analytics_website.py +95 -0
  46. trustcomponent/_generated/models/analytics_websites_page.py +102 -0
  47. trustcomponent/_generated/models/captcha_verification_result.py +128 -0
  48. trustcomponent/_generated/models/platform_event.py +136 -0
  49. trustcomponent/_generated/models/platform_event_actor.py +110 -0
  50. trustcomponent/_generated/models/platform_event_actor_automation.py +91 -0
  51. trustcomponent/_generated/models/platform_event_actor_automation_kind_enum.py +38 -0
  52. trustcomponent/_generated/models/platform_event_actor_type_enum.py +40 -0
  53. trustcomponent/_generated/models/platform_event_change.py +107 -0
  54. trustcomponent/_generated/models/platform_event_change_operation_enum.py +40 -0
  55. trustcomponent/_generated/models/platform_event_origin.py +107 -0
  56. trustcomponent/_generated/models/platform_event_ref.py +98 -0
  57. trustcomponent/_generated/models/platform_event_source_enum.py +41 -0
  58. trustcomponent/_generated/models/platform_events_page.py +113 -0
  59. trustcomponent/_generated/models/tax_validation_match_status_enum.py +41 -0
  60. trustcomponent/_generated/models/tax_validation_provider_enum.py +43 -0
  61. trustcomponent/_generated/models/tax_validation_provider_status_enum.py +48 -0
  62. trustcomponent/_generated/models/tax_validation_schedule.py +124 -0
  63. trustcomponent/_generated/models/tax_validation_schedule_create_params.py +135 -0
  64. trustcomponent/_generated/models/tax_validation_tax_address.py +121 -0
  65. trustcomponent/_generated/models/tax_validation_tax_identifier_scheme_enum.py +46 -0
  66. trustcomponent/_generated/models/tax_validation_validation.py +163 -0
  67. trustcomponent/_generated/models/tax_validation_validation_address_match.py +97 -0
  68. trustcomponent/_generated/models/tax_validation_validation_batch_create_params.py +97 -0
  69. trustcomponent/_generated/models/tax_validation_validation_create_params.py +135 -0
  70. trustcomponent/_generated/models/tax_validation_validation_frequency_enum.py +38 -0
  71. trustcomponent/_generated/models/tax_validation_validation_input.py +117 -0
  72. trustcomponent/_generated/models/tax_validation_validation_match.py +97 -0
  73. trustcomponent/_generated/models/tax_validation_validation_mode_enum.py +37 -0
  74. trustcomponent/_generated/models/tax_validation_validation_outcome_enum.py +41 -0
  75. trustcomponent/_generated/models/tax_validation_validation_request_status_enum.py +41 -0
  76. trustcomponent/_generated/models/tax_validation_validation_response_data.py +113 -0
  77. trustcomponent/_generated/models/tax_validation_validation_result.py +146 -0
  78. trustcomponent/_generated/models/tax_validation_validation_schedule_attach_params.py +109 -0
  79. trustcomponent/_generated/models/tax_validation_verification_method_enum.py +37 -0
  80. trustcomponent/_generated/modules.py +42 -0
  81. trustcomponent/_generated/py.typed +0 -0
  82. trustcomponent/_generated/rest.py +313 -0
  83. trustcomponent/_http.py +90 -0
  84. trustcomponent/captcha.py +33 -0
  85. trustcomponent/errors.py +51 -0
  86. trustcomponent-0.0.1b0.dist-info/METADATA +98 -0
  87. trustcomponent-0.0.1b0.dist-info/RECORD +89 -0
  88. trustcomponent-0.0.1b0.dist-info/WHEEL +4 -0
  89. trustcomponent-0.0.1b0.dist-info/licenses/LICENSE.md +21 -0
@@ -0,0 +1,2006 @@
1
+ """
2
+ TrustComponent API
3
+
4
+ The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictStr
19
+ from typing import List, Optional
20
+ from typing_extensions import Annotated
21
+ from uuid import UUID
22
+ from trustcomponent._generated.models.analytics_realtime import AnalyticsRealtime
23
+ from trustcomponent._generated.models.analytics_stats_breakdown import AnalyticsStatsBreakdown
24
+ from trustcomponent._generated.models.analytics_stats_conversions import AnalyticsStatsConversions
25
+ from trustcomponent._generated.models.analytics_stats_dimension_enum import AnalyticsStatsDimensionEnum
26
+ from trustcomponent._generated.models.analytics_stats_filter_match_mode_enum import AnalyticsStatsFilterMatchModeEnum
27
+ from trustcomponent._generated.models.analytics_stats_granularity_enum import AnalyticsStatsGranularityEnum
28
+ from trustcomponent._generated.models.analytics_stats_overview import AnalyticsStatsOverview
29
+ from trustcomponent._generated.models.analytics_stats_timeseries import AnalyticsStatsTimeseries
30
+ from trustcomponent._generated.models.analytics_websites_page import AnalyticsWebsitesPage
31
+
32
+ from trustcomponent._generated.api_client import ApiClient, RequestSerialized
33
+ from trustcomponent._generated.api_response import ApiResponse
34
+ from trustcomponent._generated.rest import RESTResponseType
35
+
36
+
37
+ class AnalyticsWebsitesApi:
38
+ """NOTE: This class is auto generated by OpenAPI Generator
39
+ Ref: https://openapi-generator.tech
40
+
41
+ Do not edit the class manually.
42
+ """
43
+
44
+ def __init__(self, api_client=None) -> None:
45
+ if api_client is None:
46
+ api_client = ApiClient.get_default()
47
+ self.api_client = api_client
48
+
49
+
50
+ @validate_call
51
+ def get_website_realtime(
52
+ self,
53
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
54
+ _request_timeout: Union[
55
+ None,
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Tuple[
58
+ Annotated[StrictFloat, Field(gt=0)],
59
+ Annotated[StrictFloat, Field(gt=0)]
60
+ ]
61
+ ] = None,
62
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
63
+ _content_type: Optional[StrictStr] = None,
64
+ _headers: Optional[Dict[StrictStr, Any]] = None,
65
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
66
+ ) -> AnalyticsRealtime:
67
+ """Returns the visitors active right now
68
+
69
+ Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
70
+
71
+ :param website_id: Id of the website, as listed by GET /websites (required)
72
+ :type website_id: UUID
73
+ :param _request_timeout: timeout setting for this request. If one
74
+ number provided, it will be total request
75
+ timeout. It can also be a pair (tuple) of
76
+ (connection, read) timeouts.
77
+ :type _request_timeout: int, tuple(int, int), optional
78
+ :param _request_auth: set to override the auth_settings for an a single
79
+ request; this effectively ignores the
80
+ authentication in the spec for a single request.
81
+ :type _request_auth: dict, optional
82
+ :param _content_type: force content-type for the request.
83
+ :type _content_type: str, Optional
84
+ :param _headers: set to override the headers for a single
85
+ request; this effectively ignores the headers
86
+ in the spec for a single request.
87
+ :type _headers: dict, optional
88
+ :param _host_index: set to override the host_index for a single
89
+ request; this effectively ignores the host_index
90
+ in the spec for a single request.
91
+ :type _host_index: int, optional
92
+ :return: Returns the result object.
93
+ """ # noqa: E501
94
+
95
+ _param = self._get_website_realtime_serialize(
96
+ website_id=website_id,
97
+ _request_auth=_request_auth,
98
+ _content_type=_content_type,
99
+ _headers=_headers,
100
+ _host_index=_host_index
101
+ )
102
+
103
+ _response_types_map: Dict[str, Optional[str]] = {
104
+ '200': "AnalyticsRealtime",
105
+ '401': None,
106
+ '403': None,
107
+ '404': None,
108
+ '429': None,
109
+ }
110
+ response_data = self.api_client.call_api(
111
+ *_param,
112
+ _request_timeout=_request_timeout
113
+ )
114
+ response_data.read()
115
+ return self.api_client.response_deserialize(
116
+ response_data=response_data,
117
+ response_types_map=_response_types_map,
118
+ ).data
119
+
120
+
121
+ @validate_call
122
+ def get_website_realtime_with_http_info(
123
+ self,
124
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
125
+ _request_timeout: Union[
126
+ None,
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Tuple[
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Annotated[StrictFloat, Field(gt=0)]
131
+ ]
132
+ ] = None,
133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
134
+ _content_type: Optional[StrictStr] = None,
135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
137
+ ) -> ApiResponse[AnalyticsRealtime]:
138
+ """Returns the visitors active right now
139
+
140
+ Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
141
+
142
+ :param website_id: Id of the website, as listed by GET /websites (required)
143
+ :type website_id: UUID
144
+ :param _request_timeout: timeout setting for this request. If one
145
+ number provided, it will be total request
146
+ timeout. It can also be a pair (tuple) of
147
+ (connection, read) timeouts.
148
+ :type _request_timeout: int, tuple(int, int), optional
149
+ :param _request_auth: set to override the auth_settings for an a single
150
+ request; this effectively ignores the
151
+ authentication in the spec for a single request.
152
+ :type _request_auth: dict, optional
153
+ :param _content_type: force content-type for the request.
154
+ :type _content_type: str, Optional
155
+ :param _headers: set to override the headers for a single
156
+ request; this effectively ignores the headers
157
+ in the spec for a single request.
158
+ :type _headers: dict, optional
159
+ :param _host_index: set to override the host_index for a single
160
+ request; this effectively ignores the host_index
161
+ in the spec for a single request.
162
+ :type _host_index: int, optional
163
+ :return: Returns the result object.
164
+ """ # noqa: E501
165
+
166
+ _param = self._get_website_realtime_serialize(
167
+ website_id=website_id,
168
+ _request_auth=_request_auth,
169
+ _content_type=_content_type,
170
+ _headers=_headers,
171
+ _host_index=_host_index
172
+ )
173
+
174
+ _response_types_map: Dict[str, Optional[str]] = {
175
+ '200': "AnalyticsRealtime",
176
+ '401': None,
177
+ '403': None,
178
+ '404': None,
179
+ '429': None,
180
+ }
181
+ response_data = self.api_client.call_api(
182
+ *_param,
183
+ _request_timeout=_request_timeout
184
+ )
185
+ response_data.read()
186
+ return self.api_client.response_deserialize(
187
+ response_data=response_data,
188
+ response_types_map=_response_types_map,
189
+ )
190
+
191
+
192
+ @validate_call
193
+ def get_website_realtime_without_preload_content(
194
+ self,
195
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
196
+ _request_timeout: Union[
197
+ None,
198
+ Annotated[StrictFloat, Field(gt=0)],
199
+ Tuple[
200
+ Annotated[StrictFloat, Field(gt=0)],
201
+ Annotated[StrictFloat, Field(gt=0)]
202
+ ]
203
+ ] = None,
204
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
205
+ _content_type: Optional[StrictStr] = None,
206
+ _headers: Optional[Dict[StrictStr, Any]] = None,
207
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
208
+ ) -> RESTResponseType:
209
+ """Returns the visitors active right now
210
+
211
+ Sessions active in the last five minutes, the pages they are on, and the pageviews of each of the last thirty minutes.
212
+
213
+ :param website_id: Id of the website, as listed by GET /websites (required)
214
+ :type website_id: UUID
215
+ :param _request_timeout: timeout setting for this request. If one
216
+ number provided, it will be total request
217
+ timeout. It can also be a pair (tuple) of
218
+ (connection, read) timeouts.
219
+ :type _request_timeout: int, tuple(int, int), optional
220
+ :param _request_auth: set to override the auth_settings for an a single
221
+ request; this effectively ignores the
222
+ authentication in the spec for a single request.
223
+ :type _request_auth: dict, optional
224
+ :param _content_type: force content-type for the request.
225
+ :type _content_type: str, Optional
226
+ :param _headers: set to override the headers for a single
227
+ request; this effectively ignores the headers
228
+ in the spec for a single request.
229
+ :type _headers: dict, optional
230
+ :param _host_index: set to override the host_index for a single
231
+ request; this effectively ignores the host_index
232
+ in the spec for a single request.
233
+ :type _host_index: int, optional
234
+ :return: Returns the result object.
235
+ """ # noqa: E501
236
+
237
+ _param = self._get_website_realtime_serialize(
238
+ website_id=website_id,
239
+ _request_auth=_request_auth,
240
+ _content_type=_content_type,
241
+ _headers=_headers,
242
+ _host_index=_host_index
243
+ )
244
+
245
+ _response_types_map: Dict[str, Optional[str]] = {
246
+ '200': "AnalyticsRealtime",
247
+ '401': None,
248
+ '403': None,
249
+ '404': None,
250
+ '429': None,
251
+ }
252
+ response_data = self.api_client.call_api(
253
+ *_param,
254
+ _request_timeout=_request_timeout
255
+ )
256
+ return response_data.response
257
+
258
+
259
+ def _get_website_realtime_serialize(
260
+ self,
261
+ website_id,
262
+ _request_auth,
263
+ _content_type,
264
+ _headers,
265
+ _host_index,
266
+ ) -> RequestSerialized:
267
+
268
+ _host = None
269
+
270
+ _collection_formats: Dict[str, str] = {
271
+ }
272
+
273
+ _path_params: Dict[str, str] = {}
274
+ _query_params: List[Tuple[str, str]] = []
275
+ _header_params: Dict[str, Optional[str]] = _headers or {}
276
+ _form_params: List[Tuple[str, str]] = []
277
+ _files: Dict[
278
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
279
+ ] = {}
280
+ _body_params: Optional[bytes] = None
281
+
282
+ # process the path parameters
283
+ if website_id is not None:
284
+ _path_params['websiteId'] = website_id
285
+ # process the query parameters
286
+ # process the header parameters
287
+ # process the form parameters
288
+ # process the body parameter
289
+
290
+
291
+ # set the HTTP header `Accept`
292
+ if 'Accept' not in _header_params:
293
+ _header_params['Accept'] = self.api_client.select_header_accept(
294
+ [
295
+ 'application/json'
296
+ ]
297
+ )
298
+
299
+
300
+ # authentication setting
301
+ _auth_settings: List[str] = [
302
+ 'bearerApiKey'
303
+ ]
304
+
305
+ return self.api_client.param_serialize(
306
+ method='GET',
307
+ resource_path='/analytics/v1/websites/{websiteId}/realtime',
308
+ path_params=_path_params,
309
+ query_params=_query_params,
310
+ header_params=_header_params,
311
+ body=_body_params,
312
+ post_params=_form_params,
313
+ files=_files,
314
+ auth_settings=_auth_settings,
315
+ collection_formats=_collection_formats,
316
+ _host=_host,
317
+ _request_auth=_request_auth
318
+ )
319
+
320
+
321
+
322
+
323
+ @validate_call
324
+ def get_website_stats_breakdowns(
325
+ self,
326
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
327
+ dimension: Annotated[AnalyticsStatsDimensionEnum, Field(description="Dimension the figures are split by")],
328
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
329
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
330
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
331
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
332
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
333
+ _request_timeout: Union[
334
+ None,
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Tuple[
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Annotated[StrictFloat, Field(gt=0)]
339
+ ]
340
+ ] = None,
341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
342
+ _content_type: Optional[StrictStr] = None,
343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
345
+ ) -> AnalyticsStatsBreakdown:
346
+ """Returns the key figures of a website split by one dimension
347
+
348
+ The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
349
+
350
+ :param website_id: Id of the website, as listed by GET /websites (required)
351
+ :type website_id: UUID
352
+ :param dimension: Dimension the figures are split by (required)
353
+ :type dimension: AnalyticsStatsDimensionEnum
354
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
355
+ :type var_from: str
356
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
357
+ :type to: str
358
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
359
+ :type filter: List[str]
360
+ :param page: Zero-based page index
361
+ :type page: int
362
+ :param page_size: Number of entries per page
363
+ :type page_size: int
364
+ :param _request_timeout: timeout setting for this request. If one
365
+ number provided, it will be total request
366
+ timeout. It can also be a pair (tuple) of
367
+ (connection, read) timeouts.
368
+ :type _request_timeout: int, tuple(int, int), optional
369
+ :param _request_auth: set to override the auth_settings for an a single
370
+ request; this effectively ignores the
371
+ authentication in the spec for a single request.
372
+ :type _request_auth: dict, optional
373
+ :param _content_type: force content-type for the request.
374
+ :type _content_type: str, Optional
375
+ :param _headers: set to override the headers for a single
376
+ request; this effectively ignores the headers
377
+ in the spec for a single request.
378
+ :type _headers: dict, optional
379
+ :param _host_index: set to override the host_index for a single
380
+ request; this effectively ignores the host_index
381
+ in the spec for a single request.
382
+ :type _host_index: int, optional
383
+ :return: Returns the result object.
384
+ """ # noqa: E501
385
+
386
+ _param = self._get_website_stats_breakdowns_serialize(
387
+ website_id=website_id,
388
+ dimension=dimension,
389
+ var_from=var_from,
390
+ to=to,
391
+ filter=filter,
392
+ page=page,
393
+ page_size=page_size,
394
+ _request_auth=_request_auth,
395
+ _content_type=_content_type,
396
+ _headers=_headers,
397
+ _host_index=_host_index
398
+ )
399
+
400
+ _response_types_map: Dict[str, Optional[str]] = {
401
+ '200': "AnalyticsStatsBreakdown",
402
+ '400': None,
403
+ '401': None,
404
+ '403': None,
405
+ '404': None,
406
+ '429': None,
407
+ }
408
+ response_data = self.api_client.call_api(
409
+ *_param,
410
+ _request_timeout=_request_timeout
411
+ )
412
+ response_data.read()
413
+ return self.api_client.response_deserialize(
414
+ response_data=response_data,
415
+ response_types_map=_response_types_map,
416
+ ).data
417
+
418
+
419
+ @validate_call
420
+ def get_website_stats_breakdowns_with_http_info(
421
+ self,
422
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
423
+ dimension: Annotated[AnalyticsStatsDimensionEnum, Field(description="Dimension the figures are split by")],
424
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
425
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
426
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
427
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
428
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
429
+ _request_timeout: Union[
430
+ None,
431
+ Annotated[StrictFloat, Field(gt=0)],
432
+ Tuple[
433
+ Annotated[StrictFloat, Field(gt=0)],
434
+ Annotated[StrictFloat, Field(gt=0)]
435
+ ]
436
+ ] = None,
437
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
438
+ _content_type: Optional[StrictStr] = None,
439
+ _headers: Optional[Dict[StrictStr, Any]] = None,
440
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
441
+ ) -> ApiResponse[AnalyticsStatsBreakdown]:
442
+ """Returns the key figures of a website split by one dimension
443
+
444
+ The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
445
+
446
+ :param website_id: Id of the website, as listed by GET /websites (required)
447
+ :type website_id: UUID
448
+ :param dimension: Dimension the figures are split by (required)
449
+ :type dimension: AnalyticsStatsDimensionEnum
450
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
451
+ :type var_from: str
452
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
453
+ :type to: str
454
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
455
+ :type filter: List[str]
456
+ :param page: Zero-based page index
457
+ :type page: int
458
+ :param page_size: Number of entries per page
459
+ :type page_size: int
460
+ :param _request_timeout: timeout setting for this request. If one
461
+ number provided, it will be total request
462
+ timeout. It can also be a pair (tuple) of
463
+ (connection, read) timeouts.
464
+ :type _request_timeout: int, tuple(int, int), optional
465
+ :param _request_auth: set to override the auth_settings for an a single
466
+ request; this effectively ignores the
467
+ authentication in the spec for a single request.
468
+ :type _request_auth: dict, optional
469
+ :param _content_type: force content-type for the request.
470
+ :type _content_type: str, Optional
471
+ :param _headers: set to override the headers for a single
472
+ request; this effectively ignores the headers
473
+ in the spec for a single request.
474
+ :type _headers: dict, optional
475
+ :param _host_index: set to override the host_index for a single
476
+ request; this effectively ignores the host_index
477
+ in the spec for a single request.
478
+ :type _host_index: int, optional
479
+ :return: Returns the result object.
480
+ """ # noqa: E501
481
+
482
+ _param = self._get_website_stats_breakdowns_serialize(
483
+ website_id=website_id,
484
+ dimension=dimension,
485
+ var_from=var_from,
486
+ to=to,
487
+ filter=filter,
488
+ page=page,
489
+ page_size=page_size,
490
+ _request_auth=_request_auth,
491
+ _content_type=_content_type,
492
+ _headers=_headers,
493
+ _host_index=_host_index
494
+ )
495
+
496
+ _response_types_map: Dict[str, Optional[str]] = {
497
+ '200': "AnalyticsStatsBreakdown",
498
+ '400': None,
499
+ '401': None,
500
+ '403': None,
501
+ '404': None,
502
+ '429': None,
503
+ }
504
+ response_data = self.api_client.call_api(
505
+ *_param,
506
+ _request_timeout=_request_timeout
507
+ )
508
+ response_data.read()
509
+ return self.api_client.response_deserialize(
510
+ response_data=response_data,
511
+ response_types_map=_response_types_map,
512
+ )
513
+
514
+
515
+ @validate_call
516
+ def get_website_stats_breakdowns_without_preload_content(
517
+ self,
518
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
519
+ dimension: Annotated[AnalyticsStatsDimensionEnum, Field(description="Dimension the figures are split by")],
520
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
521
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
522
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
523
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
524
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
525
+ _request_timeout: Union[
526
+ None,
527
+ Annotated[StrictFloat, Field(gt=0)],
528
+ Tuple[
529
+ Annotated[StrictFloat, Field(gt=0)],
530
+ Annotated[StrictFloat, Field(gt=0)]
531
+ ]
532
+ ] = None,
533
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
534
+ _content_type: Optional[StrictStr] = None,
535
+ _headers: Optional[Dict[StrictStr, Any]] = None,
536
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
537
+ ) -> RESTResponseType:
538
+ """Returns the key figures of a website split by one dimension
539
+
540
+ The values of one dimension — pages, sources, campaigns, countries, browsers, … — largest first, each with its key figures. Rows of the PATH dimension also carry entrances, exits and time on the page.
541
+
542
+ :param website_id: Id of the website, as listed by GET /websites (required)
543
+ :type website_id: UUID
544
+ :param dimension: Dimension the figures are split by (required)
545
+ :type dimension: AnalyticsStatsDimensionEnum
546
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
547
+ :type var_from: str
548
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
549
+ :type to: str
550
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
551
+ :type filter: List[str]
552
+ :param page: Zero-based page index
553
+ :type page: int
554
+ :param page_size: Number of entries per page
555
+ :type page_size: int
556
+ :param _request_timeout: timeout setting for this request. If one
557
+ number provided, it will be total request
558
+ timeout. It can also be a pair (tuple) of
559
+ (connection, read) timeouts.
560
+ :type _request_timeout: int, tuple(int, int), optional
561
+ :param _request_auth: set to override the auth_settings for an a single
562
+ request; this effectively ignores the
563
+ authentication in the spec for a single request.
564
+ :type _request_auth: dict, optional
565
+ :param _content_type: force content-type for the request.
566
+ :type _content_type: str, Optional
567
+ :param _headers: set to override the headers for a single
568
+ request; this effectively ignores the headers
569
+ in the spec for a single request.
570
+ :type _headers: dict, optional
571
+ :param _host_index: set to override the host_index for a single
572
+ request; this effectively ignores the host_index
573
+ in the spec for a single request.
574
+ :type _host_index: int, optional
575
+ :return: Returns the result object.
576
+ """ # noqa: E501
577
+
578
+ _param = self._get_website_stats_breakdowns_serialize(
579
+ website_id=website_id,
580
+ dimension=dimension,
581
+ var_from=var_from,
582
+ to=to,
583
+ filter=filter,
584
+ page=page,
585
+ page_size=page_size,
586
+ _request_auth=_request_auth,
587
+ _content_type=_content_type,
588
+ _headers=_headers,
589
+ _host_index=_host_index
590
+ )
591
+
592
+ _response_types_map: Dict[str, Optional[str]] = {
593
+ '200': "AnalyticsStatsBreakdown",
594
+ '400': None,
595
+ '401': None,
596
+ '403': None,
597
+ '404': None,
598
+ '429': None,
599
+ }
600
+ response_data = self.api_client.call_api(
601
+ *_param,
602
+ _request_timeout=_request_timeout
603
+ )
604
+ return response_data.response
605
+
606
+
607
+ def _get_website_stats_breakdowns_serialize(
608
+ self,
609
+ website_id,
610
+ dimension,
611
+ var_from,
612
+ to,
613
+ filter,
614
+ page,
615
+ page_size,
616
+ _request_auth,
617
+ _content_type,
618
+ _headers,
619
+ _host_index,
620
+ ) -> RequestSerialized:
621
+
622
+ _host = None
623
+
624
+ _collection_formats: Dict[str, str] = {
625
+ 'filter': 'multi',
626
+ }
627
+
628
+ _path_params: Dict[str, str] = {}
629
+ _query_params: List[Tuple[str, str]] = []
630
+ _header_params: Dict[str, Optional[str]] = _headers or {}
631
+ _form_params: List[Tuple[str, str]] = []
632
+ _files: Dict[
633
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
634
+ ] = {}
635
+ _body_params: Optional[bytes] = None
636
+
637
+ # process the path parameters
638
+ if website_id is not None:
639
+ _path_params['websiteId'] = website_id
640
+ # process the query parameters
641
+ if dimension is not None:
642
+
643
+ _query_params.append(('dimension', dimension.value))
644
+
645
+ if var_from is not None:
646
+
647
+ _query_params.append(('from', var_from))
648
+
649
+ if to is not None:
650
+
651
+ _query_params.append(('to', to))
652
+
653
+ if filter is not None:
654
+
655
+ _query_params.append(('filter', filter))
656
+
657
+ if page is not None:
658
+
659
+ _query_params.append(('page', page))
660
+
661
+ if page_size is not None:
662
+
663
+ _query_params.append(('pageSize', page_size))
664
+
665
+ # process the header parameters
666
+ # process the form parameters
667
+ # process the body parameter
668
+
669
+
670
+ # set the HTTP header `Accept`
671
+ if 'Accept' not in _header_params:
672
+ _header_params['Accept'] = self.api_client.select_header_accept(
673
+ [
674
+ 'application/json'
675
+ ]
676
+ )
677
+
678
+
679
+ # authentication setting
680
+ _auth_settings: List[str] = [
681
+ 'bearerApiKey'
682
+ ]
683
+
684
+ return self.api_client.param_serialize(
685
+ method='GET',
686
+ resource_path='/analytics/v1/websites/{websiteId}/stats/breakdowns',
687
+ path_params=_path_params,
688
+ query_params=_query_params,
689
+ header_params=_header_params,
690
+ body=_body_params,
691
+ post_params=_form_params,
692
+ files=_files,
693
+ auth_settings=_auth_settings,
694
+ collection_formats=_collection_formats,
695
+ _host=_host,
696
+ _request_auth=_request_auth
697
+ )
698
+
699
+
700
+
701
+
702
+ @validate_call
703
+ def get_website_stats_conversions(
704
+ self,
705
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
706
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
707
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
708
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
709
+ filter_match_mode: Annotated[Optional[AnalyticsStatsFilterMatchModeEnum], Field(description="Whether a session has to match all filters or any of them")] = None,
710
+ _request_timeout: Union[
711
+ None,
712
+ Annotated[StrictFloat, Field(gt=0)],
713
+ Tuple[
714
+ Annotated[StrictFloat, Field(gt=0)],
715
+ Annotated[StrictFloat, Field(gt=0)]
716
+ ]
717
+ ] = None,
718
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
719
+ _content_type: Optional[StrictStr] = None,
720
+ _headers: Optional[Dict[StrictStr, Any]] = None,
721
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
722
+ ) -> AnalyticsStatsConversions:
723
+ """Returns the conversions of every goal of a website
724
+
725
+ For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
726
+
727
+ :param website_id: Id of the website, as listed by GET /websites (required)
728
+ :type website_id: UUID
729
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
730
+ :type var_from: str
731
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
732
+ :type to: str
733
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
734
+ :type filter: List[str]
735
+ :param filter_match_mode: Whether a session has to match all filters or any of them
736
+ :type filter_match_mode: AnalyticsStatsFilterMatchModeEnum
737
+ :param _request_timeout: timeout setting for this request. If one
738
+ number provided, it will be total request
739
+ timeout. It can also be a pair (tuple) of
740
+ (connection, read) timeouts.
741
+ :type _request_timeout: int, tuple(int, int), optional
742
+ :param _request_auth: set to override the auth_settings for an a single
743
+ request; this effectively ignores the
744
+ authentication in the spec for a single request.
745
+ :type _request_auth: dict, optional
746
+ :param _content_type: force content-type for the request.
747
+ :type _content_type: str, Optional
748
+ :param _headers: set to override the headers for a single
749
+ request; this effectively ignores the headers
750
+ in the spec for a single request.
751
+ :type _headers: dict, optional
752
+ :param _host_index: set to override the host_index for a single
753
+ request; this effectively ignores the host_index
754
+ in the spec for a single request.
755
+ :type _host_index: int, optional
756
+ :return: Returns the result object.
757
+ """ # noqa: E501
758
+
759
+ _param = self._get_website_stats_conversions_serialize(
760
+ website_id=website_id,
761
+ var_from=var_from,
762
+ to=to,
763
+ filter=filter,
764
+ filter_match_mode=filter_match_mode,
765
+ _request_auth=_request_auth,
766
+ _content_type=_content_type,
767
+ _headers=_headers,
768
+ _host_index=_host_index
769
+ )
770
+
771
+ _response_types_map: Dict[str, Optional[str]] = {
772
+ '200': "AnalyticsStatsConversions",
773
+ '400': None,
774
+ '401': None,
775
+ '403': None,
776
+ '404': None,
777
+ '429': None,
778
+ }
779
+ response_data = self.api_client.call_api(
780
+ *_param,
781
+ _request_timeout=_request_timeout
782
+ )
783
+ response_data.read()
784
+ return self.api_client.response_deserialize(
785
+ response_data=response_data,
786
+ response_types_map=_response_types_map,
787
+ ).data
788
+
789
+
790
+ @validate_call
791
+ def get_website_stats_conversions_with_http_info(
792
+ self,
793
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
794
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
795
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
796
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
797
+ filter_match_mode: Annotated[Optional[AnalyticsStatsFilterMatchModeEnum], Field(description="Whether a session has to match all filters or any of them")] = None,
798
+ _request_timeout: Union[
799
+ None,
800
+ Annotated[StrictFloat, Field(gt=0)],
801
+ Tuple[
802
+ Annotated[StrictFloat, Field(gt=0)],
803
+ Annotated[StrictFloat, Field(gt=0)]
804
+ ]
805
+ ] = None,
806
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
807
+ _content_type: Optional[StrictStr] = None,
808
+ _headers: Optional[Dict[StrictStr, Any]] = None,
809
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
810
+ ) -> ApiResponse[AnalyticsStatsConversions]:
811
+ """Returns the conversions of every goal of a website
812
+
813
+ For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
814
+
815
+ :param website_id: Id of the website, as listed by GET /websites (required)
816
+ :type website_id: UUID
817
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
818
+ :type var_from: str
819
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
820
+ :type to: str
821
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
822
+ :type filter: List[str]
823
+ :param filter_match_mode: Whether a session has to match all filters or any of them
824
+ :type filter_match_mode: AnalyticsStatsFilterMatchModeEnum
825
+ :param _request_timeout: timeout setting for this request. If one
826
+ number provided, it will be total request
827
+ timeout. It can also be a pair (tuple) of
828
+ (connection, read) timeouts.
829
+ :type _request_timeout: int, tuple(int, int), optional
830
+ :param _request_auth: set to override the auth_settings for an a single
831
+ request; this effectively ignores the
832
+ authentication in the spec for a single request.
833
+ :type _request_auth: dict, optional
834
+ :param _content_type: force content-type for the request.
835
+ :type _content_type: str, Optional
836
+ :param _headers: set to override the headers for a single
837
+ request; this effectively ignores the headers
838
+ in the spec for a single request.
839
+ :type _headers: dict, optional
840
+ :param _host_index: set to override the host_index for a single
841
+ request; this effectively ignores the host_index
842
+ in the spec for a single request.
843
+ :type _host_index: int, optional
844
+ :return: Returns the result object.
845
+ """ # noqa: E501
846
+
847
+ _param = self._get_website_stats_conversions_serialize(
848
+ website_id=website_id,
849
+ var_from=var_from,
850
+ to=to,
851
+ filter=filter,
852
+ filter_match_mode=filter_match_mode,
853
+ _request_auth=_request_auth,
854
+ _content_type=_content_type,
855
+ _headers=_headers,
856
+ _host_index=_host_index
857
+ )
858
+
859
+ _response_types_map: Dict[str, Optional[str]] = {
860
+ '200': "AnalyticsStatsConversions",
861
+ '400': None,
862
+ '401': None,
863
+ '403': None,
864
+ '404': None,
865
+ '429': None,
866
+ }
867
+ response_data = self.api_client.call_api(
868
+ *_param,
869
+ _request_timeout=_request_timeout
870
+ )
871
+ response_data.read()
872
+ return self.api_client.response_deserialize(
873
+ response_data=response_data,
874
+ response_types_map=_response_types_map,
875
+ )
876
+
877
+
878
+ @validate_call
879
+ def get_website_stats_conversions_without_preload_content(
880
+ self,
881
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
882
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
883
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
884
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
885
+ filter_match_mode: Annotated[Optional[AnalyticsStatsFilterMatchModeEnum], Field(description="Whether a session has to match all filters or any of them")] = None,
886
+ _request_timeout: Union[
887
+ None,
888
+ Annotated[StrictFloat, Field(gt=0)],
889
+ Tuple[
890
+ Annotated[StrictFloat, Field(gt=0)],
891
+ Annotated[StrictFloat, Field(gt=0)]
892
+ ]
893
+ ] = None,
894
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
895
+ _content_type: Optional[StrictStr] = None,
896
+ _headers: Optional[Dict[StrictStr, Any]] = None,
897
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
898
+ ) -> RESTResponseType:
899
+ """Returns the conversions of every goal of a website
900
+
901
+ For each goal of the website the sessions that reached it, the conversion rate and the revenue of those sessions per currency. Revenue is left out when a filter is set.
902
+
903
+ :param website_id: Id of the website, as listed by GET /websites (required)
904
+ :type website_id: UUID
905
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
906
+ :type var_from: str
907
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
908
+ :type to: str
909
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
910
+ :type filter: List[str]
911
+ :param filter_match_mode: Whether a session has to match all filters or any of them
912
+ :type filter_match_mode: AnalyticsStatsFilterMatchModeEnum
913
+ :param _request_timeout: timeout setting for this request. If one
914
+ number provided, it will be total request
915
+ timeout. It can also be a pair (tuple) of
916
+ (connection, read) timeouts.
917
+ :type _request_timeout: int, tuple(int, int), optional
918
+ :param _request_auth: set to override the auth_settings for an a single
919
+ request; this effectively ignores the
920
+ authentication in the spec for a single request.
921
+ :type _request_auth: dict, optional
922
+ :param _content_type: force content-type for the request.
923
+ :type _content_type: str, Optional
924
+ :param _headers: set to override the headers for a single
925
+ request; this effectively ignores the headers
926
+ in the spec for a single request.
927
+ :type _headers: dict, optional
928
+ :param _host_index: set to override the host_index for a single
929
+ request; this effectively ignores the host_index
930
+ in the spec for a single request.
931
+ :type _host_index: int, optional
932
+ :return: Returns the result object.
933
+ """ # noqa: E501
934
+
935
+ _param = self._get_website_stats_conversions_serialize(
936
+ website_id=website_id,
937
+ var_from=var_from,
938
+ to=to,
939
+ filter=filter,
940
+ filter_match_mode=filter_match_mode,
941
+ _request_auth=_request_auth,
942
+ _content_type=_content_type,
943
+ _headers=_headers,
944
+ _host_index=_host_index
945
+ )
946
+
947
+ _response_types_map: Dict[str, Optional[str]] = {
948
+ '200': "AnalyticsStatsConversions",
949
+ '400': None,
950
+ '401': None,
951
+ '403': None,
952
+ '404': None,
953
+ '429': None,
954
+ }
955
+ response_data = self.api_client.call_api(
956
+ *_param,
957
+ _request_timeout=_request_timeout
958
+ )
959
+ return response_data.response
960
+
961
+
962
+ def _get_website_stats_conversions_serialize(
963
+ self,
964
+ website_id,
965
+ var_from,
966
+ to,
967
+ filter,
968
+ filter_match_mode,
969
+ _request_auth,
970
+ _content_type,
971
+ _headers,
972
+ _host_index,
973
+ ) -> RequestSerialized:
974
+
975
+ _host = None
976
+
977
+ _collection_formats: Dict[str, str] = {
978
+ 'filter': 'multi',
979
+ }
980
+
981
+ _path_params: Dict[str, str] = {}
982
+ _query_params: List[Tuple[str, str]] = []
983
+ _header_params: Dict[str, Optional[str]] = _headers or {}
984
+ _form_params: List[Tuple[str, str]] = []
985
+ _files: Dict[
986
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
987
+ ] = {}
988
+ _body_params: Optional[bytes] = None
989
+
990
+ # process the path parameters
991
+ if website_id is not None:
992
+ _path_params['websiteId'] = website_id
993
+ # process the query parameters
994
+ if var_from is not None:
995
+
996
+ _query_params.append(('from', var_from))
997
+
998
+ if to is not None:
999
+
1000
+ _query_params.append(('to', to))
1001
+
1002
+ if filter is not None:
1003
+
1004
+ _query_params.append(('filter', filter))
1005
+
1006
+ if filter_match_mode is not None:
1007
+
1008
+ _query_params.append(('filterMatchMode', filter_match_mode.value))
1009
+
1010
+ # process the header parameters
1011
+ # process the form parameters
1012
+ # process the body parameter
1013
+
1014
+
1015
+ # set the HTTP header `Accept`
1016
+ if 'Accept' not in _header_params:
1017
+ _header_params['Accept'] = self.api_client.select_header_accept(
1018
+ [
1019
+ 'application/json'
1020
+ ]
1021
+ )
1022
+
1023
+
1024
+ # authentication setting
1025
+ _auth_settings: List[str] = [
1026
+ 'bearerApiKey'
1027
+ ]
1028
+
1029
+ return self.api_client.param_serialize(
1030
+ method='GET',
1031
+ resource_path='/analytics/v1/websites/{websiteId}/stats/conversions',
1032
+ path_params=_path_params,
1033
+ query_params=_query_params,
1034
+ header_params=_header_params,
1035
+ body=_body_params,
1036
+ post_params=_form_params,
1037
+ files=_files,
1038
+ auth_settings=_auth_settings,
1039
+ collection_formats=_collection_formats,
1040
+ _host=_host,
1041
+ _request_auth=_request_auth
1042
+ )
1043
+
1044
+
1045
+
1046
+
1047
+ @validate_call
1048
+ def get_website_stats_overview(
1049
+ self,
1050
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1051
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1052
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1053
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1054
+ _request_timeout: Union[
1055
+ None,
1056
+ Annotated[StrictFloat, Field(gt=0)],
1057
+ Tuple[
1058
+ Annotated[StrictFloat, Field(gt=0)],
1059
+ Annotated[StrictFloat, Field(gt=0)]
1060
+ ]
1061
+ ] = None,
1062
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1063
+ _content_type: Optional[StrictStr] = None,
1064
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1065
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1066
+ ) -> AnalyticsStatsOverview:
1067
+ """Returns the key figures of a website for a time range and the period before it
1068
+
1069
+ Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website's time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
1070
+
1071
+ :param website_id: Id of the website, as listed by GET /websites (required)
1072
+ :type website_id: UUID
1073
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1074
+ :type var_from: str
1075
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1076
+ :type to: str
1077
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1078
+ :type filter: List[str]
1079
+ :param _request_timeout: timeout setting for this request. If one
1080
+ number provided, it will be total request
1081
+ timeout. It can also be a pair (tuple) of
1082
+ (connection, read) timeouts.
1083
+ :type _request_timeout: int, tuple(int, int), optional
1084
+ :param _request_auth: set to override the auth_settings for an a single
1085
+ request; this effectively ignores the
1086
+ authentication in the spec for a single request.
1087
+ :type _request_auth: dict, optional
1088
+ :param _content_type: force content-type for the request.
1089
+ :type _content_type: str, Optional
1090
+ :param _headers: set to override the headers for a single
1091
+ request; this effectively ignores the headers
1092
+ in the spec for a single request.
1093
+ :type _headers: dict, optional
1094
+ :param _host_index: set to override the host_index for a single
1095
+ request; this effectively ignores the host_index
1096
+ in the spec for a single request.
1097
+ :type _host_index: int, optional
1098
+ :return: Returns the result object.
1099
+ """ # noqa: E501
1100
+
1101
+ _param = self._get_website_stats_overview_serialize(
1102
+ website_id=website_id,
1103
+ var_from=var_from,
1104
+ to=to,
1105
+ filter=filter,
1106
+ _request_auth=_request_auth,
1107
+ _content_type=_content_type,
1108
+ _headers=_headers,
1109
+ _host_index=_host_index
1110
+ )
1111
+
1112
+ _response_types_map: Dict[str, Optional[str]] = {
1113
+ '200': "AnalyticsStatsOverview",
1114
+ '400': None,
1115
+ '401': None,
1116
+ '403': None,
1117
+ '404': None,
1118
+ '429': None,
1119
+ }
1120
+ response_data = self.api_client.call_api(
1121
+ *_param,
1122
+ _request_timeout=_request_timeout
1123
+ )
1124
+ response_data.read()
1125
+ return self.api_client.response_deserialize(
1126
+ response_data=response_data,
1127
+ response_types_map=_response_types_map,
1128
+ ).data
1129
+
1130
+
1131
+ @validate_call
1132
+ def get_website_stats_overview_with_http_info(
1133
+ self,
1134
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1135
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1136
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1137
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1138
+ _request_timeout: Union[
1139
+ None,
1140
+ Annotated[StrictFloat, Field(gt=0)],
1141
+ Tuple[
1142
+ Annotated[StrictFloat, Field(gt=0)],
1143
+ Annotated[StrictFloat, Field(gt=0)]
1144
+ ]
1145
+ ] = None,
1146
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1147
+ _content_type: Optional[StrictStr] = None,
1148
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1149
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1150
+ ) -> ApiResponse[AnalyticsStatsOverview]:
1151
+ """Returns the key figures of a website for a time range and the period before it
1152
+
1153
+ Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website's time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
1154
+
1155
+ :param website_id: Id of the website, as listed by GET /websites (required)
1156
+ :type website_id: UUID
1157
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1158
+ :type var_from: str
1159
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1160
+ :type to: str
1161
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1162
+ :type filter: List[str]
1163
+ :param _request_timeout: timeout setting for this request. If one
1164
+ number provided, it will be total request
1165
+ timeout. It can also be a pair (tuple) of
1166
+ (connection, read) timeouts.
1167
+ :type _request_timeout: int, tuple(int, int), optional
1168
+ :param _request_auth: set to override the auth_settings for an a single
1169
+ request; this effectively ignores the
1170
+ authentication in the spec for a single request.
1171
+ :type _request_auth: dict, optional
1172
+ :param _content_type: force content-type for the request.
1173
+ :type _content_type: str, Optional
1174
+ :param _headers: set to override the headers for a single
1175
+ request; this effectively ignores the headers
1176
+ in the spec for a single request.
1177
+ :type _headers: dict, optional
1178
+ :param _host_index: set to override the host_index for a single
1179
+ request; this effectively ignores the host_index
1180
+ in the spec for a single request.
1181
+ :type _host_index: int, optional
1182
+ :return: Returns the result object.
1183
+ """ # noqa: E501
1184
+
1185
+ _param = self._get_website_stats_overview_serialize(
1186
+ website_id=website_id,
1187
+ var_from=var_from,
1188
+ to=to,
1189
+ filter=filter,
1190
+ _request_auth=_request_auth,
1191
+ _content_type=_content_type,
1192
+ _headers=_headers,
1193
+ _host_index=_host_index
1194
+ )
1195
+
1196
+ _response_types_map: Dict[str, Optional[str]] = {
1197
+ '200': "AnalyticsStatsOverview",
1198
+ '400': None,
1199
+ '401': None,
1200
+ '403': None,
1201
+ '404': None,
1202
+ '429': None,
1203
+ }
1204
+ response_data = self.api_client.call_api(
1205
+ *_param,
1206
+ _request_timeout=_request_timeout
1207
+ )
1208
+ response_data.read()
1209
+ return self.api_client.response_deserialize(
1210
+ response_data=response_data,
1211
+ response_types_map=_response_types_map,
1212
+ )
1213
+
1214
+
1215
+ @validate_call
1216
+ def get_website_stats_overview_without_preload_content(
1217
+ self,
1218
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1219
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1220
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1221
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1222
+ _request_timeout: Union[
1223
+ None,
1224
+ Annotated[StrictFloat, Field(gt=0)],
1225
+ Tuple[
1226
+ Annotated[StrictFloat, Field(gt=0)],
1227
+ Annotated[StrictFloat, Field(gt=0)]
1228
+ ]
1229
+ ] = None,
1230
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1231
+ _content_type: Optional[StrictStr] = None,
1232
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1233
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1234
+ ) -> RESTResponseType:
1235
+ """Returns the key figures of a website for a time range and the period before it
1236
+
1237
+ Pageviews, sessions, visitors, events, bounces and engaged time of the range, and the same figures for the comparison period: a range that starts at midnight in the website's time zone moves back by as many calendar days as it covers and keeps its local times (today until now is compared with yesterday until the same time), any other range moves back by its own length. Without a filter the figures come from the aggregates and reach back as far as aggregates are kept; with a filter they are counted from the stored sessions and events and reach back as far as those are kept.
1238
+
1239
+ :param website_id: Id of the website, as listed by GET /websites (required)
1240
+ :type website_id: UUID
1241
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1242
+ :type var_from: str
1243
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1244
+ :type to: str
1245
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1246
+ :type filter: List[str]
1247
+ :param _request_timeout: timeout setting for this request. If one
1248
+ number provided, it will be total request
1249
+ timeout. It can also be a pair (tuple) of
1250
+ (connection, read) timeouts.
1251
+ :type _request_timeout: int, tuple(int, int), optional
1252
+ :param _request_auth: set to override the auth_settings for an a single
1253
+ request; this effectively ignores the
1254
+ authentication in the spec for a single request.
1255
+ :type _request_auth: dict, optional
1256
+ :param _content_type: force content-type for the request.
1257
+ :type _content_type: str, Optional
1258
+ :param _headers: set to override the headers for a single
1259
+ request; this effectively ignores the headers
1260
+ in the spec for a single request.
1261
+ :type _headers: dict, optional
1262
+ :param _host_index: set to override the host_index for a single
1263
+ request; this effectively ignores the host_index
1264
+ in the spec for a single request.
1265
+ :type _host_index: int, optional
1266
+ :return: Returns the result object.
1267
+ """ # noqa: E501
1268
+
1269
+ _param = self._get_website_stats_overview_serialize(
1270
+ website_id=website_id,
1271
+ var_from=var_from,
1272
+ to=to,
1273
+ filter=filter,
1274
+ _request_auth=_request_auth,
1275
+ _content_type=_content_type,
1276
+ _headers=_headers,
1277
+ _host_index=_host_index
1278
+ )
1279
+
1280
+ _response_types_map: Dict[str, Optional[str]] = {
1281
+ '200': "AnalyticsStatsOverview",
1282
+ '400': None,
1283
+ '401': None,
1284
+ '403': None,
1285
+ '404': None,
1286
+ '429': None,
1287
+ }
1288
+ response_data = self.api_client.call_api(
1289
+ *_param,
1290
+ _request_timeout=_request_timeout
1291
+ )
1292
+ return response_data.response
1293
+
1294
+
1295
+ def _get_website_stats_overview_serialize(
1296
+ self,
1297
+ website_id,
1298
+ var_from,
1299
+ to,
1300
+ filter,
1301
+ _request_auth,
1302
+ _content_type,
1303
+ _headers,
1304
+ _host_index,
1305
+ ) -> RequestSerialized:
1306
+
1307
+ _host = None
1308
+
1309
+ _collection_formats: Dict[str, str] = {
1310
+ 'filter': 'multi',
1311
+ }
1312
+
1313
+ _path_params: Dict[str, str] = {}
1314
+ _query_params: List[Tuple[str, str]] = []
1315
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1316
+ _form_params: List[Tuple[str, str]] = []
1317
+ _files: Dict[
1318
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1319
+ ] = {}
1320
+ _body_params: Optional[bytes] = None
1321
+
1322
+ # process the path parameters
1323
+ if website_id is not None:
1324
+ _path_params['websiteId'] = website_id
1325
+ # process the query parameters
1326
+ if var_from is not None:
1327
+
1328
+ _query_params.append(('from', var_from))
1329
+
1330
+ if to is not None:
1331
+
1332
+ _query_params.append(('to', to))
1333
+
1334
+ if filter is not None:
1335
+
1336
+ _query_params.append(('filter', filter))
1337
+
1338
+ # process the header parameters
1339
+ # process the form parameters
1340
+ # process the body parameter
1341
+
1342
+
1343
+ # set the HTTP header `Accept`
1344
+ if 'Accept' not in _header_params:
1345
+ _header_params['Accept'] = self.api_client.select_header_accept(
1346
+ [
1347
+ 'application/json'
1348
+ ]
1349
+ )
1350
+
1351
+
1352
+ # authentication setting
1353
+ _auth_settings: List[str] = [
1354
+ 'bearerApiKey'
1355
+ ]
1356
+
1357
+ return self.api_client.param_serialize(
1358
+ method='GET',
1359
+ resource_path='/analytics/v1/websites/{websiteId}/stats/overview',
1360
+ path_params=_path_params,
1361
+ query_params=_query_params,
1362
+ header_params=_header_params,
1363
+ body=_body_params,
1364
+ post_params=_form_params,
1365
+ files=_files,
1366
+ auth_settings=_auth_settings,
1367
+ collection_formats=_collection_formats,
1368
+ _host=_host,
1369
+ _request_auth=_request_auth
1370
+ )
1371
+
1372
+
1373
+
1374
+
1375
+ @validate_call
1376
+ def get_website_stats_timeseries(
1377
+ self,
1378
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1379
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1380
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1381
+ granularity: Annotated[Optional[AnalyticsStatsGranularityEnum], Field(description="Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day")] = None,
1382
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1383
+ _request_timeout: Union[
1384
+ None,
1385
+ Annotated[StrictFloat, Field(gt=0)],
1386
+ Tuple[
1387
+ Annotated[StrictFloat, Field(gt=0)],
1388
+ Annotated[StrictFloat, Field(gt=0)]
1389
+ ]
1390
+ ] = None,
1391
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1392
+ _content_type: Optional[StrictStr] = None,
1393
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1394
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1395
+ ) -> AnalyticsStatsTimeseries:
1396
+ """Returns the key figures of a website per hour or per day
1397
+
1398
+ One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
1399
+
1400
+ :param website_id: Id of the website, as listed by GET /websites (required)
1401
+ :type website_id: UUID
1402
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1403
+ :type var_from: str
1404
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1405
+ :type to: str
1406
+ :param granularity: Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day
1407
+ :type granularity: AnalyticsStatsGranularityEnum
1408
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1409
+ :type filter: List[str]
1410
+ :param _request_timeout: timeout setting for this request. If one
1411
+ number provided, it will be total request
1412
+ timeout. It can also be a pair (tuple) of
1413
+ (connection, read) timeouts.
1414
+ :type _request_timeout: int, tuple(int, int), optional
1415
+ :param _request_auth: set to override the auth_settings for an a single
1416
+ request; this effectively ignores the
1417
+ authentication in the spec for a single request.
1418
+ :type _request_auth: dict, optional
1419
+ :param _content_type: force content-type for the request.
1420
+ :type _content_type: str, Optional
1421
+ :param _headers: set to override the headers for a single
1422
+ request; this effectively ignores the headers
1423
+ in the spec for a single request.
1424
+ :type _headers: dict, optional
1425
+ :param _host_index: set to override the host_index for a single
1426
+ request; this effectively ignores the host_index
1427
+ in the spec for a single request.
1428
+ :type _host_index: int, optional
1429
+ :return: Returns the result object.
1430
+ """ # noqa: E501
1431
+
1432
+ _param = self._get_website_stats_timeseries_serialize(
1433
+ website_id=website_id,
1434
+ var_from=var_from,
1435
+ to=to,
1436
+ granularity=granularity,
1437
+ filter=filter,
1438
+ _request_auth=_request_auth,
1439
+ _content_type=_content_type,
1440
+ _headers=_headers,
1441
+ _host_index=_host_index
1442
+ )
1443
+
1444
+ _response_types_map: Dict[str, Optional[str]] = {
1445
+ '200': "AnalyticsStatsTimeseries",
1446
+ '400': None,
1447
+ '401': None,
1448
+ '403': None,
1449
+ '404': None,
1450
+ '429': None,
1451
+ }
1452
+ response_data = self.api_client.call_api(
1453
+ *_param,
1454
+ _request_timeout=_request_timeout
1455
+ )
1456
+ response_data.read()
1457
+ return self.api_client.response_deserialize(
1458
+ response_data=response_data,
1459
+ response_types_map=_response_types_map,
1460
+ ).data
1461
+
1462
+
1463
+ @validate_call
1464
+ def get_website_stats_timeseries_with_http_info(
1465
+ self,
1466
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1467
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1468
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1469
+ granularity: Annotated[Optional[AnalyticsStatsGranularityEnum], Field(description="Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day")] = None,
1470
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1471
+ _request_timeout: Union[
1472
+ None,
1473
+ Annotated[StrictFloat, Field(gt=0)],
1474
+ Tuple[
1475
+ Annotated[StrictFloat, Field(gt=0)],
1476
+ Annotated[StrictFloat, Field(gt=0)]
1477
+ ]
1478
+ ] = None,
1479
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1480
+ _content_type: Optional[StrictStr] = None,
1481
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1482
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1483
+ ) -> ApiResponse[AnalyticsStatsTimeseries]:
1484
+ """Returns the key figures of a website per hour or per day
1485
+
1486
+ One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
1487
+
1488
+ :param website_id: Id of the website, as listed by GET /websites (required)
1489
+ :type website_id: UUID
1490
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1491
+ :type var_from: str
1492
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1493
+ :type to: str
1494
+ :param granularity: Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day
1495
+ :type granularity: AnalyticsStatsGranularityEnum
1496
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1497
+ :type filter: List[str]
1498
+ :param _request_timeout: timeout setting for this request. If one
1499
+ number provided, it will be total request
1500
+ timeout. It can also be a pair (tuple) of
1501
+ (connection, read) timeouts.
1502
+ :type _request_timeout: int, tuple(int, int), optional
1503
+ :param _request_auth: set to override the auth_settings for an a single
1504
+ request; this effectively ignores the
1505
+ authentication in the spec for a single request.
1506
+ :type _request_auth: dict, optional
1507
+ :param _content_type: force content-type for the request.
1508
+ :type _content_type: str, Optional
1509
+ :param _headers: set to override the headers for a single
1510
+ request; this effectively ignores the headers
1511
+ in the spec for a single request.
1512
+ :type _headers: dict, optional
1513
+ :param _host_index: set to override the host_index for a single
1514
+ request; this effectively ignores the host_index
1515
+ in the spec for a single request.
1516
+ :type _host_index: int, optional
1517
+ :return: Returns the result object.
1518
+ """ # noqa: E501
1519
+
1520
+ _param = self._get_website_stats_timeseries_serialize(
1521
+ website_id=website_id,
1522
+ var_from=var_from,
1523
+ to=to,
1524
+ granularity=granularity,
1525
+ filter=filter,
1526
+ _request_auth=_request_auth,
1527
+ _content_type=_content_type,
1528
+ _headers=_headers,
1529
+ _host_index=_host_index
1530
+ )
1531
+
1532
+ _response_types_map: Dict[str, Optional[str]] = {
1533
+ '200': "AnalyticsStatsTimeseries",
1534
+ '400': None,
1535
+ '401': None,
1536
+ '403': None,
1537
+ '404': None,
1538
+ '429': None,
1539
+ }
1540
+ response_data = self.api_client.call_api(
1541
+ *_param,
1542
+ _request_timeout=_request_timeout
1543
+ )
1544
+ response_data.read()
1545
+ return self.api_client.response_deserialize(
1546
+ response_data=response_data,
1547
+ response_types_map=_response_types_map,
1548
+ )
1549
+
1550
+
1551
+ @validate_call
1552
+ def get_website_stats_timeseries_without_preload_content(
1553
+ self,
1554
+ website_id: Annotated[UUID, Field(description="Id of the website, as listed by GET /websites")],
1555
+ var_from: Annotated[StrictStr, Field(description="Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used")],
1556
+ to: Annotated[StrictStr, Field(description="End of the range, exclusive, as an ISO 8601 timestamp in UTC")],
1557
+ granularity: Annotated[Optional[AnalyticsStatsGranularityEnum], Field(description="Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day")] = None,
1558
+ filter: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=20)]], Field(description="Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1. ")] = None,
1559
+ _request_timeout: Union[
1560
+ None,
1561
+ Annotated[StrictFloat, Field(gt=0)],
1562
+ Tuple[
1563
+ Annotated[StrictFloat, Field(gt=0)],
1564
+ Annotated[StrictFloat, Field(gt=0)]
1565
+ ]
1566
+ ] = None,
1567
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1568
+ _content_type: Optional[StrictStr] = None,
1569
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1570
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1571
+ ) -> RESTResponseType:
1572
+ """Returns the key figures of a website per hour or per day
1573
+
1574
+ One point per hour or per day of the range, empty buckets included as zero. Days start at midnight in the time zone of the website. Without a granularity, ranges up to three days come per hour and longer ones per day; a series has at most 1,000 points.
1575
+
1576
+ :param website_id: Id of the website, as listed by GET /websites (required)
1577
+ :type website_id: UUID
1578
+ :param var_from: Start of the range, inclusive, as an ISO 8601 timestamp in UTC. A start inside an hour, or for ranges longer than 72 hours inside a day of the website's time zone, moves forward to the next full hour or midnight; the response names the range that was used (required)
1579
+ :type var_from: str
1580
+ :param to: End of the range, exclusive, as an ISO 8601 timestamp in UTC (required)
1581
+ :type to: str
1582
+ :param granularity: Size of one point of the series; without it, ranges up to three days come per hour and longer ones per day
1583
+ :type granularity: AnalyticsStatsGranularityEnum
1584
+ :param filter: Filter written as `dimension:operator:value`, for example `PATH:STARTS_WITH:/blog` or `COUNTRY:IS:DE`; the parameter may be repeated. Filters on different dimensions must all match, filters on the same dimension are alternatives. Dimensions are those of StatsDimensionEnumV1, operators those of StatsFilterOperatorEnumV1.
1585
+ :type filter: List[str]
1586
+ :param _request_timeout: timeout setting for this request. If one
1587
+ number provided, it will be total request
1588
+ timeout. It can also be a pair (tuple) of
1589
+ (connection, read) timeouts.
1590
+ :type _request_timeout: int, tuple(int, int), optional
1591
+ :param _request_auth: set to override the auth_settings for an a single
1592
+ request; this effectively ignores the
1593
+ authentication in the spec for a single request.
1594
+ :type _request_auth: dict, optional
1595
+ :param _content_type: force content-type for the request.
1596
+ :type _content_type: str, Optional
1597
+ :param _headers: set to override the headers for a single
1598
+ request; this effectively ignores the headers
1599
+ in the spec for a single request.
1600
+ :type _headers: dict, optional
1601
+ :param _host_index: set to override the host_index for a single
1602
+ request; this effectively ignores the host_index
1603
+ in the spec for a single request.
1604
+ :type _host_index: int, optional
1605
+ :return: Returns the result object.
1606
+ """ # noqa: E501
1607
+
1608
+ _param = self._get_website_stats_timeseries_serialize(
1609
+ website_id=website_id,
1610
+ var_from=var_from,
1611
+ to=to,
1612
+ granularity=granularity,
1613
+ filter=filter,
1614
+ _request_auth=_request_auth,
1615
+ _content_type=_content_type,
1616
+ _headers=_headers,
1617
+ _host_index=_host_index
1618
+ )
1619
+
1620
+ _response_types_map: Dict[str, Optional[str]] = {
1621
+ '200': "AnalyticsStatsTimeseries",
1622
+ '400': None,
1623
+ '401': None,
1624
+ '403': None,
1625
+ '404': None,
1626
+ '429': None,
1627
+ }
1628
+ response_data = self.api_client.call_api(
1629
+ *_param,
1630
+ _request_timeout=_request_timeout
1631
+ )
1632
+ return response_data.response
1633
+
1634
+
1635
+ def _get_website_stats_timeseries_serialize(
1636
+ self,
1637
+ website_id,
1638
+ var_from,
1639
+ to,
1640
+ granularity,
1641
+ filter,
1642
+ _request_auth,
1643
+ _content_type,
1644
+ _headers,
1645
+ _host_index,
1646
+ ) -> RequestSerialized:
1647
+
1648
+ _host = None
1649
+
1650
+ _collection_formats: Dict[str, str] = {
1651
+ 'filter': 'multi',
1652
+ }
1653
+
1654
+ _path_params: Dict[str, str] = {}
1655
+ _query_params: List[Tuple[str, str]] = []
1656
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1657
+ _form_params: List[Tuple[str, str]] = []
1658
+ _files: Dict[
1659
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1660
+ ] = {}
1661
+ _body_params: Optional[bytes] = None
1662
+
1663
+ # process the path parameters
1664
+ if website_id is not None:
1665
+ _path_params['websiteId'] = website_id
1666
+ # process the query parameters
1667
+ if var_from is not None:
1668
+
1669
+ _query_params.append(('from', var_from))
1670
+
1671
+ if to is not None:
1672
+
1673
+ _query_params.append(('to', to))
1674
+
1675
+ if granularity is not None:
1676
+
1677
+ _query_params.append(('granularity', granularity.value))
1678
+
1679
+ if filter is not None:
1680
+
1681
+ _query_params.append(('filter', filter))
1682
+
1683
+ # process the header parameters
1684
+ # process the form parameters
1685
+ # process the body parameter
1686
+
1687
+
1688
+ # set the HTTP header `Accept`
1689
+ if 'Accept' not in _header_params:
1690
+ _header_params['Accept'] = self.api_client.select_header_accept(
1691
+ [
1692
+ 'application/json'
1693
+ ]
1694
+ )
1695
+
1696
+
1697
+ # authentication setting
1698
+ _auth_settings: List[str] = [
1699
+ 'bearerApiKey'
1700
+ ]
1701
+
1702
+ return self.api_client.param_serialize(
1703
+ method='GET',
1704
+ resource_path='/analytics/v1/websites/{websiteId}/stats/timeseries',
1705
+ path_params=_path_params,
1706
+ query_params=_query_params,
1707
+ header_params=_header_params,
1708
+ body=_body_params,
1709
+ post_params=_form_params,
1710
+ files=_files,
1711
+ auth_settings=_auth_settings,
1712
+ collection_formats=_collection_formats,
1713
+ _host=_host,
1714
+ _request_auth=_request_auth
1715
+ )
1716
+
1717
+
1718
+
1719
+
1720
+ @validate_call
1721
+ def get_websites(
1722
+ self,
1723
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
1724
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
1725
+ _request_timeout: Union[
1726
+ None,
1727
+ Annotated[StrictFloat, Field(gt=0)],
1728
+ Tuple[
1729
+ Annotated[StrictFloat, Field(gt=0)],
1730
+ Annotated[StrictFloat, Field(gt=0)]
1731
+ ]
1732
+ ] = None,
1733
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1734
+ _content_type: Optional[StrictStr] = None,
1735
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1736
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1737
+ ) -> AnalyticsWebsitesPage:
1738
+ """Lists the websites of the subscription of the API key
1739
+
1740
+ Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
1741
+
1742
+ :param page: Zero-based page index
1743
+ :type page: int
1744
+ :param page_size: Number of entries per page
1745
+ :type page_size: int
1746
+ :param _request_timeout: timeout setting for this request. If one
1747
+ number provided, it will be total request
1748
+ timeout. It can also be a pair (tuple) of
1749
+ (connection, read) timeouts.
1750
+ :type _request_timeout: int, tuple(int, int), optional
1751
+ :param _request_auth: set to override the auth_settings for an a single
1752
+ request; this effectively ignores the
1753
+ authentication in the spec for a single request.
1754
+ :type _request_auth: dict, optional
1755
+ :param _content_type: force content-type for the request.
1756
+ :type _content_type: str, Optional
1757
+ :param _headers: set to override the headers for a single
1758
+ request; this effectively ignores the headers
1759
+ in the spec for a single request.
1760
+ :type _headers: dict, optional
1761
+ :param _host_index: set to override the host_index for a single
1762
+ request; this effectively ignores the host_index
1763
+ in the spec for a single request.
1764
+ :type _host_index: int, optional
1765
+ :return: Returns the result object.
1766
+ """ # noqa: E501
1767
+
1768
+ _param = self._get_websites_serialize(
1769
+ page=page,
1770
+ page_size=page_size,
1771
+ _request_auth=_request_auth,
1772
+ _content_type=_content_type,
1773
+ _headers=_headers,
1774
+ _host_index=_host_index
1775
+ )
1776
+
1777
+ _response_types_map: Dict[str, Optional[str]] = {
1778
+ '200': "AnalyticsWebsitesPage",
1779
+ '401': None,
1780
+ '403': None,
1781
+ '429': None,
1782
+ }
1783
+ response_data = self.api_client.call_api(
1784
+ *_param,
1785
+ _request_timeout=_request_timeout
1786
+ )
1787
+ response_data.read()
1788
+ return self.api_client.response_deserialize(
1789
+ response_data=response_data,
1790
+ response_types_map=_response_types_map,
1791
+ ).data
1792
+
1793
+
1794
+ @validate_call
1795
+ def get_websites_with_http_info(
1796
+ self,
1797
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
1798
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
1799
+ _request_timeout: Union[
1800
+ None,
1801
+ Annotated[StrictFloat, Field(gt=0)],
1802
+ Tuple[
1803
+ Annotated[StrictFloat, Field(gt=0)],
1804
+ Annotated[StrictFloat, Field(gt=0)]
1805
+ ]
1806
+ ] = None,
1807
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1808
+ _content_type: Optional[StrictStr] = None,
1809
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1810
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1811
+ ) -> ApiResponse[AnalyticsWebsitesPage]:
1812
+ """Lists the websites of the subscription of the API key
1813
+
1814
+ Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
1815
+
1816
+ :param page: Zero-based page index
1817
+ :type page: int
1818
+ :param page_size: Number of entries per page
1819
+ :type page_size: int
1820
+ :param _request_timeout: timeout setting for this request. If one
1821
+ number provided, it will be total request
1822
+ timeout. It can also be a pair (tuple) of
1823
+ (connection, read) timeouts.
1824
+ :type _request_timeout: int, tuple(int, int), optional
1825
+ :param _request_auth: set to override the auth_settings for an a single
1826
+ request; this effectively ignores the
1827
+ authentication in the spec for a single request.
1828
+ :type _request_auth: dict, optional
1829
+ :param _content_type: force content-type for the request.
1830
+ :type _content_type: str, Optional
1831
+ :param _headers: set to override the headers for a single
1832
+ request; this effectively ignores the headers
1833
+ in the spec for a single request.
1834
+ :type _headers: dict, optional
1835
+ :param _host_index: set to override the host_index for a single
1836
+ request; this effectively ignores the host_index
1837
+ in the spec for a single request.
1838
+ :type _host_index: int, optional
1839
+ :return: Returns the result object.
1840
+ """ # noqa: E501
1841
+
1842
+ _param = self._get_websites_serialize(
1843
+ page=page,
1844
+ page_size=page_size,
1845
+ _request_auth=_request_auth,
1846
+ _content_type=_content_type,
1847
+ _headers=_headers,
1848
+ _host_index=_host_index
1849
+ )
1850
+
1851
+ _response_types_map: Dict[str, Optional[str]] = {
1852
+ '200': "AnalyticsWebsitesPage",
1853
+ '401': None,
1854
+ '403': None,
1855
+ '429': None,
1856
+ }
1857
+ response_data = self.api_client.call_api(
1858
+ *_param,
1859
+ _request_timeout=_request_timeout
1860
+ )
1861
+ response_data.read()
1862
+ return self.api_client.response_deserialize(
1863
+ response_data=response_data,
1864
+ response_types_map=_response_types_map,
1865
+ )
1866
+
1867
+
1868
+ @validate_call
1869
+ def get_websites_without_preload_content(
1870
+ self,
1871
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Zero-based page index")] = None,
1872
+ page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of entries per page")] = None,
1873
+ _request_timeout: Union[
1874
+ None,
1875
+ Annotated[StrictFloat, Field(gt=0)],
1876
+ Tuple[
1877
+ Annotated[StrictFloat, Field(gt=0)],
1878
+ Annotated[StrictFloat, Field(gt=0)]
1879
+ ]
1880
+ ] = None,
1881
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1882
+ _content_type: Optional[StrictStr] = None,
1883
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1884
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1885
+ ) -> RESTResponseType:
1886
+ """Lists the websites of the subscription of the API key
1887
+
1888
+ Every website of the project the API key belongs to, oldest first, with the id the statistics endpoints take.
1889
+
1890
+ :param page: Zero-based page index
1891
+ :type page: int
1892
+ :param page_size: Number of entries per page
1893
+ :type page_size: int
1894
+ :param _request_timeout: timeout setting for this request. If one
1895
+ number provided, it will be total request
1896
+ timeout. It can also be a pair (tuple) of
1897
+ (connection, read) timeouts.
1898
+ :type _request_timeout: int, tuple(int, int), optional
1899
+ :param _request_auth: set to override the auth_settings for an a single
1900
+ request; this effectively ignores the
1901
+ authentication in the spec for a single request.
1902
+ :type _request_auth: dict, optional
1903
+ :param _content_type: force content-type for the request.
1904
+ :type _content_type: str, Optional
1905
+ :param _headers: set to override the headers for a single
1906
+ request; this effectively ignores the headers
1907
+ in the spec for a single request.
1908
+ :type _headers: dict, optional
1909
+ :param _host_index: set to override the host_index for a single
1910
+ request; this effectively ignores the host_index
1911
+ in the spec for a single request.
1912
+ :type _host_index: int, optional
1913
+ :return: Returns the result object.
1914
+ """ # noqa: E501
1915
+
1916
+ _param = self._get_websites_serialize(
1917
+ page=page,
1918
+ page_size=page_size,
1919
+ _request_auth=_request_auth,
1920
+ _content_type=_content_type,
1921
+ _headers=_headers,
1922
+ _host_index=_host_index
1923
+ )
1924
+
1925
+ _response_types_map: Dict[str, Optional[str]] = {
1926
+ '200': "AnalyticsWebsitesPage",
1927
+ '401': None,
1928
+ '403': None,
1929
+ '429': None,
1930
+ }
1931
+ response_data = self.api_client.call_api(
1932
+ *_param,
1933
+ _request_timeout=_request_timeout
1934
+ )
1935
+ return response_data.response
1936
+
1937
+
1938
+ def _get_websites_serialize(
1939
+ self,
1940
+ page,
1941
+ page_size,
1942
+ _request_auth,
1943
+ _content_type,
1944
+ _headers,
1945
+ _host_index,
1946
+ ) -> RequestSerialized:
1947
+
1948
+ _host = None
1949
+
1950
+ _collection_formats: Dict[str, str] = {
1951
+ }
1952
+
1953
+ _path_params: Dict[str, str] = {}
1954
+ _query_params: List[Tuple[str, str]] = []
1955
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1956
+ _form_params: List[Tuple[str, str]] = []
1957
+ _files: Dict[
1958
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1959
+ ] = {}
1960
+ _body_params: Optional[bytes] = None
1961
+
1962
+ # process the path parameters
1963
+ # process the query parameters
1964
+ if page is not None:
1965
+
1966
+ _query_params.append(('page', page))
1967
+
1968
+ if page_size is not None:
1969
+
1970
+ _query_params.append(('pageSize', page_size))
1971
+
1972
+ # process the header parameters
1973
+ # process the form parameters
1974
+ # process the body parameter
1975
+
1976
+
1977
+ # set the HTTP header `Accept`
1978
+ if 'Accept' not in _header_params:
1979
+ _header_params['Accept'] = self.api_client.select_header_accept(
1980
+ [
1981
+ 'application/json'
1982
+ ]
1983
+ )
1984
+
1985
+
1986
+ # authentication setting
1987
+ _auth_settings: List[str] = [
1988
+ 'bearerApiKey'
1989
+ ]
1990
+
1991
+ return self.api_client.param_serialize(
1992
+ method='GET',
1993
+ resource_path='/analytics/v1/websites',
1994
+ path_params=_path_params,
1995
+ query_params=_query_params,
1996
+ header_params=_header_params,
1997
+ body=_body_params,
1998
+ post_params=_form_params,
1999
+ files=_files,
2000
+ auth_settings=_auth_settings,
2001
+ collection_formats=_collection_formats,
2002
+ _host=_host,
2003
+ _request_auth=_request_auth
2004
+ )
2005
+
2006
+