scrapely-client-python 3.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of scrapely-client-python might be problematic. Click here for more details.

Files changed (65) hide show
  1. scrapely_client/__init__.py +30 -0
  2. scrapely_client/_charging.py +186 -0
  3. scrapely_client/_client_registry.py +136 -0
  4. scrapely_client/_consts.py +96 -0
  5. scrapely_client/_docs.py +37 -0
  6. scrapely_client/_literals.py +539 -0
  7. scrapely_client/_logging.py +180 -0
  8. scrapely_client/_models.py +4172 -0
  9. scrapely_client/_pagination.py +220 -0
  10. scrapely_client/_resource_clients/__init__.py +84 -0
  11. scrapely_client/_resource_clients/_resource_client.py +567 -0
  12. scrapely_client/_resource_clients/actor.py +1042 -0
  13. scrapely_client/_resource_clients/actor_collection.py +377 -0
  14. scrapely_client/_resource_clients/actor_env_var.py +154 -0
  15. scrapely_client/_resource_clients/actor_env_var_collection.py +165 -0
  16. scrapely_client/_resource_clients/actor_version.py +254 -0
  17. scrapely_client/_resource_clients/actor_version_collection.py +232 -0
  18. scrapely_client/_resource_clients/build.py +244 -0
  19. scrapely_client/_resource_clients/build_collection.py +164 -0
  20. scrapely_client/_resource_clients/dataset.py +1151 -0
  21. scrapely_client/_resource_clients/dataset_collection.py +244 -0
  22. scrapely_client/_resource_clients/key_value_store.py +906 -0
  23. scrapely_client/_resource_clients/key_value_store_collection.py +243 -0
  24. scrapely_client/_resource_clients/log.py +225 -0
  25. scrapely_client/_resource_clients/request_queue.py +1167 -0
  26. scrapely_client/_resource_clients/request_queue_collection.py +240 -0
  27. scrapely_client/_resource_clients/run.py +875 -0
  28. scrapely_client/_resource_clients/run_collection.py +226 -0
  29. scrapely_client/_resource_clients/schedule.py +243 -0
  30. scrapely_client/_resource_clients/schedule_collection.py +260 -0
  31. scrapely_client/_resource_clients/store_collection.py +242 -0
  32. scrapely_client/_resource_clients/task.py +793 -0
  33. scrapely_client/_resource_clients/task_collection.py +322 -0
  34. scrapely_client/_resource_clients/user.py +262 -0
  35. scrapely_client/_resource_clients/webhook.py +292 -0
  36. scrapely_client/_resource_clients/webhook_collection.py +281 -0
  37. scrapely_client/_resource_clients/webhook_dispatch.py +84 -0
  38. scrapely_client/_resource_clients/webhook_dispatch_collection.py +158 -0
  39. scrapely_client/_scrapely_client.py +837 -0
  40. scrapely_client/_statistics.py +29 -0
  41. scrapely_client/_status_message_watcher.py +197 -0
  42. scrapely_client/_streamed_log.py +250 -0
  43. scrapely_client/_typeddicts.py +408 -0
  44. scrapely_client/_utils/__init__.py +0 -0
  45. scrapely_client/_utils/crypto.py +87 -0
  46. scrapely_client/_utils/encoding.py +133 -0
  47. scrapely_client/_utils/errors.py +33 -0
  48. scrapely_client/_utils/http.py +137 -0
  49. scrapely_client/_utils/time.py +32 -0
  50. scrapely_client/_utils/try_import.py +61 -0
  51. scrapely_client/errors.py +190 -0
  52. scrapely_client/http_clients/__init__.py +10 -0
  53. scrapely_client/http_clients/_base.py +430 -0
  54. scrapely_client/http_clients/_impit.py +598 -0
  55. scrapely_client/http_compressors/__init__.py +18 -0
  56. scrapely_client/http_compressors/_base.py +25 -0
  57. scrapely_client/http_compressors/_brotli.py +38 -0
  58. scrapely_client/http_compressors/_gzip.py +38 -0
  59. scrapely_client/http_compressors/_resolve.py +38 -0
  60. scrapely_client/py.typed +0 -0
  61. scrapely_client/types.py +52 -0
  62. scrapely_client_python-3.1.3.dist-info/METADATA +269 -0
  63. scrapely_client_python-3.1.3.dist-info/RECORD +65 -0
  64. scrapely_client_python-3.1.3.dist-info/WHEEL +4 -0
  65. scrapely_client_python-3.1.3.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,4172 @@
1
+ # generated by datamodel-codegen
2
+
3
+ from __future__ import annotations
4
+
5
+ from enum import Enum
6
+ from typing import Annotated, Any, Literal
7
+
8
+ from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, EmailStr, Field, RootModel
9
+ from pydantic.alias_generators import to_camel
10
+
11
+ from scrapely_client._docs import docs_group
12
+ from scrapely_client._literals import (
13
+ ActorJobStatus,
14
+ ActorPermissionLevel,
15
+ ErrorType,
16
+ GeneralAccess,
17
+ HttpMethod,
18
+ RunOrigin,
19
+ SourceCodeFileFormat,
20
+ VersionSourceType,
21
+ WebhookDispatchStatus,
22
+ WebhookEventType,
23
+ )
24
+
25
+
26
+ @docs_group('Models')
27
+ class AccountLimits(BaseModel):
28
+ model_config = ConfigDict(
29
+ extra='allow',
30
+ populate_by_name=True,
31
+ alias_generator=to_camel,
32
+ )
33
+ monthly_usage_cycle: UsageCycle
34
+ limits: Limits
35
+ current: Current
36
+
37
+
38
+ @docs_group('Models')
39
+ class ActVersion(BaseModel):
40
+ """Snapshot of the Actor version that this build was created from."""
41
+
42
+ model_config = ConfigDict(
43
+ extra='allow',
44
+ populate_by_name=True,
45
+ alias_generator=to_camel,
46
+ )
47
+ source_type: VersionSourceType | None = None
48
+ build_tag: Annotated[str | None, Field(examples=['experimental'])] = None
49
+ version_number: Annotated[
50
+ str | None, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[0-9]+)?$')
51
+ ] = None
52
+ git_repo_url: Annotated[
53
+ str | None, Field(examples=['https://github.com/apifytech/actor-crawler.git#experimental:web-scraper'])
54
+ ] = None
55
+ """
56
+ URL of the git repository, present when sourceType is GIT_REPO.
57
+ """
58
+ source_files: list[SourceCodeFile] | None = None
59
+ """
60
+ Inline source files, present when sourceType is SOURCE_FILES.
61
+ """
62
+
63
+
64
+ @docs_group('Models')
65
+ class Actor(BaseModel):
66
+ model_config = ConfigDict(
67
+ extra='allow',
68
+ populate_by_name=True,
69
+ alias_generator=to_camel,
70
+ )
71
+ id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
72
+ """
73
+ The ID of the Actor.
74
+ """
75
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
76
+ """
77
+ The ID of the user who owns the Actor.
78
+ """
79
+ name: Annotated[str, Field(examples=['google-search-extractor'])]
80
+ """
81
+ The name of the Actor.
82
+ """
83
+ username: Annotated[str, Field(examples=['compass'])]
84
+ """
85
+ The username of the Actor owner.
86
+ """
87
+ description: Annotated[str | None, Field(examples=['Extract data from hundreds of places fast.'])] = None
88
+ """
89
+ Short description of the Actor, displayed in Scrapely Store and Console.
90
+ """
91
+ restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
92
+ is_public: Annotated[bool, Field(examples=[False])]
93
+ """
94
+ Whether the Actor is available to users in Scrapely Store.
95
+ """
96
+ actor_permission_level: ActorPermissionLevel | None = None
97
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-07-08T11:27:57.401Z'])]
98
+ """
99
+ The date and time the Actor was created. Follows the ISO 8601 format.
100
+ """
101
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-07-08T14:01:05.546Z'])]
102
+ """
103
+ The date and time the Actor was last modified. Follows the ISO 8601 format.
104
+ """
105
+ stats: ActorStats
106
+ versions: list[Version]
107
+ """
108
+ An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
109
+ """
110
+ pricing_infos: (
111
+ list[
112
+ Annotated[
113
+ PayPerEventActorPricingInfo
114
+ | PricePerDatasetItemActorPricingInfo
115
+ | FlatPricePerMonthActorPricingInfo
116
+ | FreeActorPricingInfo,
117
+ Field(discriminator='pricing_model'),
118
+ ]
119
+ ]
120
+ | None
121
+ ) = None
122
+ default_run_options: DefaultRunOptions
123
+ example_run_input: ExampleRunInput | None = None
124
+ is_deprecated: Annotated[bool | None, Field(examples=[False])] = None
125
+ """
126
+ Whether the Actor is deprecated.
127
+ """
128
+ deployment_key: Annotated[str | None, Field(examples=['ssh-rsa AAAA ...'])] = None
129
+ """
130
+ The Actor's public SSH key, used as a deployment key for private Git repositories.
131
+ """
132
+ title: Annotated[str | None, Field(examples=['Google Search Extractor'])] = None
133
+ """
134
+ Human-readable name of the Actor, displayed in Scrapely Store and Console.
135
+ """
136
+ tagged_builds: dict[str, TaggedBuildInfo | None] | None = None
137
+ actor_standby: ActorStandby | None = None
138
+ readme_summary: str | None = None
139
+ """
140
+ An AI-generated Markdown summary of the Actor's README, optimized for search and AI agents. Contains an overview and a list of use cases. Generated only for public Actors.
141
+ """
142
+ seo_title: Annotated[str | None, Field(examples=['Web Scraper'])] = None
143
+ """
144
+ Name of the Actor to display by search engines such as Google. Can be different from the Actor's name displayed in Scrapely Store and Console.
145
+ """
146
+ seo_description: Annotated[
147
+ str | None, Field(examples=['Crawls websites using Chrome and extracts data from pages using JavaScript.'])
148
+ ] = None
149
+ """
150
+ Description of the Actor to display by search engines such as Google.
151
+ """
152
+ picture_url: Annotated[
153
+ str | None, Field(examples=['https://apify-image-uploads-prod.s3.amazonaws.com/.../actor-picture.png'])
154
+ ] = None
155
+ """
156
+ URL of the Actor's icon, displayed on the Actor's page in Scrapely Store and Console.
157
+ """
158
+ standby_url: Annotated[str | None, Field(examples=['https://jane35--my-actor.apify.actor'])] = None
159
+ """
160
+ URL for sending requests to the Actor in Standby mode.
161
+ `null` if the Standby mode isn't enabled.
162
+
163
+ """
164
+ notice: ActorNotice | None = None
165
+ categories: Annotated[list[str] | None, Field(examples=[['DEVELOPER_TOOLS', 'OPEN_SOURCE']])] = None
166
+ """
167
+ A list of categories that best define the Actor. Reflected in Scrapely Store's search and filtering options.
168
+ """
169
+ is_critical: Annotated[bool | None, Field(examples=[False])] = None
170
+ """
171
+ Whether the Actor is maintained by Scrapely.
172
+ """
173
+ is_generic: Annotated[bool | None, Field(examples=[False])] = None
174
+ """
175
+ Whether the Actor is intended for developers. Set by Scrapely.
176
+ """
177
+ is_source_code_hidden: Annotated[bool | None, Field(examples=[True])] = True
178
+ """
179
+ Whether the Actor's source files are hidden on its detail page.
180
+ """
181
+ has_no_dataset: Annotated[bool | None, Field(examples=[False])] = None
182
+ """
183
+ Whether the Actor stores results in a dataset. Set by Scrapely.
184
+ """
185
+
186
+
187
+ @docs_group('Models')
188
+ class ActorChargeEvent(BaseModel):
189
+ """Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced
190
+ (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive.
191
+
192
+ """
193
+
194
+ model_config = ConfigDict(
195
+ extra='allow',
196
+ populate_by_name=True,
197
+ alias_generator=to_camel,
198
+ )
199
+ event_title: str
200
+ """
201
+ Human-readable title shown to users in the billing UI.
202
+ """
203
+ event_description: str
204
+ """
205
+ Human-readable description of what triggers this event.
206
+ """
207
+ event_price_usd: float | None = None
208
+ """
209
+ Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`.
210
+
211
+ """
212
+ event_tiered_pricing_usd: dict[str, TieredPricingPerEventEntry] | None = None
213
+ is_primary_event: bool | None = None
214
+ """
215
+ Whether this event is the Actor's primary chargeable event.
216
+ """
217
+ is_one_time_event: bool | None = None
218
+ """
219
+ Whether this event can only be charged once per Actor run.
220
+ """
221
+
222
+
223
+ @docs_group('Models')
224
+ class ActorDefinition(BaseModel):
225
+ """The definition of the Actor, the full specification of this field can be found in the upstream API docs."""
226
+
227
+ model_config = ConfigDict(
228
+ extra='allow',
229
+ populate_by_name=True,
230
+ alias_generator=to_camel,
231
+ )
232
+ actor_specification: Literal[1] | None = None
233
+ """
234
+ The Actor specification version that this Actor follows. This property must be set to 1.
235
+ """
236
+ name: str | None = None
237
+ """
238
+ The name of the Actor.
239
+ """
240
+ version: Annotated[str | None, Field(pattern='^[0-9]+(\\.[0-9]+)+$')] = None
241
+ """
242
+ The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`).
243
+ """
244
+ build_tag: str | None = None
245
+ """
246
+ The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified.
247
+ """
248
+ environment_variables: dict[str, str] | None = None
249
+ """
250
+ A map of environment variables to be used during local development and deployment.
251
+ """
252
+ dockerfile: str | None = None
253
+ """
254
+ The path to the Dockerfile used for building the Actor on the platform.
255
+ """
256
+ docker_context_dir: str | None = None
257
+ """
258
+ The path to the directory used as the Docker context when building the Actor.
259
+ """
260
+ readme: str | None = None
261
+ """
262
+ The path to the README file for the Actor.
263
+ """
264
+ input: dict[str, Any] | None = None
265
+ """
266
+ The input schema object, the full specification can be found in the upstream API docs
267
+ """
268
+ changelog: str | None = None
269
+ """
270
+ The path to the CHANGELOG file displayed in the Actor's information tab.
271
+ """
272
+ storages: Storages | None = None
273
+ default_memory_mbytes: str | int | None = None
274
+ """
275
+ Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a dynamic memory expression.
276
+ """
277
+ min_memory_mbytes: Annotated[int | None, Field(ge=128)] = None
278
+ """
279
+ Specifies the minimum amount of memory in megabytes required by the Actor.
280
+ """
281
+ max_memory_mbytes: Annotated[int | None, Field(ge=128)] = None
282
+ """
283
+ Specifies the maximum amount of memory in megabytes required by the Actor.
284
+ """
285
+ uses_standby_mode: bool | None = None
286
+ """
287
+ Specifies whether Standby mode is enabled for the Actor.
288
+ """
289
+
290
+
291
+ @docs_group('Models')
292
+ class ActorNotice(Enum):
293
+ """A warning displayed on the Actor's page in Scrapely Store and Console. Can be set by the Actor's developer or automatically by Scrapely's quality checks."""
294
+
295
+ NONE = 'NONE'
296
+ RESIDENTIAL_PROXY_REQUIRED = 'RESIDENTIAL_PROXY_REQUIRED'
297
+ UNDER_MAINTENANCE = 'UNDER_MAINTENANCE'
298
+
299
+
300
+ @docs_group('Models')
301
+ class ActorResponse(BaseModel):
302
+ """Response containing Actor data."""
303
+
304
+ model_config = ConfigDict(
305
+ extra='allow',
306
+ populate_by_name=True,
307
+ alias_generator=to_camel,
308
+ )
309
+ data: Actor
310
+
311
+
312
+ @docs_group('Models')
313
+ class ActorShort(BaseModel):
314
+ model_config = ConfigDict(
315
+ extra='allow',
316
+ populate_by_name=True,
317
+ alias_generator=to_camel,
318
+ )
319
+ id: Annotated[str, Field(examples=['br9CKmk457'])]
320
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-10-29T07:34:24.202Z'])]
321
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-10-30T07:34:24.202Z'])]
322
+ name: Annotated[str, Field(examples=['MyAct'])]
323
+ username: Annotated[str, Field(examples=['janedoe'])]
324
+ title: Annotated[str | None, Field(examples=['Hello World Example'])] = None
325
+ stats: ActorStats | None = None
326
+
327
+
328
+ @docs_group('Models')
329
+ class ActorStandby(BaseModel):
330
+ model_config = ConfigDict(
331
+ extra='allow',
332
+ populate_by_name=True,
333
+ alias_generator=to_camel,
334
+ )
335
+ is_enabled: bool | None = None
336
+ """
337
+ Whether standby mode is enabled for the Actor.
338
+ """
339
+ desired_requests_per_actor_run: int | None = None
340
+ """
341
+ Target number of concurrent HTTP requests a single run is configured to handle.
342
+ """
343
+ max_requests_per_actor_run: int | None = None
344
+ """
345
+ Maximum number of concurrent HTTP requests that can be routed to a single run.
346
+ """
347
+ idle_timeout_secs: int | None = None
348
+ """
349
+ In seconds, how long a run can stay idle without incoming requests before it's terminated.
350
+ """
351
+ build: str | None = None
352
+ """
353
+ Which build to run in standby mode. Either a build tag or a version number.
354
+ """
355
+ memory_mbytes: int | None = None
356
+ """
357
+ In MB, the amount of memory allocated to the run.
358
+ """
359
+ disable_standby_fields_override: bool | None = None
360
+ """
361
+ If `true`, prevents the standby mode configuration from being overridden elsewhere.
362
+ """
363
+ should_pass_actor_input: bool | None = None
364
+ """
365
+ Whether to pass the Actor's input to the standby run. If `false`, the standby runs start with no input.
366
+ """
367
+
368
+
369
+ @docs_group('Models')
370
+ class ActorStats(BaseModel):
371
+ """Usage statistics and Scrapely Store metrics for the Actor."""
372
+
373
+ model_config = ConfigDict(
374
+ extra='allow',
375
+ populate_by_name=True,
376
+ alias_generator=to_camel,
377
+ )
378
+ total_builds: Annotated[int | None, Field(examples=[9])] = None
379
+ """
380
+ The total number of builds of the Actor.
381
+ """
382
+ total_runs: Annotated[int | None, Field(examples=[16])] = None
383
+ """
384
+ The total number of runs of the Actor.
385
+ """
386
+ total_users: Annotated[int | None, Field(examples=[6])] = None
387
+ """
388
+ The total number of Actor users, including its owner.
389
+ """
390
+ total_users7_days: Annotated[int | None, Field(examples=[2])] = None
391
+ """
392
+ The number of active users of the Actor in the last 7 days.
393
+ """
394
+ total_users30_days: Annotated[int | None, Field(examples=[6])] = None
395
+ """
396
+ The number of active users of the Actor in the last 30 days.
397
+ """
398
+ total_users90_days: Annotated[int | None, Field(examples=[6])] = None
399
+ """
400
+ The number of active users of the Actor in the last 90 days.
401
+ """
402
+ total_metamorphs: Annotated[int | None, Field(examples=[2])] = None
403
+ """
404
+ The total number of times a run of another Actor was metamorphed into this Actor.
405
+ """
406
+ last_run_started_at: Annotated[AwareDatetime | None, Field(examples=['2019-07-08T14:01:05.546Z'])] = None
407
+ """
408
+ The date and time the most recent run of the Actor started.
409
+ """
410
+ actor_review_count: Annotated[int | None, Field(examples=[69])] = None
411
+ """
412
+ The number of reviews the Actor has received in Scrapely Store.
413
+ """
414
+ actor_review_rating: Annotated[float | None, Field(examples=[4.7])] = None
415
+ """
416
+ The average rating of the Actor in Scrapely Store.
417
+ """
418
+ bookmark_count: Annotated[int | None, Field(examples=[1269])] = None
419
+ """
420
+ The number of users who bookmarked the Actor in Scrapely Store.
421
+ """
422
+ public_actor_run_stats30_days: PublicActorRunStats30Days | None = None
423
+ """
424
+ Run status counts from the last 30 days. Only for public Actors.
425
+ Excludes runs started by the Actor's owner.
426
+
427
+ """
428
+
429
+
430
+ @docs_group('Models')
431
+ class AddRequestResponse(BaseModel):
432
+ """Response containing the result of adding a request to the request queue."""
433
+
434
+ model_config = ConfigDict(
435
+ extra='allow',
436
+ populate_by_name=True,
437
+ alias_generator=to_camel,
438
+ )
439
+ data: RequestRegistration
440
+
441
+
442
+ @docs_group('Models')
443
+ class AddedRequest(BaseModel):
444
+ """Information about a request that was successfully added to a request queue."""
445
+
446
+ model_config = ConfigDict(
447
+ extra='allow',
448
+ populate_by_name=True,
449
+ alias_generator=to_camel,
450
+ )
451
+ request_id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
452
+ """
453
+ A unique identifier assigned to the request.
454
+ """
455
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
456
+ """
457
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
458
+ """
459
+ was_already_present: Annotated[bool, Field(examples=[False])]
460
+ """
461
+ Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created.
462
+ """
463
+ was_already_handled: Annotated[bool, Field(examples=[False])]
464
+ """
465
+ Indicates whether a request with the same unique key has already been processed by the request queue.
466
+ """
467
+
468
+
469
+ @docs_group('Models')
470
+ class BatchAddResponse(BaseModel):
471
+ """Response containing the result of a batch add operation."""
472
+
473
+ model_config = ConfigDict(
474
+ extra='allow',
475
+ populate_by_name=True,
476
+ alias_generator=to_camel,
477
+ )
478
+ data: BatchAddResult
479
+
480
+
481
+ @docs_group('Models')
482
+ class BatchAddResult(BaseModel):
483
+ """Result of a batch add operation containing successfully processed and failed requests."""
484
+
485
+ model_config = ConfigDict(
486
+ extra='allow',
487
+ populate_by_name=True,
488
+ alias_generator=to_camel,
489
+ )
490
+ processed_requests: list[AddedRequest]
491
+ """
492
+ Requests that were successfully added to the request queue.
493
+ """
494
+ unprocessed_requests: list[RequestDraft]
495
+ """
496
+ Requests that failed to be added and can be retried.
497
+ """
498
+
499
+
500
+ @docs_group('Models')
501
+ class BatchDeleteResponse(BaseModel):
502
+ """Response containing the result of a batch delete operation."""
503
+
504
+ model_config = ConfigDict(
505
+ extra='allow',
506
+ populate_by_name=True,
507
+ alias_generator=to_camel,
508
+ )
509
+ data: BatchDeleteResult
510
+
511
+
512
+ @docs_group('Models')
513
+ class BatchDeleteResult(BaseModel):
514
+ """Result of a batch delete operation containing successfully deleted and failed requests."""
515
+
516
+ model_config = ConfigDict(
517
+ extra='allow',
518
+ populate_by_name=True,
519
+ alias_generator=to_camel,
520
+ )
521
+ processed_requests: list[DeletedRequestById | DeletedRequestByUniqueKey]
522
+ """
523
+ Requests that were successfully deleted from the request queue.
524
+ """
525
+ unprocessed_requests: list[RequestDraft]
526
+ """
527
+ Requests that failed to be deleted and can be retried.
528
+ """
529
+
530
+
531
+ @docs_group('Models')
532
+ class BrowserInfoResponse(BaseModel):
533
+ model_config = ConfigDict(
534
+ extra='allow',
535
+ populate_by_name=True,
536
+ alias_generator=to_camel,
537
+ )
538
+ method: Annotated[str, Field(examples=['GET'])]
539
+ """
540
+ HTTP method of the request.
541
+ """
542
+ client_ip: Annotated[str | None, Field(examples=['1.2.3.4'])]
543
+ """
544
+ IP address of the client.
545
+ """
546
+ country_code: Annotated[str | None, Field(examples=['US'])]
547
+ """
548
+ Two-letter country code resolved from the client IP address.
549
+ """
550
+ body_length: Annotated[int, Field(examples=[0])]
551
+ """
552
+ Length of the request body in bytes.
553
+ """
554
+ headers: dict[str, str | list[str]] | None = None
555
+ """
556
+ Request headers. Omitted when `skipHeaders=true`.
557
+
558
+ """
559
+ raw_headers: list[str] | None = None
560
+ """
561
+ Raw request headers as a flat list of alternating name/value strings.
562
+ Included only when `rawHeaders=true`.
563
+
564
+ """
565
+
566
+
567
+ @docs_group('Models')
568
+ class Build(BaseModel):
569
+ model_config = ConfigDict(
570
+ extra='allow',
571
+ populate_by_name=True,
572
+ alias_generator=to_camel,
573
+ )
574
+ id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
575
+ act_id: Annotated[str, Field(examples=['janedoe~my-actor'])]
576
+ user_id: Annotated[str, Field(examples=['klmdEpoiojmdEMlk3'])]
577
+ started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
578
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
579
+ status: ActorJobStatus
580
+ meta: BuildsMeta
581
+ stats: BuildStats | None = None
582
+ options: BuildOptions | None = None
583
+ usage: BuildUsage | None = None
584
+ usage_total_usd: Annotated[float | None, Field(examples=[0.02])] = None
585
+ """
586
+ Total cost in USD for this build. Requires authentication token to access.
587
+ """
588
+ usage_usd: BuildUsage | None = None
589
+ """
590
+ Platform usage costs breakdown in USD for this build. Requires authentication token to access.
591
+ """
592
+ input_schema: Annotated[str | None, Field(deprecated=True, examples=['{\\n "title": "Schema for ... }'])] = None
593
+ readme: Annotated[str | None, Field(deprecated=True, examples=['# Magic Actor\\nThis Actor is magic.'])] = None
594
+ build_number: Annotated[
595
+ str, Field(examples=['0.1.1'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$')
596
+ ]
597
+ act_version: Annotated[ActVersion | None, Field(title='BuildActVersion')] = None
598
+ """
599
+ Snapshot of the Actor version that this build was created from.
600
+ """
601
+ actor_definition: ActorDefinition | None = None
602
+
603
+
604
+ @docs_group('Models')
605
+ class BuildOptions(BaseModel):
606
+ model_config = ConfigDict(
607
+ extra='allow',
608
+ populate_by_name=True,
609
+ alias_generator=to_camel,
610
+ )
611
+ use_cache: Annotated[bool | None, Field(examples=[False])] = None
612
+ beta_packages: Annotated[bool | None, Field(examples=[False])] = None
613
+ memory_mbytes: Annotated[int | None, Field(examples=[1024])] = None
614
+ disk_mbytes: Annotated[int | None, Field(examples=[2048])] = None
615
+
616
+
617
+ @docs_group('Models')
618
+ class BuildResponse(BaseModel):
619
+ """Response containing Actor build data."""
620
+
621
+ model_config = ConfigDict(
622
+ extra='allow',
623
+ populate_by_name=True,
624
+ alias_generator=to_camel,
625
+ )
626
+ data: Build
627
+
628
+
629
+ @docs_group('Models')
630
+ class BuildShort(BaseModel):
631
+ model_config = ConfigDict(
632
+ extra='allow',
633
+ populate_by_name=True,
634
+ alias_generator=to_camel,
635
+ )
636
+ id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
637
+ act_id: Annotated[str | None, Field(examples=['janedoe~my-actor'])] = None
638
+ user_id: Annotated[str | None, Field(examples=['klmdEpoiojmdEMlk3'])] = None
639
+ status: ActorJobStatus
640
+ started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
641
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
642
+ usage_total_usd: Annotated[float, Field(examples=[0.02])]
643
+ build_number: Annotated[
644
+ str, Field(examples=['0.1.1'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$')
645
+ ]
646
+ build_number_int: Annotated[int | None, Field(examples=[10000])] = None
647
+ meta: BuildsMeta | None = None
648
+
649
+
650
+ @docs_group('Models')
651
+ class BuildStats(BaseModel):
652
+ model_config = ConfigDict(
653
+ extra='allow',
654
+ populate_by_name=True,
655
+ alias_generator=to_camel,
656
+ )
657
+ duration_millis: Annotated[int | None, Field(examples=[1000])] = None
658
+ run_time_secs: Annotated[float | None, Field(examples=[45.718])] = None
659
+ compute_units: Annotated[float | None, Field(examples=[0.0126994444444444])] = None
660
+ image_size_bytes: Annotated[int | None, Field(examples=[975770223])] = None
661
+
662
+
663
+ @docs_group('Models')
664
+ class BuildTag(BaseModel):
665
+ """The name of the build tag."""
666
+
667
+ model_config = ConfigDict(
668
+ extra='allow',
669
+ populate_by_name=True,
670
+ alias_generator=to_camel,
671
+ )
672
+ build_id: str
673
+ """
674
+ The ID of the build to assign to the tag.
675
+ """
676
+
677
+
678
+ @docs_group('Models')
679
+ class BuildUsage(BaseModel):
680
+ model_config = ConfigDict(
681
+ extra='allow',
682
+ populate_by_name=True,
683
+ alias_generator=to_camel,
684
+ )
685
+ actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[0.08])] = None
686
+
687
+
688
+ @docs_group('Models')
689
+ class BuildsMeta(BaseModel):
690
+ model_config = ConfigDict(
691
+ extra='allow',
692
+ populate_by_name=True,
693
+ alias_generator=to_camel,
694
+ )
695
+ origin: RunOrigin
696
+ client_ip: Annotated[str | None, Field(examples=['172.234.12.34'])] = None
697
+ """
698
+ IP address of the client that started the build.
699
+ """
700
+ user_agent: Annotated[str | None, Field(examples=['Mozilla/5.0 (iPad)'])] = None
701
+ """
702
+ User agent of the client that started the build.
703
+ """
704
+
705
+
706
+ @docs_group('Models')
707
+ class Call(BaseModel):
708
+ model_config = ConfigDict(
709
+ extra='allow',
710
+ populate_by_name=True,
711
+ alias_generator=to_camel,
712
+ )
713
+ started_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T07:34:14.202Z'])] = None
714
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T07:34:14.202Z'])] = None
715
+ error_message: Annotated[str | None, Field(examples=['Cannot send request'])] = None
716
+ response_status: Annotated[int | None, Field(examples=[200])] = None
717
+ response_body: Annotated[str | None, Field(examples=['{"foo": "bar"}'])] = None
718
+
719
+
720
+ @docs_group('Models')
721
+ class ChargeRunRequest(BaseModel):
722
+ model_config = ConfigDict(
723
+ extra='allow',
724
+ populate_by_name=True,
725
+ alias_generator=to_camel,
726
+ )
727
+ event_name: Annotated[str, Field(examples=['ANALYZE_PAGE'])]
728
+ count: Annotated[int, Field(examples=[1])]
729
+
730
+
731
+ @docs_group('Models')
732
+ class CommonActorPricingInfo(BaseModel):
733
+ model_config = ConfigDict(
734
+ extra='allow',
735
+ populate_by_name=True,
736
+ alias_generator=to_camel,
737
+ )
738
+ apify_margin_percentage: float | None = None
739
+ """
740
+ In [0, 1], fraction of pricePerUnitUsd that goes to Scrapely.
741
+ Optional: Scrapely staging PAY_PER_EVENT payloads often omit this.
742
+ """
743
+ created_at: AwareDatetime | None = None
744
+ """
745
+ When this pricing info record has been created.
746
+ Optional: omitted on some Scrapely staging PAY_PER_EVENT records.
747
+ """
748
+ started_at: AwareDatetime | None = None
749
+ """
750
+ Since when is this pricing info record effective for a given Actor.
751
+ Optional: omitted on some Scrapely staging PAY_PER_EVENT records.
752
+ """
753
+ notified_about_future_change_at: AwareDatetime | None = None
754
+ notified_about_change_at: AwareDatetime | None = None
755
+ reason_for_change: str | None = None
756
+ is_price_change_notification_suppressed: bool | None = None
757
+ force_contains_significant_price_change: bool | None = None
758
+
759
+
760
+ @docs_group('Models')
761
+ class CreateActorRequest(BaseModel):
762
+ model_config = ConfigDict(
763
+ extra='allow',
764
+ populate_by_name=True,
765
+ alias_generator=to_camel,
766
+ )
767
+ name: Annotated[str | None, Field(examples=['instagram-scraper'])] = None
768
+ """
769
+ The identifier of the Actor. Use lowercase letters, numbers, and hyphens. Spaces or special characters aren't allowed. Must be unique across your account.
770
+ """
771
+ description: Annotated[str | None, Field(examples=['This scraper extracts posts and comments from Instagram.'])] = (
772
+ None
773
+ )
774
+ """
775
+ Short description of the Actor, displayed in Scrapely Store and Console.
776
+ """
777
+ title: Annotated[str | None, Field(examples=['Instagram scraper'])] = None
778
+ """
779
+ Human-readable name of the Actor, displayed in Scrapely Store and Console. Can contain spaces and capital letters. Recommended length is 40-50 characters. You can change this title without affecting the Actor's URL or SEO.
780
+ """
781
+ is_public: Annotated[bool | None, Field(examples=[False])] = None
782
+ """
783
+ Whether the Actor is available to users in Scrapely Store. If `false`, the Actor is private and only visible to you.
784
+ """
785
+ seo_title: Annotated[str | None, Field(examples=['Free Instagram scraper'])] = None
786
+ """
787
+ Name of the Actor to display by search engines such as Google. Can be different from the Actor's name displayed in Scrapely Store and Console. Recommended length is 40-50 characters.
788
+ """
789
+ seo_description: Annotated[str | None, Field(examples=['The best scraper for Instagram'])] = None
790
+ """
791
+ Description of the Actor to display by search engines such as Google. Recommended length is 140-156 characters.
792
+ """
793
+ restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
794
+ versions: list[Version] | None = None
795
+ """
796
+ An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
797
+ """
798
+ pricing_infos: (
799
+ list[
800
+ Annotated[
801
+ PayPerEventActorPricingInfo
802
+ | PricePerDatasetItemActorPricingInfo
803
+ | FlatPricePerMonthActorPricingInfo
804
+ | FreeActorPricingInfo,
805
+ Field(discriminator='pricing_model'),
806
+ ]
807
+ ]
808
+ | None
809
+ ) = None
810
+ categories: Annotated[list[str] | None, Field(examples=[['SOCIAL_MEDIA']])] = None
811
+ """
812
+ A list of categories that best define the Actor. Reflected in Scrapely Store's search and filtering options.
813
+ """
814
+ default_run_options: DefaultRunOptions | None = None
815
+ actor_standby: ActorStandby | None = None
816
+ """
817
+ The configuration of the Actor's standby mode. For details, see Standby mode.
818
+ """
819
+ example_run_input: ExampleRunInput | None = None
820
+ """
821
+ Sample input payload that demonstrates what a typical run input for an Actor looks like. Used when no explicit input for a run is provided.
822
+ """
823
+ is_deprecated: bool | None = None
824
+ """
825
+ Whether the Actor is deprecated.
826
+ """
827
+
828
+
829
+ @docs_group('Models')
830
+ class CreateOrUpdateVersionRequest(BaseModel):
831
+ model_config = ConfigDict(
832
+ extra='allow',
833
+ populate_by_name=True,
834
+ alias_generator=to_camel,
835
+ )
836
+ version_number: Annotated[
837
+ str | None, Field(examples=['1.6'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[0-9]+)?$')
838
+ ] = None
839
+ """
840
+ The version number of the Actor. Two numbers separated by a dot, that represent the `MAJOR.MINOR` part of the semantic versioning.
841
+ """
842
+ source_type: VersionSourceType | None = None
843
+ """
844
+ Where the source code of the version lives.
845
+ """
846
+ env_vars: list[EnvVar] | None = None
847
+ """
848
+ Environment variables for the version.
849
+ """
850
+ apply_env_vars_to_build: Annotated[bool | None, Field(examples=[False])] = None
851
+ """
852
+ Whether to inject the environment variables at build time.
853
+ """
854
+ build_tag: Annotated[str | None, Field(examples=['latest'])] = None
855
+ """
856
+ The tag name to apply to a successful build of this version. Can be `null` when the version has no build tag.
857
+ """
858
+ source_files: Annotated[list[SourceCodeFile | SourceCodeFolder] | None, Field(title='VersionSourceFiles')] = None
859
+ """
860
+ Applies when the `sourceType` is `SOURCE_FILES`. Represents the Actor's file structure as an array of files and folders.
861
+ """
862
+ git_repo_url: str | None = None
863
+ """
864
+ URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
865
+ """
866
+ tarball_url: str | None = None
867
+ """
868
+ URL of the tarball to download the source code from. Applies when the `sourceType` is `TARBALL`.
869
+ """
870
+ github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
871
+ """
872
+ URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.
873
+ """
874
+
875
+
876
+ @docs_group('Models')
877
+ class CreateTaskRequest(BaseModel):
878
+ model_config = ConfigDict(
879
+ extra='allow',
880
+ populate_by_name=True,
881
+ alias_generator=to_camel,
882
+ )
883
+ act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
884
+ name: Annotated[str | None, Field(examples=['my-task'])] = None
885
+ options: TaskOptions | None = None
886
+ input: TaskInput | None = None
887
+ title: str | None = None
888
+ actor_standby: ActorStandby | None = None
889
+ seo_title: str | None = None
890
+ seo_description: str | None = None
891
+
892
+
893
+ @docs_group('Models')
894
+ class Current(BaseModel):
895
+ model_config = ConfigDict(
896
+ extra='allow',
897
+ populate_by_name=True,
898
+ alias_generator=to_camel,
899
+ )
900
+ monthly_usage_usd: Annotated[float, Field(examples=[43])]
901
+ monthly_actor_compute_units: Annotated[float, Field(examples=[500.784475])]
902
+ monthly_external_data_transfer_gbytes: Annotated[float, Field(examples=[3.00861903931946])]
903
+ monthly_proxy_serps: Annotated[int, Field(examples=[34])]
904
+ monthly_residential_proxy_gbytes: Annotated[float, Field(examples=[0.4])]
905
+ actor_memory_gbytes: Annotated[float, Field(examples=[8])]
906
+ actor_count: Annotated[int, Field(examples=[31])]
907
+ actor_task_count: Annotated[int, Field(examples=[130])]
908
+ active_actor_job_count: Annotated[int, Field(examples=[0])]
909
+ team_account_seat_count: Annotated[int, Field(examples=[5])]
910
+ schedule_count: Annotated[int | None, Field(examples=[77])] = None
911
+
912
+
913
+ @docs_group('Models')
914
+ class CurrentPricingInfo(BaseModel):
915
+ model_config = ConfigDict(
916
+ extra='allow',
917
+ populate_by_name=True,
918
+ alias_generator=to_camel,
919
+ )
920
+ pricing_model: Annotated[str, Field(examples=['FREE'])]
921
+ apify_margin_percentage: Annotated[float | None, Field(examples=[0.2])] = None
922
+ created_at: Annotated[AwareDatetime | None, Field(examples=['2023-01-01T00:00:00.000Z'])] = None
923
+ started_at: Annotated[AwareDatetime | None, Field(examples=['2023-01-01T00:00:00.000Z'])] = None
924
+ notified_about_change_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None
925
+ notified_about_future_change_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None
926
+ is_price_change_notification_suppressed: Annotated[bool | None, Field(examples=[False])] = None
927
+ force_contains_significant_price_change: Annotated[bool | None, Field(examples=[False])] = None
928
+ is_ppe_platform_usage_paid_by_user: Annotated[
929
+ bool | None, Field(alias='isPPEPlatformUsagePaidByUser', examples=[False])
930
+ ] = None
931
+ reason_for_change: Annotated[str | None, Field(examples=[None])] = None
932
+ trial_minutes: Annotated[int | None, Field(examples=[None])] = None
933
+ unit_name: Annotated[str | None, Field(examples=[None])] = None
934
+ price_per_unit_usd: Annotated[float | None, Field(examples=[None])] = None
935
+ minimal_max_total_charge_usd: Annotated[float | None, Field(examples=[0.5])] = None
936
+ pricing_per_event: dict[str, Any] | None = None
937
+ """
938
+ Per-event pricing configuration for pay-per-event Actors.
939
+ """
940
+
941
+
942
+ @docs_group('Models')
943
+ class DailyServiceUsages(BaseModel):
944
+ model_config = ConfigDict(
945
+ extra='allow',
946
+ populate_by_name=True,
947
+ alias_generator=to_camel,
948
+ )
949
+ date: Annotated[str, Field(examples=['2022-10-02T00:00:00.000Z'])]
950
+ service_usage: dict[str, UsageItem]
951
+ total_usage_credits_usd: Annotated[float, Field(examples=[0.0474385791970591])]
952
+
953
+
954
+ @docs_group('Models')
955
+ class Dataset(BaseModel):
956
+ model_config = ConfigDict(
957
+ extra='allow',
958
+ populate_by_name=True,
959
+ alias_generator=to_camel,
960
+ )
961
+ id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
962
+ name: Annotated[str | None, Field(examples=['d7b9MDYsbtX5L7XAj'])] = None
963
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
964
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
965
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
966
+ accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
967
+ item_count: Annotated[int, Field(examples=[7], ge=0)]
968
+ clean_item_count: Annotated[int, Field(examples=[5], ge=0)]
969
+ act_id: str | None = None
970
+ act_run_id: str | None = None
971
+ fields: list[str] | None = None
972
+ schema_: Annotated[
973
+ dict[str, Any] | None,
974
+ Field(
975
+ alias='schema',
976
+ examples=[
977
+ {
978
+ 'actorSpecification': 1,
979
+ 'title': 'My dataset',
980
+ 'views': {
981
+ 'overview': {
982
+ 'title': 'Overview',
983
+ 'transformation': {'fields': ['linkUrl']},
984
+ 'display': {
985
+ 'component': 'table',
986
+ 'properties': {'linkUrl': {'label': 'Link URL', 'format': 'link'}},
987
+ },
988
+ }
989
+ },
990
+ }
991
+ ],
992
+ ),
993
+ ] = None
994
+ """
995
+ Defines the schema of items in your dataset, the full specification can be found in the upstream API docs
996
+ """
997
+ console_url: Annotated[AnyUrl, Field(examples=['https://api.scrape.ly/storage/datasets/27TmTznX9YPeAYhkC'])]
998
+ items_public_url: Annotated[
999
+ AnyUrl | None, Field(examples=['https://api-staging.scrape.ly/v2/datasets/WkzbQMuFYuamGv3YF/items?signature=abc123'])
1000
+ ] = None
1001
+ """
1002
+ A public link to access the dataset items directly.
1003
+ """
1004
+ url_signing_secret_key: str | None = None
1005
+ """
1006
+ A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset.
1007
+ """
1008
+ general_access: GeneralAccess | None = None
1009
+ stats: DatasetStats | None = None
1010
+
1011
+
1012
+ @docs_group('Models')
1013
+ class DatasetFieldStatistics(BaseModel):
1014
+ model_config = ConfigDict(
1015
+ extra='allow',
1016
+ populate_by_name=True,
1017
+ alias_generator=to_camel,
1018
+ )
1019
+ min: float | None = None
1020
+ """
1021
+ Minimum value of the field. For numbers, this is calculated directly. For strings, this is the length of the shortest string. For arrays, this is the length of the shortest array. For objects, this is the number of keys in the smallest object.
1022
+ """
1023
+ max: float | None = None
1024
+ """
1025
+ Maximum value of the field. For numbers, this is calculated directly. For strings, this is the length of the longest string. For arrays, this is the length of the longest array. For objects, this is the number of keys in the largest object.
1026
+ """
1027
+ null_count: int | None = None
1028
+ """
1029
+ How many items in the dataset have a null value for this field.
1030
+ """
1031
+ empty_count: int | None = None
1032
+ """
1033
+ How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty.
1034
+ """
1035
+
1036
+
1037
+ @docs_group('Models')
1038
+ class DatasetListItem(BaseModel):
1039
+ model_config = ConfigDict(
1040
+ extra='allow',
1041
+ populate_by_name=True,
1042
+ alias_generator=to_camel,
1043
+ )
1044
+ id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
1045
+ name: Annotated[str | None, Field(examples=['d7b9MDYsbtX5L7XAj'])] = None
1046
+ user_id: Annotated[str, Field(examples=['tbXmWu7GCxnyYtSiL'])]
1047
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
1048
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
1049
+ accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
1050
+ item_count: Annotated[int, Field(examples=[7])]
1051
+ clean_item_count: Annotated[int, Field(examples=[5])]
1052
+ act_id: Annotated[str | None, Field(examples=['zdc3Pyhyz3m8vjDeM'])] = None
1053
+ act_run_id: Annotated[str | None, Field(examples=['HG7ML7M8z78YcAPEB'])] = None
1054
+ title: Annotated[str | None, Field(examples=['My Dataset'])] = None
1055
+ username: Annotated[str | None, Field(examples=['janedoe'])] = None
1056
+ general_access: GeneralAccess | None = None
1057
+ stats: DatasetStats | None = None
1058
+
1059
+
1060
+ @docs_group('Models')
1061
+ class DatasetResponse(BaseModel):
1062
+ """Response containing dataset metadata."""
1063
+
1064
+ model_config = ConfigDict(
1065
+ extra='allow',
1066
+ populate_by_name=True,
1067
+ alias_generator=to_camel,
1068
+ )
1069
+ data: Dataset
1070
+
1071
+
1072
+ @docs_group('Models')
1073
+ class DatasetSchemaValidationError(BaseModel):
1074
+ model_config = ConfigDict(
1075
+ extra='allow',
1076
+ populate_by_name=True,
1077
+ alias_generator=to_camel,
1078
+ )
1079
+ type: Annotated[str | None, Field(examples=['schema-validation-error'])] = None
1080
+ """
1081
+ The type of the error.
1082
+ """
1083
+ message: Annotated[str | None, Field(examples=['Schema validation failed'])] = None
1084
+ """
1085
+ A human-readable message describing the error.
1086
+ """
1087
+ data: SchemaValidationErrorData | None = None
1088
+
1089
+
1090
+ @docs_group('Models')
1091
+ class DatasetStatistics(BaseModel):
1092
+ model_config = ConfigDict(
1093
+ extra='allow',
1094
+ populate_by_name=True,
1095
+ alias_generator=to_camel,
1096
+ )
1097
+ field_statistics: dict[str, Any] | None = None
1098
+ """
1099
+ When you configure the dataset fields schema, we measure the statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field. This property provides statistics for each field from dataset fields schema. <br/></br>See dataset field statistics documentation for more information.
1100
+ """
1101
+
1102
+
1103
+ @docs_group('Models')
1104
+ class DatasetStatisticsResponse(BaseModel):
1105
+ model_config = ConfigDict(
1106
+ extra='allow',
1107
+ populate_by_name=True,
1108
+ alias_generator=to_camel,
1109
+ )
1110
+ data: DatasetStatistics
1111
+
1112
+
1113
+ @docs_group('Models')
1114
+ class DatasetStats(BaseModel):
1115
+ model_config = ConfigDict(
1116
+ extra='allow',
1117
+ populate_by_name=True,
1118
+ alias_generator=to_camel,
1119
+ )
1120
+ read_count: Annotated[int | None, Field(examples=[22])] = None
1121
+ write_count: Annotated[int | None, Field(examples=[3])] = None
1122
+ storage_bytes: Annotated[int | None, Field(examples=[783])] = None
1123
+ """
1124
+ Total storage size in bytes. Only returned by the single-dataset endpoint.
1125
+ """
1126
+ inflated_bytes: Annotated[int | None, Field(examples=[0])] = None
1127
+ """
1128
+ Uncompressed size in bytes. Only returned by the dataset list endpoint.
1129
+ """
1130
+
1131
+
1132
+ @docs_group('Models')
1133
+ class Datasets(BaseModel):
1134
+ """Aliased dataset IDs for this run."""
1135
+
1136
+ model_config = ConfigDict(
1137
+ extra='allow',
1138
+ populate_by_name=True,
1139
+ alias_generator=to_camel,
1140
+ )
1141
+ __annotations__ = {
1142
+ '__pydantic_extra__': dict[str, str],
1143
+ }
1144
+ default: Annotated[str | None, Field(examples=['wmKPijuyDnPZAPRMk'])] = None
1145
+ """
1146
+ ID of the default dataset for this run.
1147
+ """
1148
+
1149
+
1150
+ @docs_group('Models')
1151
+ class DecodeAndVerifyData(BaseModel):
1152
+ model_config = ConfigDict(
1153
+ extra='allow',
1154
+ populate_by_name=True,
1155
+ alias_generator=to_camel,
1156
+ )
1157
+ decoded: Any
1158
+ """
1159
+ The original object that was encoded.
1160
+ """
1161
+ encoded_by_user_id: Annotated[str | None, Field(examples=['wRwJZtadYvn4mBZmm'])]
1162
+ is_verified_user: Annotated[bool, Field(examples=[False])]
1163
+
1164
+
1165
+ @docs_group('Models')
1166
+ class DecodeAndVerifyResponse(BaseModel):
1167
+ model_config = ConfigDict(
1168
+ extra='allow',
1169
+ populate_by_name=True,
1170
+ alias_generator=to_camel,
1171
+ )
1172
+ data: DecodeAndVerifyData
1173
+
1174
+
1175
+ @docs_group('Models')
1176
+ class DefaultRunOptions(BaseModel):
1177
+ """The default settings applied to an Actor run. Can be overridden elsewhere."""
1178
+
1179
+ model_config = ConfigDict(
1180
+ extra='allow',
1181
+ populate_by_name=True,
1182
+ alias_generator=to_camel,
1183
+ )
1184
+ build: Annotated[str | None, Field(examples=['latest'])] = None
1185
+ """
1186
+ Which build to run. Either a build tag or a version number.
1187
+ """
1188
+ timeout_secs: Annotated[int | None, Field(examples=[3600])] = None
1189
+ """
1190
+ Timeout in seconds. 0 if no timeout.
1191
+ """
1192
+ memory_mbytes: Annotated[int | None, Field(examples=[2048])] = None
1193
+ """
1194
+ In MB, the amount of memory allocated to the run.
1195
+ """
1196
+ restart_on_error: Annotated[bool | None, Field(examples=[False])] = None
1197
+ """
1198
+ Whether to automatically restart the run if it fails.
1199
+ """
1200
+ max_items: int | None = None
1201
+ """
1202
+ Maximum number of items the run might produce.
1203
+ """
1204
+ force_permission_level: ActorPermissionLevel | None = None
1205
+
1206
+
1207
+ @docs_group('Models')
1208
+ class DeletedRequestById(BaseModel):
1209
+ """Confirmation of a request that was successfully deleted, identified by its ID."""
1210
+
1211
+ model_config = ConfigDict(
1212
+ extra='allow',
1213
+ populate_by_name=True,
1214
+ alias_generator=to_camel,
1215
+ )
1216
+ unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])] = None
1217
+ """
1218
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
1219
+ """
1220
+ id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
1221
+ """
1222
+ A unique identifier assigned to the request.
1223
+ """
1224
+
1225
+
1226
+ @docs_group('Models')
1227
+ class DeletedRequestByUniqueKey(BaseModel):
1228
+ """Confirmation of a request that was successfully deleted, identified by its unique key."""
1229
+
1230
+ model_config = ConfigDict(
1231
+ extra='allow',
1232
+ populate_by_name=True,
1233
+ alias_generator=to_camel,
1234
+ )
1235
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
1236
+ """
1237
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
1238
+ """
1239
+ id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
1240
+ """
1241
+ A unique identifier assigned to the request.
1242
+ """
1243
+
1244
+
1245
+ @docs_group('Models')
1246
+ class EffectivePlatformFeature(BaseModel):
1247
+ model_config = ConfigDict(
1248
+ extra='allow',
1249
+ populate_by_name=True,
1250
+ alias_generator=to_camel,
1251
+ )
1252
+ is_enabled: Annotated[bool, Field(examples=[True])]
1253
+ disabled_reason: Annotated[
1254
+ str | None,
1255
+ Field(
1256
+ examples=[
1257
+ 'The "Selected public Actors for developers" feature is not enabled for your account. Please upgrade your plan or contact support@scrape.ly'
1258
+ ]
1259
+ ),
1260
+ ]
1261
+ disabled_reason_type: Annotated[str | None, Field(examples=['DISABLED'])]
1262
+ is_trial: Annotated[bool, Field(examples=[False])]
1263
+ trial_expiration_at: Annotated[AwareDatetime | None, Field(examples=['2025-01-01T14:00:00.000Z'])]
1264
+
1265
+
1266
+ @docs_group('Models')
1267
+ class EffectivePlatformFeatures(BaseModel):
1268
+ model_config = ConfigDict(
1269
+ extra='allow',
1270
+ populate_by_name=True,
1271
+ alias_generator=to_camel,
1272
+ )
1273
+ actors: Annotated[EffectivePlatformFeature, Field(alias='ACTORS')]
1274
+ storage: Annotated[EffectivePlatformFeature, Field(alias='STORAGE')]
1275
+ scheduler: Annotated[EffectivePlatformFeature, Field(alias='SCHEDULER')]
1276
+ proxy: Annotated[EffectivePlatformFeature, Field(alias='PROXY')]
1277
+ proxy_external_access: Annotated[EffectivePlatformFeature, Field(alias='PROXY_EXTERNAL_ACCESS')]
1278
+ proxy_residential: Annotated[EffectivePlatformFeature, Field(alias='PROXY_RESIDENTIAL')]
1279
+ proxy_serps: Annotated[EffectivePlatformFeature, Field(alias='PROXY_SERPS')]
1280
+ webhooks: Annotated[EffectivePlatformFeature, Field(alias='WEBHOOKS')]
1281
+ actors_public_all: Annotated[EffectivePlatformFeature, Field(alias='ACTORS_PUBLIC_ALL')]
1282
+ actors_public_developer: Annotated[EffectivePlatformFeature, Field(alias='ACTORS_PUBLIC_DEVELOPER')]
1283
+
1284
+
1285
+ @docs_group('Models')
1286
+ class EncodeAndSignData(BaseModel):
1287
+ model_config = ConfigDict(
1288
+ extra='allow',
1289
+ populate_by_name=True,
1290
+ alias_generator=to_camel,
1291
+ )
1292
+ encoded: Annotated[str, Field(examples=['eyJwYXlsb2FkIjoiLi4uIiwic2lnbmF0dXJlIjoiLi4uIn0='])]
1293
+
1294
+
1295
+ @docs_group('Models')
1296
+ class DecodeAndVerifyRequest(EncodeAndSignData):
1297
+ pass
1298
+
1299
+
1300
+ @docs_group('Models')
1301
+ class EncodeAndSignResponse(BaseModel):
1302
+ model_config = ConfigDict(
1303
+ extra='allow',
1304
+ populate_by_name=True,
1305
+ alias_generator=to_camel,
1306
+ )
1307
+ data: EncodeAndSignData
1308
+
1309
+
1310
+ @docs_group('Models')
1311
+ class EnvVar(BaseModel):
1312
+ model_config = ConfigDict(
1313
+ extra='allow',
1314
+ populate_by_name=True,
1315
+ alias_generator=to_camel,
1316
+ )
1317
+ name: Annotated[str, Field(examples=['MY_ENV_VAR'])]
1318
+ """
1319
+ The name of the environment variable.
1320
+ """
1321
+ value: Annotated[str | None, Field(examples=['my-value'])] = None
1322
+ """
1323
+ The value of the environment variable. If `isSecret` is `true`, this value isn't returned by the API.
1324
+ """
1325
+ is_secret: Annotated[bool | None, Field(examples=[False])] = None
1326
+ """
1327
+ Whether the environment variable is encrypted. Secret values aren't returned by the API.
1328
+ """
1329
+
1330
+
1331
+ @docs_group('Models')
1332
+ class EnvVarRequest(EnvVar):
1333
+ model_config = ConfigDict(
1334
+ extra='allow',
1335
+ populate_by_name=True,
1336
+ alias_generator=to_camel,
1337
+ )
1338
+ value: Annotated[str, Field(examples=['my-value'])]
1339
+ """
1340
+ The value of the environment variable. If `isSecret` is `true`, this value isn't returned by the API.
1341
+ """
1342
+
1343
+
1344
+ @docs_group('Models')
1345
+ class EnvVarResponse(BaseModel):
1346
+ model_config = ConfigDict(
1347
+ extra='allow',
1348
+ populate_by_name=True,
1349
+ alias_generator=to_camel,
1350
+ )
1351
+ data: EnvVar
1352
+
1353
+
1354
+ @docs_group('Models')
1355
+ class ErrorDetail(BaseModel):
1356
+ model_config = ConfigDict(
1357
+ extra='allow',
1358
+ populate_by_name=True,
1359
+ alias_generator=to_camel,
1360
+ )
1361
+ type: ErrorType | None = None
1362
+ message: str | None = None
1363
+ """
1364
+ Human-readable error message describing what went wrong.
1365
+ """
1366
+
1367
+
1368
+ @docs_group('Models')
1369
+ class ErrorResponse(BaseModel):
1370
+ model_config = ConfigDict(
1371
+ extra='allow',
1372
+ populate_by_name=True,
1373
+ alias_generator=to_camel,
1374
+ )
1375
+ error: ErrorDetail
1376
+
1377
+
1378
+ @docs_group('Models')
1379
+ class EventData(BaseModel):
1380
+ model_config = ConfigDict(
1381
+ extra='allow',
1382
+ populate_by_name=True,
1383
+ alias_generator=to_camel,
1384
+ )
1385
+ actor_id: Annotated[str, Field(examples=['vvE7iMKuMc5qTHHsR'])]
1386
+ actor_run_id: Annotated[str | None, Field(examples=['JgwXN9BdwxGcu9MMF'])] = None
1387
+ actor_build_id: Annotated[str | None, Field(examples=['HG7ML7M8z78YcAPEB'])] = None
1388
+ actor_task_id: Annotated[str | None, Field(examples=['zRLp8SDOZz2NyLg7K'])] = None
1389
+
1390
+
1391
+ @docs_group('Models')
1392
+ class ExampleRunInput(BaseModel):
1393
+ model_config = ConfigDict(
1394
+ extra='allow',
1395
+ populate_by_name=True,
1396
+ alias_generator=to_camel,
1397
+ )
1398
+ body: Annotated[str | None, Field(examples=['{ "helloWorld": 123 }'])] = None
1399
+ """
1400
+ Sample input, serialized as a string.
1401
+ """
1402
+ content_type: Annotated[str | None, Field(examples=['application/json; charset=utf-8'])] = None
1403
+ """
1404
+ MIME type of `body`.
1405
+ """
1406
+
1407
+
1408
+ @docs_group('Models')
1409
+ class ExampleWebhookDispatch(BaseModel):
1410
+ model_config = ConfigDict(
1411
+ extra='allow',
1412
+ populate_by_name=True,
1413
+ alias_generator=to_camel,
1414
+ )
1415
+ status: WebhookDispatchStatus
1416
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-13T08:36:13.202Z'])] = None
1417
+ removed_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None
1418
+
1419
+
1420
+ @docs_group('Models')
1421
+ class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
1422
+ model_config = ConfigDict(
1423
+ extra='allow',
1424
+ populate_by_name=True,
1425
+ alias_generator=to_camel,
1426
+ )
1427
+ pricing_model: Literal['FLAT_PRICE_PER_MONTH']
1428
+ trial_minutes: int
1429
+ """
1430
+ For how long this Actor can be used for free in trial period
1431
+ """
1432
+ price_per_unit_usd: float
1433
+ """
1434
+ Monthly flat price in USD
1435
+ """
1436
+
1437
+
1438
+ @docs_group('Models')
1439
+ class FreeActorPricingInfo(CommonActorPricingInfo):
1440
+ model_config = ConfigDict(
1441
+ extra='allow',
1442
+ populate_by_name=True,
1443
+ alias_generator=to_camel,
1444
+ )
1445
+ pricing_model: Literal['FREE']
1446
+
1447
+
1448
+ @docs_group('Models')
1449
+ class HeadAndLockResponse(BaseModel):
1450
+ """Response containing locked requests from the request queue head."""
1451
+
1452
+ model_config = ConfigDict(
1453
+ extra='allow',
1454
+ populate_by_name=True,
1455
+ alias_generator=to_camel,
1456
+ )
1457
+ data: LockedRequestQueueHead
1458
+
1459
+
1460
+ @docs_group('Models')
1461
+ class HeadRequest(BaseModel):
1462
+ """A request from the request queue head without lock information."""
1463
+
1464
+ model_config = ConfigDict(
1465
+ extra='allow',
1466
+ populate_by_name=True,
1467
+ alias_generator=to_camel,
1468
+ )
1469
+ id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
1470
+ """
1471
+ A unique identifier assigned to the request.
1472
+ """
1473
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
1474
+ """
1475
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
1476
+ """
1477
+ url: Annotated[str, Field(examples=['https://api-staging.scrape.ly'])]
1478
+ """
1479
+ The URL of the request.
1480
+ """
1481
+ method: HttpMethod | None = None
1482
+ retry_count: Annotated[int | None, Field(examples=[0])] = None
1483
+ """
1484
+ The number of times this request has been retried.
1485
+ """
1486
+
1487
+
1488
+ @docs_group('Models')
1489
+ class HeadResponse(BaseModel):
1490
+ """Response containing requests from the request queue head without locking."""
1491
+
1492
+ model_config = ConfigDict(
1493
+ extra='allow',
1494
+ populate_by_name=True,
1495
+ alias_generator=to_camel,
1496
+ )
1497
+ data: RequestQueueHead
1498
+
1499
+
1500
+ @docs_group('Models')
1501
+ class InvalidItem(BaseModel):
1502
+ model_config = ConfigDict(
1503
+ extra='allow',
1504
+ populate_by_name=True,
1505
+ alias_generator=to_camel,
1506
+ )
1507
+ item_position: Annotated[int | None, Field(examples=[2])] = None
1508
+ """
1509
+ The position of the invalid item in the array.
1510
+ """
1511
+ validation_errors: list[ValidationError] | None = None
1512
+ """
1513
+ A complete list of AJV validation error objects for the invalid item.
1514
+ """
1515
+
1516
+
1517
+ @docs_group('Models')
1518
+ class KeyValueStore(BaseModel):
1519
+ model_config = ConfigDict(
1520
+ extra='allow',
1521
+ populate_by_name=True,
1522
+ alias_generator=to_camel,
1523
+ )
1524
+ id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
1525
+ name: Annotated[str | None, Field(examples=['d7b9MDYsbtX5L7XAj'])] = None
1526
+ user_id: Annotated[str | None, Field(examples=['BPWDBd7Z9c746JAnF'])] = None
1527
+ username: Annotated[str | None, Field(examples=['janedoe'])] = None
1528
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
1529
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
1530
+ accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
1531
+ act_id: Annotated[str | None, Field(examples=[None])] = None
1532
+ act_run_id: Annotated[str | None, Field(examples=[None])] = None
1533
+ console_url: Annotated[
1534
+ AnyUrl | None, Field(examples=['https://api.scrape.ly/storage/key-value-stores/27TmTznX9YPeAYhkC'])
1535
+ ] = None
1536
+ keys_public_url: Annotated[
1537
+ AnyUrl | None,
1538
+ Field(examples=['https://api-staging.scrape.ly/v2/key-value-stores/WkzbQMuFYuamGv3YF/keys?signature=abc123']),
1539
+ ] = None
1540
+ """
1541
+ A public link to access keys of the key-value store directly.
1542
+ """
1543
+ records_public_url: Annotated[
1544
+ AnyUrl | None, Field(examples=['https://api-staging.scrape.ly/v2/key-value-stores/WkzbQMuFYuamGv3YF/records'])
1545
+ ] = None
1546
+ """
1547
+ A public link to access records of the key-value store directly.
1548
+ """
1549
+ schema_: Annotated[dict[str, Any] | None, Field(alias='schema')] = None
1550
+ """
1551
+ Optional JSON schema describing the keys stored in the key-value store.
1552
+ """
1553
+ url_signing_secret_key: str | None = None
1554
+ """
1555
+ A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store.
1556
+ """
1557
+ general_access: GeneralAccess | None = None
1558
+ stats: KeyValueStoreStats | None = None
1559
+
1560
+
1561
+ @docs_group('Models')
1562
+ class KeyValueStoreKey(BaseModel):
1563
+ model_config = ConfigDict(
1564
+ extra='allow',
1565
+ populate_by_name=True,
1566
+ alias_generator=to_camel,
1567
+ )
1568
+ key: Annotated[str, Field(examples=['second-key'])]
1569
+ size: Annotated[int, Field(examples=[36])]
1570
+ record_public_url: Annotated[
1571
+ AnyUrl,
1572
+ Field(
1573
+ examples=['https://api-staging.scrape.ly/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key?signature=abc123']
1574
+ ),
1575
+ ]
1576
+ """
1577
+ A public link to access this record directly.
1578
+ """
1579
+
1580
+
1581
+ @docs_group('Models')
1582
+ class KeyValueStoreResponse(BaseModel):
1583
+ """Response containing key-value store data."""
1584
+
1585
+ model_config = ConfigDict(
1586
+ extra='allow',
1587
+ populate_by_name=True,
1588
+ alias_generator=to_camel,
1589
+ )
1590
+ data: KeyValueStore
1591
+
1592
+
1593
+ @docs_group('Models')
1594
+ class KeyValueStoreStats(BaseModel):
1595
+ model_config = ConfigDict(
1596
+ extra='allow',
1597
+ populate_by_name=True,
1598
+ alias_generator=to_camel,
1599
+ )
1600
+ read_count: Annotated[int | None, Field(examples=[9])] = None
1601
+ write_count: Annotated[int | None, Field(examples=[3])] = None
1602
+ delete_count: Annotated[int | None, Field(examples=[6])] = None
1603
+ list_count: Annotated[int | None, Field(examples=[2])] = None
1604
+ s3_storage_bytes: Annotated[int | None, Field(examples=[18])] = None
1605
+ storage_bytes: Annotated[int | None, Field(examples=[457225])] = None
1606
+
1607
+
1608
+ @docs_group('Models')
1609
+ class KeyValueStores(BaseModel):
1610
+ """Aliased key-value store IDs for this run."""
1611
+
1612
+ model_config = ConfigDict(
1613
+ extra='allow',
1614
+ populate_by_name=True,
1615
+ alias_generator=to_camel,
1616
+ )
1617
+ __annotations__ = {
1618
+ '__pydantic_extra__': dict[str, str],
1619
+ }
1620
+ default: Annotated[str | None, Field(examples=['eJNzqsbPiopwJcgGQ'])] = None
1621
+ """
1622
+ ID of the default key-value store for this run.
1623
+ """
1624
+
1625
+
1626
+ @docs_group('Models')
1627
+ class Limits(BaseModel):
1628
+ model_config = ConfigDict(
1629
+ extra='allow',
1630
+ populate_by_name=True,
1631
+ alias_generator=to_camel,
1632
+ )
1633
+ max_monthly_usage_usd: Annotated[float, Field(examples=[300])]
1634
+ max_monthly_actor_compute_units: Annotated[float, Field(examples=[1000])]
1635
+ max_monthly_external_data_transfer_gbytes: Annotated[float, Field(examples=[7])]
1636
+ max_monthly_proxy_serps: Annotated[int, Field(examples=[50])]
1637
+ max_monthly_residential_proxy_gbytes: Annotated[float, Field(examples=[0.5])]
1638
+ max_actor_memory_gbytes: Annotated[float, Field(examples=[16])]
1639
+ max_actor_count: Annotated[int, Field(examples=[100])]
1640
+ max_actor_task_count: Annotated[int, Field(examples=[1000])]
1641
+ max_concurrent_actor_jobs: Annotated[int, Field(examples=[256])]
1642
+ max_team_account_seat_count: Annotated[int, Field(examples=[9])]
1643
+ data_retention_days: Annotated[int, Field(examples=[90])]
1644
+ max_schedule_count: Annotated[int | None, Field(examples=[100])] = None
1645
+
1646
+
1647
+ @docs_group('Models')
1648
+ class LimitsResponse(BaseModel):
1649
+ model_config = ConfigDict(
1650
+ extra='allow',
1651
+ populate_by_name=True,
1652
+ alias_generator=to_camel,
1653
+ )
1654
+ data: AccountLimits
1655
+
1656
+
1657
+ @docs_group('Models')
1658
+ class ListOfActorsInStoreResponse(BaseModel):
1659
+ model_config = ConfigDict(
1660
+ extra='allow',
1661
+ populate_by_name=True,
1662
+ alias_generator=to_camel,
1663
+ )
1664
+ data: ListOfStoreActors
1665
+
1666
+
1667
+ @docs_group('Models')
1668
+ class ListOfActorsResponse(BaseModel):
1669
+ model_config = ConfigDict(
1670
+ extra='allow',
1671
+ populate_by_name=True,
1672
+ alias_generator=to_camel,
1673
+ )
1674
+ data: ListOfActors
1675
+
1676
+
1677
+ @docs_group('Models')
1678
+ class ListOfBuildsResponse(BaseModel):
1679
+ model_config = ConfigDict(
1680
+ extra='allow',
1681
+ populate_by_name=True,
1682
+ alias_generator=to_camel,
1683
+ )
1684
+ data: ListOfBuilds
1685
+
1686
+
1687
+ @docs_group('Models')
1688
+ class ListOfDatasetsResponse(BaseModel):
1689
+ model_config = ConfigDict(
1690
+ extra='allow',
1691
+ populate_by_name=True,
1692
+ alias_generator=to_camel,
1693
+ )
1694
+ data: ListOfDatasets
1695
+
1696
+
1697
+ @docs_group('Models')
1698
+ class ListOfEnvVars(BaseModel):
1699
+ model_config = ConfigDict(
1700
+ extra='allow',
1701
+ populate_by_name=True,
1702
+ alias_generator=to_camel,
1703
+ )
1704
+ total: Annotated[int, Field(examples=[5])]
1705
+ items: list[EnvVar]
1706
+
1707
+
1708
+ @docs_group('Models')
1709
+ class ListOfEnvVarsResponse(BaseModel):
1710
+ model_config = ConfigDict(
1711
+ extra='allow',
1712
+ populate_by_name=True,
1713
+ alias_generator=to_camel,
1714
+ )
1715
+ data: ListOfEnvVars
1716
+
1717
+
1718
+ @docs_group('Models')
1719
+ class ListOfKeyValueStoresResponse(BaseModel):
1720
+ model_config = ConfigDict(
1721
+ extra='allow',
1722
+ populate_by_name=True,
1723
+ alias_generator=to_camel,
1724
+ )
1725
+ data: ListOfKeyValueStores
1726
+
1727
+
1728
+ @docs_group('Models')
1729
+ class ListOfKeys(BaseModel):
1730
+ model_config = ConfigDict(
1731
+ extra='allow',
1732
+ populate_by_name=True,
1733
+ alias_generator=to_camel,
1734
+ )
1735
+ items: list[KeyValueStoreKey]
1736
+ count: Annotated[int, Field(examples=[2])]
1737
+ limit: Annotated[int, Field(examples=[2])]
1738
+ exclusive_start_key: Annotated[str | None, Field(examples=['some-key'])] = None
1739
+ is_truncated: Annotated[bool, Field(examples=[True])]
1740
+ next_exclusive_start_key: Annotated[str | None, Field(examples=['third-key'])] = None
1741
+
1742
+
1743
+ @docs_group('Models')
1744
+ class ListOfKeysResponse(BaseModel):
1745
+ model_config = ConfigDict(
1746
+ extra='allow',
1747
+ populate_by_name=True,
1748
+ alias_generator=to_camel,
1749
+ )
1750
+ data: ListOfKeys
1751
+
1752
+
1753
+ @docs_group('Models')
1754
+ class ListOfRequestQueuesResponse(BaseModel):
1755
+ """Response containing a list of request queues."""
1756
+
1757
+ model_config = ConfigDict(
1758
+ extra='allow',
1759
+ populate_by_name=True,
1760
+ alias_generator=to_camel,
1761
+ )
1762
+ data: ListOfRequestQueues
1763
+
1764
+
1765
+ @docs_group('Models')
1766
+ class ListOfRequests(BaseModel):
1767
+ """A paginated list of requests from the request queue."""
1768
+
1769
+ model_config = ConfigDict(
1770
+ extra='allow',
1771
+ populate_by_name=True,
1772
+ alias_generator=to_camel,
1773
+ )
1774
+ items: list[Request]
1775
+ """
1776
+ The array of requests.
1777
+ """
1778
+ limit: Annotated[int, Field(examples=[2])]
1779
+ """
1780
+ The maximum number of requests returned in this response.
1781
+ """
1782
+ exclusive_start_id: Annotated[str | None, Field(deprecated=True, examples=['Ihnsp8YrvJ8102Kj'])] = None
1783
+ """
1784
+ The ID of the last request from the previous page, used for pagination.
1785
+ """
1786
+ cursor: Annotated[str | None, Field(examples=['eyJyZXF1ZXN0SWQiOiI0SVlLUWFXZ2FKUUlWNlMifQ'])] = None
1787
+ """
1788
+ A cursor string used for current page of results.
1789
+ """
1790
+ next_cursor: Annotated[str | None, Field(examples=['eyJyZXF1ZXN0SWQiOiI5eFNNc1BrN1J6VUxTNXoifQ'])] = None
1791
+ """
1792
+ A cursor string to be used to continue pagination.
1793
+ """
1794
+
1795
+
1796
+ @docs_group('Models')
1797
+ class ListOfRequestsResponse(BaseModel):
1798
+ """Response containing a list of requests from the request queue."""
1799
+
1800
+ model_config = ConfigDict(
1801
+ extra='allow',
1802
+ populate_by_name=True,
1803
+ alias_generator=to_camel,
1804
+ )
1805
+ data: ListOfRequests
1806
+
1807
+
1808
+ @docs_group('Models')
1809
+ class ListOfRunsResponse(BaseModel):
1810
+ model_config = ConfigDict(
1811
+ extra='allow',
1812
+ populate_by_name=True,
1813
+ alias_generator=to_camel,
1814
+ )
1815
+ data: ListOfRuns
1816
+
1817
+
1818
+ @docs_group('Models')
1819
+ class ListOfSchedulesResponse(BaseModel):
1820
+ model_config = ConfigDict(
1821
+ extra='allow',
1822
+ populate_by_name=True,
1823
+ alias_generator=to_camel,
1824
+ )
1825
+ data: ListOfSchedules
1826
+
1827
+
1828
+ @docs_group('Models')
1829
+ class ListOfTasksResponse(BaseModel):
1830
+ model_config = ConfigDict(
1831
+ extra='allow',
1832
+ populate_by_name=True,
1833
+ alias_generator=to_camel,
1834
+ )
1835
+ data: ListOfTasks
1836
+
1837
+
1838
+ @docs_group('Models')
1839
+ class ListOfVersions(BaseModel):
1840
+ model_config = ConfigDict(
1841
+ extra='allow',
1842
+ populate_by_name=True,
1843
+ alias_generator=to_camel,
1844
+ )
1845
+ total: Annotated[int, Field(examples=[5])]
1846
+ items: list[Version]
1847
+
1848
+
1849
+ @docs_group('Models')
1850
+ class ListOfVersionsResponse(BaseModel):
1851
+ model_config = ConfigDict(
1852
+ extra='allow',
1853
+ populate_by_name=True,
1854
+ alias_generator=to_camel,
1855
+ )
1856
+ data: ListOfVersions
1857
+
1858
+
1859
+ @docs_group('Models')
1860
+ class ListOfWebhookDispatchesResponse(BaseModel):
1861
+ model_config = ConfigDict(
1862
+ extra='allow',
1863
+ populate_by_name=True,
1864
+ alias_generator=to_camel,
1865
+ )
1866
+ data: ListOfWebhookDispatches
1867
+
1868
+
1869
+ @docs_group('Models')
1870
+ class ListOfWebhooksResponse(BaseModel):
1871
+ model_config = ConfigDict(
1872
+ extra='allow',
1873
+ populate_by_name=True,
1874
+ alias_generator=to_camel,
1875
+ )
1876
+ data: ListOfWebhooks
1877
+
1878
+
1879
+ @docs_group('Models')
1880
+ class LockedHeadRequest(BaseModel):
1881
+ """A request from the request queue head that has been locked for processing."""
1882
+
1883
+ model_config = ConfigDict(
1884
+ extra='allow',
1885
+ populate_by_name=True,
1886
+ alias_generator=to_camel,
1887
+ )
1888
+ id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
1889
+ """
1890
+ A unique identifier assigned to the request.
1891
+ """
1892
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
1893
+ """
1894
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
1895
+ """
1896
+ url: Annotated[str, Field(examples=['https://api-staging.scrape.ly'])]
1897
+ """
1898
+ The URL of the request.
1899
+ """
1900
+ method: HttpMethod | None = None
1901
+ retry_count: Annotated[int | None, Field(examples=[0])] = None
1902
+ """
1903
+ The number of times this request has been retried.
1904
+ """
1905
+ lock_expires_at: Annotated[AwareDatetime, Field(examples=['2022-06-14T23:00:00.000Z'])]
1906
+ """
1907
+ The timestamp when the lock on this request expires.
1908
+ """
1909
+
1910
+
1911
+ @docs_group('Models')
1912
+ class LockedRequestQueueHead(BaseModel):
1913
+ """A batch of locked requests from the request queue head."""
1914
+
1915
+ model_config = ConfigDict(
1916
+ extra='allow',
1917
+ populate_by_name=True,
1918
+ alias_generator=to_camel,
1919
+ )
1920
+ limit: Annotated[int, Field(examples=[1000])]
1921
+ """
1922
+ The maximum number of requests returned.
1923
+ """
1924
+ queue_modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
1925
+ """
1926
+ The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue.
1927
+ """
1928
+ queue_has_locked_requests: Annotated[bool | None, Field(examples=[True])] = None
1929
+ """
1930
+ Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one).
1931
+ """
1932
+ client_key: Annotated[str | None, Field(examples=['client-one'])] = None
1933
+ """
1934
+ The client key used for locking the requests.
1935
+ """
1936
+ had_multiple_clients: Annotated[bool, Field(examples=[True])]
1937
+ """
1938
+ Whether the request queue has been accessed by multiple different clients.
1939
+ """
1940
+ lock_secs: Annotated[int, Field(examples=[60])]
1941
+ """
1942
+ The number of seconds the locks will be held.
1943
+ """
1944
+ items: list[LockedHeadRequest]
1945
+ """
1946
+ The array of locked requests from the request queue head.
1947
+ """
1948
+
1949
+
1950
+ @docs_group('Models')
1951
+ class Metamorph(BaseModel):
1952
+ """Information about a metamorph event that occurred during the run."""
1953
+
1954
+ model_config = ConfigDict(
1955
+ extra='allow',
1956
+ populate_by_name=True,
1957
+ alias_generator=to_camel,
1958
+ )
1959
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:39:24.202Z'])]
1960
+ """
1961
+ Time when the metamorph occurred.
1962
+ """
1963
+ actor_id: Annotated[str, Field(examples=['nspoEjklmnsF2oosD'])]
1964
+ """
1965
+ ID of the Actor that the run was metamorphed to.
1966
+ """
1967
+ build_id: Annotated[str, Field(examples=['ME6oKecqy5kXDS4KQ'])]
1968
+ """
1969
+ ID of the build used for the metamorphed Actor.
1970
+ """
1971
+ input_key: Annotated[str | None, Field(examples=['INPUT-METAMORPH-1'])] = None
1972
+ """
1973
+ Key of the input record in the key-value store.
1974
+ """
1975
+
1976
+
1977
+ @docs_group('Models')
1978
+ class MonthlyUsage(BaseModel):
1979
+ model_config = ConfigDict(
1980
+ extra='allow',
1981
+ populate_by_name=True,
1982
+ alias_generator=to_camel,
1983
+ )
1984
+ usage_cycle: UsageCycle
1985
+ # Scrapely emits raw byte counts (int) for the `DATA_TRANSFER_*_BYTES` keys
1986
+ monthly_service_usage: dict[str, UsageItem | int]
1987
+ daily_service_usages: list[DailyServiceUsages]
1988
+ total_usage_credits_usd_before_volume_discount: Annotated[float, Field(examples=[0.786143673840067])]
1989
+ total_usage_credits_usd_after_volume_discount: Annotated[float, Field(examples=[0.786143673840067])]
1990
+
1991
+
1992
+ @docs_group('Models')
1993
+ class MonthlyUsageResponse(BaseModel):
1994
+ model_config = ConfigDict(
1995
+ extra='allow',
1996
+ populate_by_name=True,
1997
+ alias_generator=to_camel,
1998
+ )
1999
+ data: MonthlyUsage
2000
+
2001
+
2002
+ @docs_group('Models')
2003
+ class Notifications(BaseModel):
2004
+ """Notification settings for this schedule."""
2005
+
2006
+ model_config = ConfigDict(
2007
+ extra='allow',
2008
+ populate_by_name=True,
2009
+ alias_generator=to_camel,
2010
+ )
2011
+ email: Annotated[bool | None, Field(examples=[True])] = None
2012
+
2013
+
2014
+ @docs_group('Models')
2015
+ class PaginationResponse(BaseModel):
2016
+ """Common pagination fields for list responses."""
2017
+
2018
+ model_config = ConfigDict(
2019
+ extra='allow',
2020
+ populate_by_name=True,
2021
+ alias_generator=to_camel,
2022
+ )
2023
+ total: Annotated[int, Field(examples=[1], ge=0)]
2024
+ """
2025
+ The total number of items available across all pages.
2026
+ """
2027
+ offset: Annotated[int, Field(examples=[0], ge=0)]
2028
+ """
2029
+ The starting position for this page of results.
2030
+ """
2031
+ limit: Annotated[int, Field(examples=[1000], ge=1)]
2032
+ """
2033
+ The maximum number of items returned per page.
2034
+ """
2035
+ desc: Annotated[bool, Field(examples=[False])]
2036
+ """
2037
+ Whether the results are sorted in descending order.
2038
+ """
2039
+ count: Annotated[int, Field(examples=[1], ge=0)]
2040
+ """
2041
+ The number of items returned in this response.
2042
+ """
2043
+
2044
+
2045
+ @docs_group('Models')
2046
+ class ListOfActors(PaginationResponse):
2047
+ model_config = ConfigDict(
2048
+ extra='allow',
2049
+ populate_by_name=True,
2050
+ alias_generator=to_camel,
2051
+ )
2052
+ items: list[ActorShort]
2053
+
2054
+
2055
+ @docs_group('Models')
2056
+ class ListOfBuilds(PaginationResponse):
2057
+ model_config = ConfigDict(
2058
+ extra='allow',
2059
+ populate_by_name=True,
2060
+ alias_generator=to_camel,
2061
+ )
2062
+ items: list[BuildShort]
2063
+
2064
+
2065
+ @docs_group('Models')
2066
+ class ListOfDatasets(PaginationResponse):
2067
+ model_config = ConfigDict(
2068
+ extra='allow',
2069
+ populate_by_name=True,
2070
+ alias_generator=to_camel,
2071
+ )
2072
+ unnamed: Annotated[bool | None, Field(examples=[False])] = None
2073
+ """
2074
+ Whether the listing was filtered to only unnamed datasets.
2075
+ """
2076
+ items: list[DatasetListItem]
2077
+
2078
+
2079
+ @docs_group('Models')
2080
+ class ListOfKeyValueStores(PaginationResponse):
2081
+ model_config = ConfigDict(
2082
+ extra='allow',
2083
+ populate_by_name=True,
2084
+ alias_generator=to_camel,
2085
+ )
2086
+ unnamed: Annotated[bool | None, Field(examples=[False])] = None
2087
+ """
2088
+ Whether the listing was filtered to only unnamed key-value stores.
2089
+ """
2090
+ items: list[KeyValueStore]
2091
+
2092
+
2093
+ @docs_group('Models')
2094
+ class ListOfRequestQueues(PaginationResponse):
2095
+ """A paginated list of request queues."""
2096
+
2097
+ model_config = ConfigDict(
2098
+ extra='allow',
2099
+ populate_by_name=True,
2100
+ alias_generator=to_camel,
2101
+ )
2102
+ unnamed: Annotated[bool | None, Field(examples=[False])] = None
2103
+ """
2104
+ Whether the listing was filtered to only unnamed request queues.
2105
+ """
2106
+ items: list[RequestQueueShort]
2107
+ """
2108
+ The array of request queues.
2109
+ """
2110
+
2111
+
2112
+ @docs_group('Models')
2113
+ class ListOfRuns(PaginationResponse):
2114
+ model_config = ConfigDict(
2115
+ extra='allow',
2116
+ populate_by_name=True,
2117
+ alias_generator=to_camel,
2118
+ )
2119
+ items: list[RunShort]
2120
+
2121
+
2122
+ @docs_group('Models')
2123
+ class ListOfSchedules(PaginationResponse):
2124
+ model_config = ConfigDict(
2125
+ extra='allow',
2126
+ populate_by_name=True,
2127
+ alias_generator=to_camel,
2128
+ )
2129
+ items: list[ScheduleShort]
2130
+
2131
+
2132
+ @docs_group('Models')
2133
+ class ListOfStoreActors(PaginationResponse):
2134
+ model_config = ConfigDict(
2135
+ extra='allow',
2136
+ populate_by_name=True,
2137
+ alias_generator=to_camel,
2138
+ )
2139
+ items: list[StoreListActor]
2140
+ # Scrapely's store envelope omits `desc` and `count`; tolerate their absence.
2141
+ desc: Annotated[bool, Field(examples=[False])] = False
2142
+ count: Annotated[int, Field(examples=[1], ge=0)] = 0
2143
+
2144
+
2145
+ @docs_group('Models')
2146
+ class ListOfTasks(PaginationResponse):
2147
+ model_config = ConfigDict(
2148
+ extra='allow',
2149
+ populate_by_name=True,
2150
+ alias_generator=to_camel,
2151
+ )
2152
+ items: list[TaskShort]
2153
+
2154
+
2155
+ @docs_group('Models')
2156
+ class ListOfWebhookDispatches(PaginationResponse):
2157
+ model_config = ConfigDict(
2158
+ extra='allow',
2159
+ populate_by_name=True,
2160
+ alias_generator=to_camel,
2161
+ )
2162
+ items: list[WebhookDispatch]
2163
+
2164
+
2165
+ @docs_group('Models')
2166
+ class ListOfWebhooks(PaginationResponse):
2167
+ model_config = ConfigDict(
2168
+ extra='allow',
2169
+ populate_by_name=True,
2170
+ alias_generator=to_camel,
2171
+ )
2172
+ items: list[WebhookShort]
2173
+
2174
+
2175
+ @docs_group('Models')
2176
+ class PayPerEventActorPricingInfo(CommonActorPricingInfo):
2177
+ model_config = ConfigDict(
2178
+ extra='allow',
2179
+ populate_by_name=True,
2180
+ alias_generator=to_camel,
2181
+ )
2182
+ pricing_model: Literal['PAY_PER_EVENT']
2183
+ pricing_per_event: PricingPerEvent
2184
+ minimal_max_total_charge_usd: float | None = None
2185
+
2186
+
2187
+ @docs_group('Models')
2188
+ class Plan(BaseModel):
2189
+ model_config = ConfigDict(
2190
+ extra='allow',
2191
+ populate_by_name=True,
2192
+ alias_generator=to_camel,
2193
+ )
2194
+ id: Annotated[str | None, Field(examples=['Personal'])] = None
2195
+ description: Annotated[
2196
+ str | None, Field(examples=['Cost-effective plan for freelancers, developers and students.'])
2197
+ ] = None
2198
+ is_enabled: Annotated[bool | None, Field(examples=[True])] = None
2199
+ monthly_base_price_usd: Annotated[float | None, Field(examples=[49])] = None
2200
+ monthly_usage_credits_usd: Annotated[float | None, Field(examples=[49])] = None
2201
+ usage_discount_percent: Annotated[float | None, Field(examples=[0])] = None
2202
+ enabled_platform_features: Annotated[
2203
+ list[str] | None, Field(examples=[['ACTORS', 'STORAGE', 'PROXY_SERPS', 'SCHEDULER', 'WEBHOOKS']])
2204
+ ] = None
2205
+ max_monthly_usage_usd: Annotated[float | None, Field(examples=[9999])] = None
2206
+ max_actor_memory_gbytes: Annotated[float | None, Field(examples=[32])] = None
2207
+ max_monthly_actor_compute_units: Annotated[float | None, Field(examples=[1000])] = None
2208
+ max_monthly_residential_proxy_gbytes: Annotated[float | None, Field(examples=[10])] = None
2209
+ max_monthly_proxy_serps: Annotated[int | None, Field(examples=[30000])] = None
2210
+ max_monthly_external_data_transfer_gbytes: Annotated[float | None, Field(examples=[1000])] = None
2211
+ max_actor_count: Annotated[int | None, Field(examples=[100])] = None
2212
+ max_actor_task_count: Annotated[int | None, Field(examples=[1000])] = None
2213
+ data_retention_days: Annotated[int | None, Field(examples=[14])] = None
2214
+ available_proxy_groups: dict[str, int]
2215
+ team_account_seat_count: Annotated[int | None, Field(examples=[1])] = None
2216
+ support_level: Annotated[str | None, Field(examples=['COMMUNITY'])] = None
2217
+ available_add_ons: Annotated[list[str] | None, Field(examples=[[]])] = None
2218
+ tier: Annotated[str | None, Field(examples=['FREE'])] = None
2219
+ api_rate_limit_boosts: Annotated[int | None, Field(examples=[0])] = None
2220
+ max_schedule_count: Annotated[int | None, Field(examples=[100])] = None
2221
+ max_concurrent_actor_runs: Annotated[int | None, Field(examples=[25])] = None
2222
+ plan_pricing: dict[str, Any] | None = None
2223
+ """
2224
+ Pricing details for this plan.
2225
+ """
2226
+
2227
+
2228
+ @docs_group('Models')
2229
+ class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
2230
+ model_config = ConfigDict(
2231
+ extra='allow',
2232
+ populate_by_name=True,
2233
+ alias_generator=to_camel,
2234
+ )
2235
+ pricing_model: Literal['PRICE_PER_DATASET_ITEM']
2236
+ unit_name: str
2237
+ """
2238
+ Name of the unit that is being charged
2239
+ """
2240
+ price_per_unit_usd: float | None = None
2241
+ """
2242
+ Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present
2243
+ on a pricing record.
2244
+
2245
+ """
2246
+ tiered_pricing: dict[str, TieredPricingPerDatasetItemEntry] | None = None
2247
+
2248
+
2249
+ @docs_group('Models')
2250
+ class PriceTiers(BaseModel):
2251
+ model_config = ConfigDict(
2252
+ extra='allow',
2253
+ populate_by_name=True,
2254
+ alias_generator=to_camel,
2255
+ )
2256
+ quantity_above: Annotated[float, Field(examples=[0])]
2257
+ discount_percent: Annotated[float, Field(examples=[100])]
2258
+ tier_quantity: Annotated[float, Field(examples=[0.39])]
2259
+ unit_price_usd: Annotated[float, Field(examples=[0])]
2260
+ price_usd: Annotated[float, Field(examples=[0])]
2261
+
2262
+
2263
+ @docs_group('Models')
2264
+ class PricingPerEvent(BaseModel):
2265
+ model_config = ConfigDict(
2266
+ extra='allow',
2267
+ populate_by_name=True,
2268
+ alias_generator=to_camel,
2269
+ )
2270
+ actor_charge_events: dict[str, ActorChargeEvent] | None = None
2271
+
2272
+
2273
+ @docs_group('Models')
2274
+ class PrivateUserDataResponse(BaseModel):
2275
+ model_config = ConfigDict(
2276
+ extra='allow',
2277
+ populate_by_name=True,
2278
+ alias_generator=to_camel,
2279
+ )
2280
+ data: UserPrivateInfo
2281
+
2282
+
2283
+ @docs_group('Models')
2284
+ class Profile(BaseModel):
2285
+ model_config = ConfigDict(
2286
+ extra='allow',
2287
+ populate_by_name=True,
2288
+ alias_generator=to_camel,
2289
+ )
2290
+ bio: Annotated[str | None, Field(examples=['I started web scraping in 1985 using Altair BASIC.'])] = None
2291
+ name: Annotated[str | None, Field(examples=['Jane Doe'])] = None
2292
+ picture_url: Annotated[AnyUrl | None, Field(examples=['https://api-staging.scrape.ly/img/anonymous_user_picture.png'])] = None
2293
+ github_username: Annotated[str | None, Field(examples=['torvalds.'])] = None
2294
+ website_url: Annotated[AnyUrl | None, Field(examples=['http://www.example.com'])] = None
2295
+ twitter_username: Annotated[str | None, Field(examples=['@BillGates'])] = None
2296
+
2297
+
2298
+ @docs_group('Models')
2299
+ class ProlongRequestLockResponse(BaseModel):
2300
+ """Response containing updated lock information after prolonging a request lock."""
2301
+
2302
+ model_config = ConfigDict(
2303
+ extra='allow',
2304
+ populate_by_name=True,
2305
+ alias_generator=to_camel,
2306
+ )
2307
+ data: RequestLockInfo
2308
+
2309
+
2310
+ @docs_group('Models')
2311
+ class Proxy(BaseModel):
2312
+ model_config = ConfigDict(
2313
+ extra='allow',
2314
+ populate_by_name=True,
2315
+ alias_generator=to_camel,
2316
+ )
2317
+ password: Annotated[str, Field(examples=['ad78knd9Jkjd86'])]
2318
+ groups: list[ProxyGroup]
2319
+
2320
+
2321
+ @docs_group('Models')
2322
+ class ProxyGroup(BaseModel):
2323
+ model_config = ConfigDict(
2324
+ extra='allow',
2325
+ populate_by_name=True,
2326
+ alias_generator=to_camel,
2327
+ )
2328
+ name: Annotated[str, Field(examples=['Group1'])]
2329
+ description: Annotated[str | None, Field(examples=['Group1 description'])]
2330
+ available_count: Annotated[int, Field(examples=[10])]
2331
+
2332
+
2333
+ @docs_group('Models')
2334
+ class PublicActorRunStats30Days(BaseModel):
2335
+ """Run status counts from the last 30 days. Only for public Actors.
2336
+ Excludes runs started by the Actor's owner.
2337
+
2338
+ """
2339
+
2340
+ model_config = ConfigDict(
2341
+ extra='allow',
2342
+ populate_by_name=True,
2343
+ alias_generator=to_camel,
2344
+ )
2345
+ aborted: Annotated[int | None, Field(alias='ABORTED', examples=[2542])] = None
2346
+ """
2347
+ The number of runs that were aborted.
2348
+ """
2349
+ failed: Annotated[int | None, Field(alias='FAILED', examples=[1234])] = None
2350
+ """
2351
+ The number of runs that failed.
2352
+ """
2353
+ succeeded: Annotated[int | None, Field(alias='SUCCEEDED', examples=[732805])] = None
2354
+ """
2355
+ The number of runs that succeeded.
2356
+ """
2357
+ timed_out: Annotated[int | None, Field(alias='TIMED-OUT', examples=[12556])] = None
2358
+ """
2359
+ The number of runs that timed out.
2360
+ """
2361
+ total: Annotated[int | None, Field(alias='TOTAL', examples=[749137])] = None
2362
+ """
2363
+ The total number of runs.
2364
+ """
2365
+
2366
+
2367
+ @docs_group('Models')
2368
+ class PublicUserDataResponse(BaseModel):
2369
+ model_config = ConfigDict(
2370
+ extra='allow',
2371
+ populate_by_name=True,
2372
+ alias_generator=to_camel,
2373
+ )
2374
+ data: UserPublicInfo
2375
+
2376
+
2377
+ @docs_group('Models')
2378
+ class PutItemResponseError(BaseModel):
2379
+ model_config = ConfigDict(
2380
+ extra='allow',
2381
+ populate_by_name=True,
2382
+ alias_generator=to_camel,
2383
+ )
2384
+ error: DatasetSchemaValidationError
2385
+
2386
+
2387
+ @docs_group('Models')
2388
+ class PutItemsRequest(BaseModel):
2389
+ """The request body containing the item(s) to add to the dataset. Can be a single
2390
+ object or an array of objects. Each object represents one dataset item.
2391
+
2392
+ """
2393
+
2394
+ model_config = ConfigDict(
2395
+ extra='allow',
2396
+ populate_by_name=True,
2397
+ alias_generator=to_camel,
2398
+ )
2399
+
2400
+
2401
+ @docs_group('Models')
2402
+ class PutRecordRequest(BaseModel):
2403
+ """The request body contains the value to store in the record. The content type
2404
+ should be specified in the Content-Type header.
2405
+
2406
+ """
2407
+
2408
+ model_config = ConfigDict(
2409
+ extra='allow',
2410
+ populate_by_name=True,
2411
+ alias_generator=to_camel,
2412
+ )
2413
+
2414
+
2415
+ @docs_group('Models')
2416
+ class RecordResponse(BaseModel):
2417
+ """The response body contains the value of the record. The content type of the response
2418
+ is determined by the Content-Type header stored with the record.
2419
+
2420
+ """
2421
+
2422
+ model_config = ConfigDict(
2423
+ extra='allow',
2424
+ populate_by_name=True,
2425
+ alias_generator=to_camel,
2426
+ )
2427
+
2428
+
2429
+ @docs_group('Models')
2430
+ class RequestBase(BaseModel):
2431
+ model_config = ConfigDict(
2432
+ extra='allow',
2433
+ populate_by_name=True,
2434
+ alias_generator=to_camel,
2435
+ )
2436
+ unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])] = None
2437
+ """
2438
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
2439
+ """
2440
+ url: Annotated[str | None, Field(examples=['https://api-staging.scrape.ly'])] = None
2441
+ """
2442
+ The URL of the request.
2443
+ """
2444
+ method: HttpMethod | None = None
2445
+ retry_count: Annotated[int | None, Field(examples=[0])] = None
2446
+ """
2447
+ The number of times this request has been retried.
2448
+ """
2449
+ loaded_url: Annotated[str | None, Field(examples=['https://api-staging.scrape.ly/jobs'])] = None
2450
+ """
2451
+ The final URL that was loaded, after redirects (if any).
2452
+ """
2453
+ payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
2454
+ """
2455
+ The request payload, typically used with POST or PUT requests.
2456
+ """
2457
+ headers: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
2458
+ """
2459
+ HTTP headers sent with the request.
2460
+ """
2461
+ user_data: RequestUserData | None = None
2462
+ no_retry: Annotated[bool | None, Field(examples=[False])] = None
2463
+ """
2464
+ Indicates whether the request should not be retried if processing fails.
2465
+ """
2466
+ error_messages: Annotated[list[str] | None, Field(examples=[None])] = None
2467
+ """
2468
+ Error messages recorded from failed processing attempts.
2469
+ """
2470
+ handled_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-16T10:23:31.607Z'])] = None
2471
+ """
2472
+ The timestamp when the request was marked as handled, if applicable.
2473
+ """
2474
+
2475
+
2476
+ @docs_group('Models')
2477
+ class Request(RequestBase):
2478
+ """A request stored in the request queue, including its metadata and processing state."""
2479
+
2480
+ model_config = ConfigDict(
2481
+ extra='allow',
2482
+ populate_by_name=True,
2483
+ alias_generator=to_camel,
2484
+ )
2485
+ id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
2486
+ """
2487
+ A unique identifier assigned to the request.
2488
+ """
2489
+
2490
+
2491
+ @docs_group('Models')
2492
+ class RequestDraft(BaseModel):
2493
+ """A request that failed to be processed during a request queue operation and can be retried."""
2494
+
2495
+ model_config = ConfigDict(
2496
+ extra='allow',
2497
+ populate_by_name=True,
2498
+ alias_generator=to_camel,
2499
+ )
2500
+ id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
2501
+ """
2502
+ A unique identifier assigned to the request.
2503
+ """
2504
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
2505
+ """
2506
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
2507
+ """
2508
+ url: Annotated[str, Field(examples=['https://api-staging.scrape.ly'])]
2509
+ """
2510
+ The URL of the request.
2511
+ """
2512
+ method: HttpMethod | None = None
2513
+
2514
+
2515
+ @docs_group('Models')
2516
+ class RequestDraftDeleteById(BaseModel):
2517
+ """A request that should be deleted, identified by its ID."""
2518
+
2519
+ model_config = ConfigDict(
2520
+ extra='allow',
2521
+ populate_by_name=True,
2522
+ alias_generator=to_camel,
2523
+ )
2524
+ id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
2525
+ """
2526
+ A unique identifier assigned to the request.
2527
+ """
2528
+ unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])] = None
2529
+ """
2530
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
2531
+ """
2532
+
2533
+
2534
+ @docs_group('Models')
2535
+ class RequestDraftDeleteByUniqueKey(BaseModel):
2536
+ """A request that should be deleted, identified by its unique key."""
2537
+
2538
+ model_config = ConfigDict(
2539
+ extra='allow',
2540
+ populate_by_name=True,
2541
+ alias_generator=to_camel,
2542
+ )
2543
+ id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
2544
+ """
2545
+ A unique identifier assigned to the request.
2546
+ """
2547
+ unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://api-staging.scrape.ly'])]
2548
+ """
2549
+ A unique key used for request de-duplication. Requests with the same unique key are considered identical.
2550
+ """
2551
+
2552
+
2553
+ @docs_group('Models')
2554
+ class RequestDraftDelete(RootModel[RequestDraftDeleteById | RequestDraftDeleteByUniqueKey]):
2555
+ root: Annotated[RequestDraftDeleteById | RequestDraftDeleteByUniqueKey, Field(title='RequestDraftDelete')]
2556
+ """
2557
+ A request that should be deleted.
2558
+ """
2559
+
2560
+
2561
+ @docs_group('Models')
2562
+ class RequestLockInfo(BaseModel):
2563
+ """Information about a request lock."""
2564
+
2565
+ model_config = ConfigDict(
2566
+ extra='allow',
2567
+ populate_by_name=True,
2568
+ alias_generator=to_camel,
2569
+ )
2570
+ lock_expires_at: Annotated[AwareDatetime, Field(examples=['2022-06-14T23:00:00.000Z'])]
2571
+ """
2572
+ The timestamp when the lock on this request expires.
2573
+ """
2574
+
2575
+
2576
+ @docs_group('Models')
2577
+ class RequestQueue(BaseModel):
2578
+ """A request queue object containing metadata and statistics."""
2579
+
2580
+ model_config = ConfigDict(
2581
+ extra='allow',
2582
+ populate_by_name=True,
2583
+ alias_generator=to_camel,
2584
+ )
2585
+ id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
2586
+ """
2587
+ A unique identifier assigned to the request queue.
2588
+ """
2589
+ name: Annotated[str | None, Field(examples=['some-name'])] = None
2590
+ """
2591
+ The name of the request queue.
2592
+ """
2593
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
2594
+ """
2595
+ The ID of the user who owns the request queue.
2596
+ """
2597
+ act_id: str | None = None
2598
+ """
2599
+ The ID of the Actor that created this request queue.
2600
+ """
2601
+ act_run_id: str | None = None
2602
+ """
2603
+ The ID of the Actor run that created this request queue.
2604
+ """
2605
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
2606
+ """
2607
+ The timestamp when the request queue was created.
2608
+ """
2609
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
2610
+ """
2611
+ The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue.
2612
+ """
2613
+ accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
2614
+ """
2615
+ The timestamp when the request queue was last accessed.
2616
+ """
2617
+ total_request_count: Annotated[int, Field(examples=[870], ge=0)]
2618
+ """
2619
+ The total number of requests in the request queue.
2620
+ """
2621
+ handled_request_count: Annotated[int, Field(examples=[100], ge=0)]
2622
+ """
2623
+ The number of requests that have been handled.
2624
+ """
2625
+ pending_request_count: Annotated[int, Field(examples=[670])]
2626
+ """
2627
+ The number of requests that are pending and have not been handled yet.
2628
+ """
2629
+ had_multiple_clients: Annotated[bool, Field(examples=[True])]
2630
+ """
2631
+ Whether the request queue has been accessed by multiple different clients.
2632
+ """
2633
+ console_url: Annotated[AnyUrl, Field(examples=['https://api-staging.scrape.ly/v2/request-queues/27TmTznX9YPeAYhkC'])]
2634
+ """
2635
+ The URL to view the request queue in the Scrapely console.
2636
+ """
2637
+ stats: RequestQueueStats | None = None
2638
+ general_access: GeneralAccess | None = None
2639
+
2640
+
2641
+ @docs_group('Models')
2642
+ class RequestQueueHead(BaseModel):
2643
+ """A batch of requests from the request queue head without locking."""
2644
+
2645
+ model_config = ConfigDict(
2646
+ extra='allow',
2647
+ populate_by_name=True,
2648
+ alias_generator=to_camel,
2649
+ )
2650
+ limit: Annotated[int, Field(examples=[1000])]
2651
+ """
2652
+ The maximum number of requests returned.
2653
+ """
2654
+ queue_modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
2655
+ """
2656
+ The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue.
2657
+ """
2658
+ had_multiple_clients: Annotated[bool, Field(examples=[True])]
2659
+ """
2660
+ Whether the request queue has been accessed by multiple different clients.
2661
+ """
2662
+ items: list[HeadRequest]
2663
+ """
2664
+ The array of requests from the request queue head.
2665
+ """
2666
+
2667
+
2668
+ @docs_group('Models')
2669
+ class RequestQueueResponse(BaseModel):
2670
+ """Response containing request queue data."""
2671
+
2672
+ model_config = ConfigDict(
2673
+ extra='allow',
2674
+ populate_by_name=True,
2675
+ alias_generator=to_camel,
2676
+ )
2677
+ data: RequestQueue
2678
+
2679
+
2680
+ @docs_group('Models')
2681
+ class RequestQueueShort(BaseModel):
2682
+ """A shortened request queue object for list responses."""
2683
+
2684
+ model_config = ConfigDict(
2685
+ extra='allow',
2686
+ populate_by_name=True,
2687
+ alias_generator=to_camel,
2688
+ )
2689
+ id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
2690
+ """
2691
+ A unique identifier assigned to the request queue.
2692
+ """
2693
+ name: Annotated[str | None, Field(examples=['some-name'])] = None
2694
+ """
2695
+ The name of the request queue. Unnamed queues have `null`.
2696
+ """
2697
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
2698
+ """
2699
+ The ID of the user who owns the request queue.
2700
+ """
2701
+ username: Annotated[str, Field(examples=['janedoe'])]
2702
+ """
2703
+ The username of the user who owns the request queue.
2704
+ """
2705
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
2706
+ """
2707
+ The timestamp when the request queue was created.
2708
+ """
2709
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
2710
+ """
2711
+ The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue.
2712
+ """
2713
+ accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
2714
+ """
2715
+ The timestamp when the request queue was last accessed.
2716
+ """
2717
+ expire_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-02T17:15:06.751Z'])] = None
2718
+ """
2719
+ The timestamp when the request queue will expire and be deleted.
2720
+ """
2721
+ total_request_count: Annotated[int, Field(examples=[870], ge=0)]
2722
+ """
2723
+ The total number of requests in the request queue.
2724
+ """
2725
+ handled_request_count: Annotated[int, Field(examples=[100], ge=0)]
2726
+ """
2727
+ The number of requests that have been handled.
2728
+ """
2729
+ pending_request_count: Annotated[int, Field(examples=[670])]
2730
+ """
2731
+ The number of requests that are pending and have not been handled yet.
2732
+ """
2733
+ act_id: str | None = None
2734
+ """
2735
+ The ID of the Actor that created this request queue.
2736
+ """
2737
+ act_run_id: str | None = None
2738
+ """
2739
+ The ID of the Actor run that created this request queue.
2740
+ """
2741
+ had_multiple_clients: Annotated[bool, Field(examples=[True])]
2742
+ """
2743
+ Whether the request queue has been accessed by multiple different clients.
2744
+ """
2745
+ general_access: GeneralAccess | None = None
2746
+ stats: RequestQueueStats | None = None
2747
+
2748
+
2749
+ @docs_group('Models')
2750
+ class RequestQueueStats(BaseModel):
2751
+ """Statistics about request queue operations and storage."""
2752
+
2753
+ model_config = ConfigDict(
2754
+ extra='allow',
2755
+ populate_by_name=True,
2756
+ alias_generator=to_camel,
2757
+ )
2758
+ delete_count: Annotated[int | None, Field(examples=[0])] = None
2759
+ """
2760
+ The number of delete operations performed on the request queue.
2761
+ """
2762
+ head_item_read_count: Annotated[int | None, Field(examples=[5])] = None
2763
+ """
2764
+ The number of times requests from the head were read.
2765
+ """
2766
+ read_count: Annotated[int | None, Field(examples=[100])] = None
2767
+ """
2768
+ The total number of read operations performed on the request queue.
2769
+ """
2770
+ storage_bytes: Annotated[int | None, Field(examples=[1024])] = None
2771
+ """
2772
+ The total storage size in bytes used by the request queue.
2773
+ """
2774
+ write_count: Annotated[int | None, Field(examples=[10])] = None
2775
+ """
2776
+ The total number of write operations performed on the request queue.
2777
+ """
2778
+
2779
+
2780
+ @docs_group('Models')
2781
+ class RequestQueues(BaseModel):
2782
+ """Aliased request queue IDs for this run."""
2783
+
2784
+ model_config = ConfigDict(
2785
+ extra='allow',
2786
+ populate_by_name=True,
2787
+ alias_generator=to_camel,
2788
+ )
2789
+ __annotations__ = {
2790
+ '__pydantic_extra__': dict[str, str],
2791
+ }
2792
+ default: Annotated[str | None, Field(examples=['FL35cSF7jrxr3BY39'])] = None
2793
+ """
2794
+ ID of the default request queue for this run.
2795
+ """
2796
+
2797
+
2798
+ @docs_group('Models')
2799
+ class RequestRegistration(BaseModel):
2800
+ """Result of registering a request in the request queue, either by adding a new request or updating an existing one."""
2801
+
2802
+ model_config = ConfigDict(
2803
+ extra='allow',
2804
+ populate_by_name=True,
2805
+ alias_generator=to_camel,
2806
+ )
2807
+ request_id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
2808
+ """
2809
+ A unique identifier assigned to the request.
2810
+ """
2811
+ was_already_present: Annotated[bool, Field(examples=[False])]
2812
+ """
2813
+ Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created.
2814
+ """
2815
+ was_already_handled: Annotated[bool, Field(examples=[False])]
2816
+ """
2817
+ Indicates whether a request with the same unique key has already been processed by the request queue.
2818
+ """
2819
+
2820
+
2821
+ @docs_group('Models')
2822
+ class RequestResponse(BaseModel):
2823
+ """Response containing a single request from the request queue."""
2824
+
2825
+ model_config = ConfigDict(
2826
+ extra='allow',
2827
+ populate_by_name=True,
2828
+ alias_generator=to_camel,
2829
+ )
2830
+ data: Request
2831
+
2832
+
2833
+ @docs_group('Models')
2834
+ class RequestUserData(BaseModel):
2835
+ """Custom user data attached to the request. Can contain arbitrary fields."""
2836
+
2837
+ model_config = ConfigDict(
2838
+ extra='allow',
2839
+ populate_by_name=True,
2840
+ alias_generator=to_camel,
2841
+ )
2842
+
2843
+
2844
+ @docs_group('Models')
2845
+ class Run(BaseModel):
2846
+ """Represents an Actor run and its associated data."""
2847
+
2848
+ model_config = ConfigDict(
2849
+ extra='allow',
2850
+ populate_by_name=True,
2851
+ alias_generator=to_camel,
2852
+ )
2853
+ id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
2854
+ """
2855
+ Unique identifier of the Actor run.
2856
+ """
2857
+ act_id: Annotated[str, Field(examples=['HDSasDasz78YcAPEB'])]
2858
+ """
2859
+ ID of the Actor that was run.
2860
+ """
2861
+ user_id: Annotated[str, Field(examples=['7sT5jcggjjA9fNcxF'])]
2862
+ """
2863
+ ID of the user who started the run.
2864
+ """
2865
+ actor_task_id: Annotated[str | None, Field(examples=['KJHSKHausidyaJKHs'])] = None
2866
+ """
2867
+ ID of the Actor task, if the run was started from a task.
2868
+ """
2869
+ started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
2870
+ """
2871
+ Time when the Actor run started.
2872
+ """
2873
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
2874
+ """
2875
+ Time when the Actor run finished.
2876
+ """
2877
+ status: ActorJobStatus
2878
+ """
2879
+ Current status of the Actor run.
2880
+ """
2881
+ status_message: Annotated[str | None, Field(examples=['Actor is running'])] = None
2882
+ """
2883
+ Detailed message about the run status.
2884
+ """
2885
+ is_status_message_terminal: Annotated[bool | None, Field(examples=[False])] = None
2886
+ """
2887
+ Whether the status message is terminal (final).
2888
+ """
2889
+ meta: RunMeta
2890
+ """
2891
+ Metadata about the Actor run.
2892
+ """
2893
+ pricing_info: Annotated[
2894
+ PayPerEventActorPricingInfo
2895
+ | PricePerDatasetItemActorPricingInfo
2896
+ | FlatPricePerMonthActorPricingInfo
2897
+ | FreeActorPricingInfo
2898
+ | None,
2899
+ Field(discriminator='pricing_model', title='ActorRunPricingInfo'),
2900
+ ] = None
2901
+ """
2902
+ Pricing information for the Actor.
2903
+ """
2904
+ stats: RunStats
2905
+ """
2906
+ Statistics of the Actor run.
2907
+ """
2908
+ charged_event_counts: Annotated[
2909
+ dict[str, int] | None, Field(examples=[{'actor-start': 1, 'page-crawled': 150, 'data-extracted': 75}])
2910
+ ] = None
2911
+ """
2912
+ A map of charged event types to their counts. The keys are event type identifiers defined by the Actor's pricing model (pay-per-event), and the values are the number of times each event was charged during this run.
2913
+ """
2914
+ options: RunOptions
2915
+ """
2916
+ Configuration options for the Actor run.
2917
+ """
2918
+ build_id: Annotated[str, Field(examples=['7sT5jcggjjA9fNcxF'])]
2919
+ """
2920
+ ID of the Actor build used for this run.
2921
+ """
2922
+ exit_code: Annotated[int | None, Field(examples=[0])] = None
2923
+ """
2924
+ Exit code of the Actor run process.
2925
+ """
2926
+ general_access: GeneralAccess | None = None
2927
+ """
2928
+ General access level for the Actor run.
2929
+ Optional: omitted on some Scrapely staging start-run payloads.
2930
+ """
2931
+ default_key_value_store_id: Annotated[str, Field(examples=['eJNzqsbPiopwJcgGQ'])]
2932
+ """
2933
+ ID of the default key-value store for this run.
2934
+ """
2935
+ default_dataset_id: Annotated[str, Field(examples=['wmKPijuyDnPZAPRMk'])]
2936
+ """
2937
+ ID of the default dataset for this run.
2938
+ """
2939
+ default_request_queue_id: Annotated[str, Field(examples=['FL35cSF7jrxr3BY39'])]
2940
+ """
2941
+ ID of the default request queue for this run.
2942
+ """
2943
+ storage_ids: StorageIds | None = None
2944
+ """
2945
+ A map of aliased storage IDs associated with this run, grouped by storage type.
2946
+ """
2947
+ build_number: Annotated[
2948
+ str | None, Field(examples=['0.0.36'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$')
2949
+ ] = None
2950
+ """
2951
+ Build number of the Actor build used for this run.
2952
+ """
2953
+ container_url: Annotated[AnyUrl | None, Field(examples=['https://g8kd8kbc5ge8.runs.apify.net'])] = None
2954
+ """
2955
+ URL of the container running the Actor.
2956
+ """
2957
+ is_container_server_ready: Annotated[bool | None, Field(examples=[True])] = None
2958
+ """
2959
+ Whether the container's HTTP server is ready to accept requests.
2960
+ """
2961
+ git_branch_name: Annotated[str | None, Field(examples=['master'])] = None
2962
+ """
2963
+ Name of the git branch used for the Actor build.
2964
+ """
2965
+ usage: RunUsage | None = None
2966
+ """
2967
+ Resource usage statistics for the run.
2968
+ """
2969
+ usage_total_usd: Annotated[float | None, Field(examples=[0.2654])] = None
2970
+ """
2971
+ Total cost in USD for this run. Represents what you actually pay. For run owners: includes platform usage (compute units) and/or event costs depending on the Actor's pricing model. For run non-owners: only available for Pay-Per-Event Actors (event costs only). Requires authentication token to access.
2972
+ """
2973
+ usage_usd: RunUsageUsd | None = None
2974
+ """
2975
+ Platform usage costs breakdown in USD. Only present if you own the run AND are paying for platform usage (Pay-Per-Usage, Rental, or Pay-Per-Event with usage costs like standby Actors). Not available for standard Pay-Per-Event Actors. Requires authentication token to access.
2976
+ """
2977
+ metamorphs: list[Metamorph] | None = None
2978
+ """
2979
+ List of metamorph events that occurred during the run.
2980
+ """
2981
+ platform_usage_billing_model: Annotated[str | None, Field(examples=['USER'])] = None
2982
+ """
2983
+ Indicates which party covers platform usage costs for this run.
2984
+ """
2985
+
2986
+
2987
+ @docs_group('Models')
2988
+ class RunMeta(BaseModel):
2989
+ model_config = ConfigDict(
2990
+ extra='allow',
2991
+ populate_by_name=True,
2992
+ alias_generator=to_camel,
2993
+ )
2994
+ origin: RunOrigin
2995
+ client_ip: str | None = None
2996
+ """
2997
+ IP address of the client that started the run.
2998
+ """
2999
+ user_agent: str | None = None
3000
+ """
3001
+ User agent of the client that started the run.
3002
+ """
3003
+ schedule_id: str | None = None
3004
+ """
3005
+ ID of the schedule that triggered the run.
3006
+ """
3007
+ scheduled_at: AwareDatetime | None = None
3008
+ """
3009
+ Time when the run was scheduled.
3010
+ """
3011
+
3012
+
3013
+ @docs_group('Models')
3014
+ class RunOptions(BaseModel):
3015
+ model_config = ConfigDict(
3016
+ extra='allow',
3017
+ populate_by_name=True,
3018
+ alias_generator=to_camel,
3019
+ )
3020
+ build: Annotated[str, Field(examples=['latest'])]
3021
+ timeout_secs: Annotated[int, Field(examples=[300], ge=0)]
3022
+ memory_mbytes: Annotated[int, Field(examples=[1024], ge=128, le=32768)]
3023
+ disk_mbytes: Annotated[int | None, Field(examples=[2048], ge=0)] = None
3024
+ max_items: Annotated[int | None, Field(examples=[1000], ge=0)] = None
3025
+ max_total_charge_usd: Annotated[float | None, Field(examples=[5], ge=0.0)] = None
3026
+
3027
+
3028
+ @docs_group('Models')
3029
+ class RunResponse(BaseModel):
3030
+ model_config = ConfigDict(
3031
+ extra='allow',
3032
+ populate_by_name=True,
3033
+ alias_generator=to_camel,
3034
+ )
3035
+ data: Run
3036
+
3037
+
3038
+ @docs_group('Models')
3039
+ class RunShort(BaseModel):
3040
+ model_config = ConfigDict(
3041
+ extra='allow',
3042
+ populate_by_name=True,
3043
+ alias_generator=to_camel,
3044
+ )
3045
+ id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
3046
+ act_id: Annotated[str, Field(examples=['HDSasDasz78YcAPEB'])]
3047
+ user_id: Annotated[str | None, Field(examples=['7sT5jcggjjA9fNcxF'])] = None
3048
+ actor_task_id: Annotated[str | None, Field(examples=['KJHSKHausidyaJKHs'])] = None
3049
+ status: ActorJobStatus
3050
+ started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
3051
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
3052
+ build_id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
3053
+ build_number: Annotated[
3054
+ str | None, Field(examples=['0.0.2'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$')
3055
+ ] = None
3056
+ build_number_int: Annotated[int | None, Field(examples=[10000])] = None
3057
+ meta: RunMeta
3058
+ usage_total_usd: Annotated[float, Field(examples=[0.2])]
3059
+ default_key_value_store_id: Annotated[str, Field(examples=['sfAjeR4QmeJCQzTfe'])]
3060
+ default_dataset_id: Annotated[str, Field(examples=['3ZojQDdFTsyE7Moy4'])]
3061
+ default_request_queue_id: Annotated[str, Field(examples=['so93g2shcDzK3pA85'])]
3062
+
3063
+
3064
+ @docs_group('Models')
3065
+ class RunStats(BaseModel):
3066
+ model_config = ConfigDict(
3067
+ extra='allow',
3068
+ populate_by_name=True,
3069
+ alias_generator=to_camel,
3070
+ )
3071
+ input_body_len: Annotated[int | None, Field(examples=[240], ge=0)] = None
3072
+ migration_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
3073
+ reboot_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
3074
+ restart_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
3075
+ resurrect_count: Annotated[int | None, Field(examples=[2], ge=0)] = None
3076
+ mem_avg_bytes: Annotated[float | None, Field(examples=[267874071.9])] = None
3077
+ mem_max_bytes: Annotated[int | None, Field(examples=[404713472], ge=0)] = None
3078
+ mem_current_bytes: Annotated[int | None, Field(examples=[0], ge=0)] = None
3079
+ cpu_avg_usage: Annotated[float | None, Field(examples=[33.7532101107538])] = None
3080
+ cpu_max_usage: Annotated[float | None, Field(examples=[169.650735534941])] = None
3081
+ cpu_current_usage: Annotated[float | None, Field(examples=[0])] = None
3082
+ net_rx_bytes: Annotated[int | None, Field(examples=[103508042], ge=0)] = None
3083
+ net_tx_bytes: Annotated[int | None, Field(examples=[4854600], ge=0)] = None
3084
+ duration_millis: Annotated[int | None, Field(examples=[248472], ge=0)] = None
3085
+ run_time_secs: Annotated[float | None, Field(examples=[248.472], ge=0.0)] = None
3086
+ metamorph: Annotated[int | None, Field(examples=[0], ge=0)] = None
3087
+ compute_units: Annotated[float | None, Field(examples=[0.13804], ge=0.0)] = None
3088
+
3089
+
3090
+ @docs_group('Models')
3091
+ class RunUsage(BaseModel):
3092
+ model_config = ConfigDict(
3093
+ extra='allow',
3094
+ populate_by_name=True,
3095
+ alias_generator=to_camel,
3096
+ )
3097
+ actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[3])] = None
3098
+ dataset_reads: Annotated[int | None, Field(alias='DATASET_READS', examples=[4])] = None
3099
+ dataset_writes: Annotated[int | None, Field(alias='DATASET_WRITES', examples=[4])] = None
3100
+ key_value_store_reads: Annotated[int | None, Field(alias='KEY_VALUE_STORE_READS', examples=[5])] = None
3101
+ key_value_store_writes: Annotated[int | None, Field(alias='KEY_VALUE_STORE_WRITES', examples=[3])] = None
3102
+ key_value_store_lists: Annotated[int | None, Field(alias='KEY_VALUE_STORE_LISTS', examples=[5])] = None
3103
+ request_queue_reads: Annotated[int | None, Field(alias='REQUEST_QUEUE_READS', examples=[2])] = None
3104
+ request_queue_writes: Annotated[int | None, Field(alias='REQUEST_QUEUE_WRITES', examples=[1])] = None
3105
+ data_transfer_internal_gbytes: Annotated[
3106
+ float | None, Field(alias='DATA_TRANSFER_INTERNAL_GBYTES', examples=[1])
3107
+ ] = None
3108
+ data_transfer_external_gbytes: Annotated[
3109
+ float | None, Field(alias='DATA_TRANSFER_EXTERNAL_GBYTES', examples=[3])
3110
+ ] = None
3111
+ proxy_residential_transfer_gbytes: Annotated[
3112
+ float | None, Field(alias='PROXY_RESIDENTIAL_TRANSFER_GBYTES', examples=[34])
3113
+ ] = None
3114
+ proxy_serps: Annotated[int | None, Field(alias='PROXY_SERPS', examples=[3])] = None
3115
+
3116
+
3117
+ @docs_group('Models')
3118
+ class RunUsageUsd(BaseModel):
3119
+ """Resource usage costs in USD. All values are monetary amounts in US dollars."""
3120
+
3121
+ model_config = ConfigDict(
3122
+ extra='allow',
3123
+ populate_by_name=True,
3124
+ alias_generator=to_camel,
3125
+ )
3126
+ actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[0.0003])] = None
3127
+ dataset_reads: Annotated[float | None, Field(alias='DATASET_READS', examples=[0.0001])] = None
3128
+ dataset_writes: Annotated[float | None, Field(alias='DATASET_WRITES', examples=[0.0001])] = None
3129
+ key_value_store_reads: Annotated[float | None, Field(alias='KEY_VALUE_STORE_READS', examples=[0.0001])] = None
3130
+ key_value_store_writes: Annotated[float | None, Field(alias='KEY_VALUE_STORE_WRITES', examples=[5e-05])] = None
3131
+ key_value_store_lists: Annotated[float | None, Field(alias='KEY_VALUE_STORE_LISTS', examples=[0.0001])] = None
3132
+ request_queue_reads: Annotated[float | None, Field(alias='REQUEST_QUEUE_READS', examples=[0.0001])] = None
3133
+ request_queue_writes: Annotated[float | None, Field(alias='REQUEST_QUEUE_WRITES', examples=[0.0001])] = None
3134
+ data_transfer_internal_gbytes: Annotated[
3135
+ float | None, Field(alias='DATA_TRANSFER_INTERNAL_GBYTES', examples=[0.001])
3136
+ ] = None
3137
+ data_transfer_external_gbytes: Annotated[
3138
+ float | None, Field(alias='DATA_TRANSFER_EXTERNAL_GBYTES', examples=[0.003])
3139
+ ] = None
3140
+ proxy_residential_transfer_gbytes: Annotated[
3141
+ float | None, Field(alias='PROXY_RESIDENTIAL_TRANSFER_GBYTES', examples=[0.034])
3142
+ ] = None
3143
+ proxy_serps: Annotated[float | None, Field(alias='PROXY_SERPS', examples=[0.003])] = None
3144
+
3145
+
3146
+ @docs_group('Models')
3147
+ class ScheduleActionRunActor(BaseModel):
3148
+ model_config = ConfigDict(
3149
+ extra='allow',
3150
+ populate_by_name=True,
3151
+ alias_generator=to_camel,
3152
+ )
3153
+ id: Annotated[str, Field(examples=['c6KfSgoQzFhMk3etc'])]
3154
+ type: Literal['RUN_ACTOR']
3155
+ actor_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
3156
+ run_input: ScheduleActionRunInput | None = None
3157
+ run_options: TaskOptions | None = None
3158
+
3159
+
3160
+ @docs_group('Models')
3161
+ class ScheduleActionRunActorTask(BaseModel):
3162
+ model_config = ConfigDict(
3163
+ extra='allow',
3164
+ populate_by_name=True,
3165
+ alias_generator=to_camel,
3166
+ )
3167
+ id: Annotated[str, Field(examples=['c6KfSgoQzFhMk3etc'])]
3168
+ type: Literal['RUN_ACTOR_TASK']
3169
+ actor_task_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
3170
+ input: dict[str, Any] | None = None
3171
+
3172
+
3173
+ @docs_group('Models')
3174
+ class ScheduleActionRunInput(BaseModel):
3175
+ model_config = ConfigDict(
3176
+ extra='allow',
3177
+ populate_by_name=True,
3178
+ alias_generator=to_camel,
3179
+ )
3180
+ body: Annotated[str | None, Field(examples=['{\\n "foo": "actor"\\n}'])] = None
3181
+ content_type: Annotated[str | None, Field(examples=['application/json; charset=utf-8'])] = None
3182
+
3183
+
3184
+ @docs_group('Models')
3185
+ class ScheduleActionShortRunActor(BaseModel):
3186
+ model_config = ConfigDict(
3187
+ extra='allow',
3188
+ populate_by_name=True,
3189
+ alias_generator=to_camel,
3190
+ )
3191
+ id: Annotated[str, Field(examples=['ZReCs7hkdieq8ZUki'])]
3192
+ type: Literal['RUN_ACTOR']
3193
+ actor_id: Annotated[str, Field(examples=['HKhKmiCMrDgu9eXeE'])]
3194
+
3195
+
3196
+ @docs_group('Models')
3197
+ class ScheduleActionShortRunActorTask(BaseModel):
3198
+ model_config = ConfigDict(
3199
+ extra='allow',
3200
+ populate_by_name=True,
3201
+ alias_generator=to_camel,
3202
+ )
3203
+ id: Annotated[str, Field(examples=['ZReCs7hkdieq8ZUki'])]
3204
+ type: Literal['RUN_ACTOR_TASK']
3205
+ actor_task_id: Annotated[str, Field(examples=['HKhKmiCMrDgu9eXeE'])]
3206
+
3207
+
3208
+ @docs_group('Models')
3209
+ class ScheduleBase(BaseModel):
3210
+ model_config = ConfigDict(
3211
+ extra='allow',
3212
+ populate_by_name=True,
3213
+ alias_generator=to_camel,
3214
+ )
3215
+ id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
3216
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
3217
+ name: Annotated[str, Field(examples=['my-schedule'])]
3218
+ cron_expression: Annotated[str, Field(examples=['* * * * *'])]
3219
+ timezone: Annotated[str, Field(examples=['UTC'])]
3220
+ is_enabled: Annotated[bool, Field(examples=[True])]
3221
+ is_exclusive: Annotated[bool, Field(examples=[True])]
3222
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
3223
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-20T06:33:11.202Z'])]
3224
+ next_run_at: Annotated[AwareDatetime | None, Field(examples=['2019-04-12T07:34:10.202Z'])] = None
3225
+ last_run_at: Annotated[AwareDatetime | None, Field(examples=['2019-04-12T07:33:10.202Z'])] = None
3226
+
3227
+
3228
+ @docs_group('Models')
3229
+ class Schedule(ScheduleBase):
3230
+ model_config = ConfigDict(
3231
+ extra='allow',
3232
+ populate_by_name=True,
3233
+ alias_generator=to_camel,
3234
+ )
3235
+ description: Annotated[str | None, Field(examples=['Schedule of actor ...'])] = None
3236
+ title: str | None = None
3237
+ notifications: Annotated[Notifications | None, Field(title='ScheduleNotifications')] = None
3238
+ """
3239
+ Notification settings for this schedule.
3240
+ """
3241
+ actions: list[Annotated[ScheduleActionRunActor | ScheduleActionRunActorTask, Field(discriminator='type')]]
3242
+
3243
+
3244
+ @docs_group('Models')
3245
+ class ScheduleCreate(BaseModel):
3246
+ model_config = ConfigDict(
3247
+ extra='allow',
3248
+ populate_by_name=True,
3249
+ alias_generator=to_camel,
3250
+ )
3251
+ name: Annotated[str | None, Field(examples=['my-schedule'])] = None
3252
+ is_enabled: Annotated[bool | None, Field(examples=[True])] = None
3253
+ is_exclusive: Annotated[bool | None, Field(examples=[True])] = None
3254
+ cron_expression: Annotated[str | None, Field(examples=['* * * * *'])] = None
3255
+ timezone: Annotated[str | None, Field(examples=['UTC'])] = None
3256
+ description: Annotated[str | None, Field(examples=['Schedule of actor ...'])] = None
3257
+ title: str | None = None
3258
+ actions: (
3259
+ list[Annotated[ScheduleCreateActionRunActor | ScheduleCreateActionRunActorTask, Field(discriminator='type')]]
3260
+ | None
3261
+ ) = None
3262
+
3263
+
3264
+ @docs_group('Models')
3265
+ class ScheduleCreateActionRunActor(BaseModel):
3266
+ model_config = ConfigDict(
3267
+ extra='allow',
3268
+ populate_by_name=True,
3269
+ alias_generator=to_camel,
3270
+ )
3271
+ type: Literal['RUN_ACTOR']
3272
+ actor_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
3273
+ run_input: ScheduleActionRunInput | None = None
3274
+ run_options: TaskOptions | None = None
3275
+
3276
+
3277
+ @docs_group('Models')
3278
+ class ScheduleCreateActionRunActorTask(BaseModel):
3279
+ model_config = ConfigDict(
3280
+ extra='allow',
3281
+ populate_by_name=True,
3282
+ alias_generator=to_camel,
3283
+ )
3284
+ type: Literal['RUN_ACTOR_TASK']
3285
+ actor_task_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
3286
+ input: dict[str, Any] | None = None
3287
+
3288
+
3289
+ @docs_group('Models')
3290
+ class ScheduleInvoked(BaseModel):
3291
+ model_config = ConfigDict(
3292
+ extra='allow',
3293
+ populate_by_name=True,
3294
+ alias_generator=to_camel,
3295
+ )
3296
+ message: Annotated[str, Field(examples=['Schedule invoked'])]
3297
+ level: Annotated[str, Field(examples=['INFO'])]
3298
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-03-26T12:28:00.370Z'])]
3299
+
3300
+
3301
+ @docs_group('Models')
3302
+ class ScheduleLogResponse(BaseModel):
3303
+ model_config = ConfigDict(
3304
+ extra='allow',
3305
+ populate_by_name=True,
3306
+ alias_generator=to_camel,
3307
+ )
3308
+ data: list[ScheduleInvoked]
3309
+
3310
+
3311
+ @docs_group('Models')
3312
+ class ScheduleResponse(BaseModel):
3313
+ model_config = ConfigDict(
3314
+ extra='allow',
3315
+ populate_by_name=True,
3316
+ alias_generator=to_camel,
3317
+ )
3318
+ data: Schedule
3319
+
3320
+
3321
+ @docs_group('Models')
3322
+ class ScheduleShort(ScheduleBase):
3323
+ model_config = ConfigDict(
3324
+ extra='allow',
3325
+ populate_by_name=True,
3326
+ alias_generator=to_camel,
3327
+ )
3328
+ actions: list[Annotated[ScheduleActionShortRunActor | ScheduleActionShortRunActorTask, Field(discriminator='type')]]
3329
+
3330
+
3331
+ @docs_group('Models')
3332
+ class SchemaValidationErrorData(BaseModel):
3333
+ model_config = ConfigDict(
3334
+ extra='allow',
3335
+ populate_by_name=True,
3336
+ alias_generator=to_camel,
3337
+ )
3338
+ invalid_items: list[InvalidItem]
3339
+ """
3340
+ A list of invalid items in the received array of items.
3341
+ """
3342
+
3343
+
3344
+ @docs_group('Models')
3345
+ class SourceCodeFile(BaseModel):
3346
+ """Represents a single file in the Actor's source code."""
3347
+
3348
+ model_config = ConfigDict(
3349
+ extra='allow',
3350
+ populate_by_name=True,
3351
+ alias_generator=to_camel,
3352
+ )
3353
+ format: SourceCodeFileFormat | None = None
3354
+ """
3355
+ Format of the file's content, `TEXT` for plain text and `BASE64` for encoded content.
3356
+ """
3357
+ content: Annotated[str | None, Field(examples=["console.log('This is the main.js file');"])] = None
3358
+ """
3359
+ The contents of the file. Interpreted based on the value of `format`.
3360
+ """
3361
+ name: Annotated[str, Field(examples=['src/main.js'])]
3362
+ """
3363
+ The path of the file relative to the Actor's root directory.
3364
+ """
3365
+
3366
+
3367
+ @docs_group('Models')
3368
+ class SourceCodeFolder(BaseModel):
3369
+ """Represents a folder in the Actor's source code structure. Distinguished from
3370
+ SourceCodeFile by the presence of the `folder` property set to `true`.
3371
+
3372
+ """
3373
+
3374
+ model_config = ConfigDict(
3375
+ extra='allow',
3376
+ populate_by_name=True,
3377
+ alias_generator=to_camel,
3378
+ )
3379
+ name: Annotated[str, Field(examples=['src/utils'])]
3380
+ """
3381
+ The path of the folder relative to the Actor's root directory.
3382
+ """
3383
+ folder: Annotated[bool, Field(examples=[True])]
3384
+ """
3385
+ Whether it's a folder. Distinguishes folders from files.
3386
+ """
3387
+
3388
+
3389
+ @docs_group('Models')
3390
+ class StorageIds(BaseModel):
3391
+ """A map of aliased storage IDs associated with this run, grouped by storage type."""
3392
+
3393
+ model_config = ConfigDict(
3394
+ extra='allow',
3395
+ populate_by_name=True,
3396
+ alias_generator=to_camel,
3397
+ )
3398
+ datasets: Datasets | None = None
3399
+ """
3400
+ Aliased dataset IDs for this run.
3401
+ """
3402
+ key_value_stores: KeyValueStores | None = None
3403
+ """
3404
+ Aliased key-value store IDs for this run.
3405
+ """
3406
+ request_queues: RequestQueues | None = None
3407
+ """
3408
+ Aliased request queue IDs for this run.
3409
+ """
3410
+
3411
+
3412
+ @docs_group('Models')
3413
+ class Storages(BaseModel):
3414
+ model_config = ConfigDict(
3415
+ extra='allow',
3416
+ populate_by_name=True,
3417
+ alias_generator=to_camel,
3418
+ )
3419
+ dataset: dict[str, Any] | None = None
3420
+ """
3421
+ Defines the schema of items in your dataset, the full specification can be found in the upstream API docs
3422
+ """
3423
+
3424
+
3425
+ @docs_group('Models')
3426
+ class StoreListActor(BaseModel):
3427
+ model_config = ConfigDict(
3428
+ extra='allow',
3429
+ populate_by_name=True,
3430
+ alias_generator=to_camel,
3431
+ )
3432
+ id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
3433
+ # Scrapely can return null titles; tolerate their absence.
3434
+ title: Annotated[str | None, Field(examples=['My Public Actor'])] = None
3435
+ name: Annotated[str, Field(examples=['my-public-actor'])]
3436
+ username: Annotated[str, Field(examples=['jane35'])]
3437
+ user_full_name: Annotated[str | None, Field(examples=['Jane H. Doe'])] = None
3438
+ description: Annotated[str | None, Field(examples=['My public actor!'])] = None
3439
+ categories: Annotated[list[str] | None, Field(examples=[['MARKETING', 'LEAD_GENERATION']])] = None
3440
+ notice: ActorNotice | None = None
3441
+ picture_url: Annotated[AnyUrl | None, Field(examples=['https://...'])] = None
3442
+ user_picture_url: Annotated[AnyUrl | None, Field(examples=['https://...'])] = None
3443
+ url: Annotated[AnyUrl | None, Field(examples=['https://...'])] = None
3444
+ stats: ActorStats
3445
+ current_pricing_info: CurrentPricingInfo | None = None
3446
+ is_white_listed_for_agentic_payments: bool | None = None
3447
+ """
3448
+ Whether the Actor is whitelisted for agentic payment processing.
3449
+ """
3450
+ actor_review_count: Annotated[int | None, Field(examples=[69])] = None
3451
+ actor_review_rating: Annotated[float | None, Field(examples=[4.7])] = None
3452
+ bookmark_count: Annotated[int | None, Field(examples=[1269])] = None
3453
+ badge: Annotated[str | None, Field(examples=[None])] = None
3454
+ readme_summary: str | None = None
3455
+ """
3456
+ A brief, LLM-generated readme summary
3457
+ """
3458
+
3459
+
3460
+ @docs_group('Models')
3461
+ class TaggedBuildInfo(BaseModel):
3462
+ """Information about a tagged build."""
3463
+
3464
+ model_config = ConfigDict(
3465
+ extra='allow',
3466
+ populate_by_name=True,
3467
+ alias_generator=to_camel,
3468
+ )
3469
+ build_id: Annotated[str | None, Field(examples=['z2EryhbfhgSyqj6Hn'])] = None
3470
+ """
3471
+ The ID of the build associated with this tag.
3472
+ """
3473
+ build_number: Annotated[
3474
+ str | None, Field(examples=['0.0.2'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[1-9][0-9]{0,4})$')
3475
+ ] = None
3476
+ """
3477
+ The build number/version string. Can be `null` for legacy builds that lack a valid build number.
3478
+ """
3479
+ build_number_int: Annotated[int | None, Field(examples=[42])] = None
3480
+ """
3481
+ The build number encoded as a single integer.
3482
+ """
3483
+ finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-10T11:15:49.286Z'])] = None
3484
+ """
3485
+ The timestamp when the build finished.
3486
+ """
3487
+
3488
+
3489
+ @docs_group('Models')
3490
+ class Task(BaseModel):
3491
+ model_config = ConfigDict(
3492
+ extra='allow',
3493
+ populate_by_name=True,
3494
+ alias_generator=to_camel,
3495
+ )
3496
+ id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
3497
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
3498
+ act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
3499
+ name: Annotated[str, Field(examples=['my-task'])]
3500
+ username: Annotated[str | None, Field(examples=['janedoe'])] = None
3501
+ created_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T07:23:14.855Z'])]
3502
+ modified_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T13:30:49.578Z'])]
3503
+ removed_at: AwareDatetime | None = None
3504
+ stats: TaskStats | None = None
3505
+ options: TaskOptions | None = None
3506
+ input: TaskInput | None = None
3507
+ title: str | None = None
3508
+ actor_standby: ActorStandby | None = None
3509
+ standby_url: AnyUrl | None = None
3510
+ seo_title: str | None = None
3511
+ seo_description: str | None = None
3512
+ use_case: str | None = None
3513
+ published_at: AwareDatetime | None = None
3514
+ is_public: bool | None = None
3515
+ public_slug: str | None = None
3516
+
3517
+
3518
+ @docs_group('Models')
3519
+ class TaskInput(BaseModel):
3520
+ """The input configuration for the Actor task. This is a user-defined JSON object
3521
+ that will be passed to the Actor when the task is run.
3522
+
3523
+ """
3524
+
3525
+ model_config = ConfigDict(
3526
+ extra='allow',
3527
+ populate_by_name=True,
3528
+ alias_generator=to_camel,
3529
+ )
3530
+
3531
+
3532
+ @docs_group('Models')
3533
+ class TaskOptions(BaseModel):
3534
+ model_config = ConfigDict(
3535
+ extra='allow',
3536
+ populate_by_name=True,
3537
+ alias_generator=to_camel,
3538
+ )
3539
+ build: Annotated[str | None, Field(examples=['latest'])] = None
3540
+ timeout_secs: Annotated[int | None, Field(examples=[300])] = None
3541
+ memory_mbytes: Annotated[int | None, Field(examples=[1024])] = None
3542
+ max_items: Annotated[int | None, Field(examples=[1000])] = None
3543
+ max_total_charge_usd: Annotated[float | None, Field(examples=[5])] = None
3544
+ restart_on_error: Annotated[bool | None, Field(examples=[False])] = None
3545
+
3546
+
3547
+ @docs_group('Models')
3548
+ class TaskResponse(BaseModel):
3549
+ """Response containing Actor task data."""
3550
+
3551
+ model_config = ConfigDict(
3552
+ extra='allow',
3553
+ populate_by_name=True,
3554
+ alias_generator=to_camel,
3555
+ )
3556
+ data: Task
3557
+
3558
+
3559
+ @docs_group('Models')
3560
+ class TaskShort(BaseModel):
3561
+ model_config = ConfigDict(
3562
+ extra='allow',
3563
+ populate_by_name=True,
3564
+ alias_generator=to_camel,
3565
+ )
3566
+ id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
3567
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
3568
+ act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
3569
+ act_name: Annotated[str | None, Field(examples=['my-actor'])] = None
3570
+ name: Annotated[str, Field(examples=['my-task'])]
3571
+ username: Annotated[str | None, Field(examples=['janedoe'])] = None
3572
+ act_username: Annotated[str | None, Field(examples=['janedoe'])] = None
3573
+ created_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T07:23:14.855Z'])]
3574
+ modified_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T13:30:49.578Z'])]
3575
+ stats: TaskStats | None = None
3576
+
3577
+
3578
+ @docs_group('Models')
3579
+ class TaskStats(BaseModel):
3580
+ model_config = ConfigDict(
3581
+ extra='allow',
3582
+ populate_by_name=True,
3583
+ alias_generator=to_camel,
3584
+ )
3585
+ total_runs: Annotated[int | None, Field(examples=[15])] = None
3586
+
3587
+
3588
+ @docs_group('Models')
3589
+ class TestWebhookResponse(BaseModel):
3590
+ model_config = ConfigDict(
3591
+ extra='allow',
3592
+ populate_by_name=True,
3593
+ alias_generator=to_camel,
3594
+ )
3595
+ data: WebhookDispatch
3596
+
3597
+
3598
+ @docs_group('Models')
3599
+ class TieredPricingPerDatasetItemEntry(BaseModel):
3600
+ """A single tier's price-per-dataset-item entry."""
3601
+
3602
+ model_config = ConfigDict(
3603
+ extra='allow',
3604
+ populate_by_name=True,
3605
+ alias_generator=to_camel,
3606
+ )
3607
+ tiered_price_per_unit_usd: float
3608
+ """
3609
+ Price per unit in USD for this tier.
3610
+ """
3611
+
3612
+
3613
+ @docs_group('Models')
3614
+ class TieredPricingPerEventEntry(BaseModel):
3615
+ """A single tier's price-per-event entry."""
3616
+
3617
+ model_config = ConfigDict(
3618
+ extra='allow',
3619
+ populate_by_name=True,
3620
+ alias_generator=to_camel,
3621
+ )
3622
+ tiered_event_price_usd: float
3623
+ """
3624
+ Price per event in USD for this tier.
3625
+ """
3626
+
3627
+
3628
+ @docs_group('Models')
3629
+ class UnlockRequestsResponse(BaseModel):
3630
+ """Response containing the result of unlocking requests."""
3631
+
3632
+ model_config = ConfigDict(
3633
+ extra='allow',
3634
+ populate_by_name=True,
3635
+ alias_generator=to_camel,
3636
+ )
3637
+ data: UnlockRequestsResult
3638
+
3639
+
3640
+ @docs_group('Models')
3641
+ class UnlockRequestsResult(BaseModel):
3642
+ """Result of unlocking requests in the request queue."""
3643
+
3644
+ model_config = ConfigDict(
3645
+ extra='allow',
3646
+ populate_by_name=True,
3647
+ alias_generator=to_camel,
3648
+ )
3649
+ unlocked_count: Annotated[int, Field(examples=[10])]
3650
+ """
3651
+ Number of requests that were successfully unlocked.
3652
+ """
3653
+
3654
+
3655
+ @docs_group('Models')
3656
+ class UpdateActorRequest(BaseModel):
3657
+ model_config = ConfigDict(
3658
+ extra='allow',
3659
+ populate_by_name=True,
3660
+ alias_generator=to_camel,
3661
+ )
3662
+ name: Annotated[str | None, Field(examples=['instagram-scraper'])] = None
3663
+ """
3664
+ The identifier of the Actor. Use lowercase letters, numbers, and hyphens. Spaces or special characters aren't allowed. Must be unique across your account.
3665
+ """
3666
+ description: Annotated[str | None, Field(examples=['This scraper extracts posts and comments from Instagram.'])] = (
3667
+ None
3668
+ )
3669
+ """
3670
+ Short description of the Actor, displayed in Scrapely Store and Console.
3671
+ """
3672
+ is_public: Annotated[bool | None, Field(examples=[False])] = None
3673
+ """
3674
+ Whether the Actor is available to users in Scrapely Store. If `false`, the Actor is private and only visible to you.
3675
+ """
3676
+ actor_permission_level: ActorPermissionLevel | None = None
3677
+ seo_title: Annotated[str | None, Field(examples=['Free Instagram scraper'])] = None
3678
+ """
3679
+ Name of the Actor to display by search engines such as Google. Can be different from the Actor's name displayed in Scrapely Store and Console. Recommended length is 40-50 characters.
3680
+ """
3681
+ seo_description: Annotated[str | None, Field(examples=['The best scraper for Instagram'])] = None
3682
+ """
3683
+ Description of the Actor to display by search engines such as Google. Recommended length is 140-156 characters.
3684
+ """
3685
+ title: Annotated[str | None, Field(examples=['Instagram scraper'])] = None
3686
+ """
3687
+ Human-readable name of the Actor, displayed in Scrapely Store and Console. Can contain spaces and capital letters. Recommended length is 40-50 characters. You can change this title without affecting the Actor's URL or SEO.
3688
+ """
3689
+ restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
3690
+ versions: list[CreateOrUpdateVersionRequest] | None = None
3691
+ """
3692
+ An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
3693
+ """
3694
+ pricing_infos: (
3695
+ list[
3696
+ Annotated[
3697
+ PayPerEventActorPricingInfo
3698
+ | PricePerDatasetItemActorPricingInfo
3699
+ | FlatPricePerMonthActorPricingInfo
3700
+ | FreeActorPricingInfo,
3701
+ Field(discriminator='pricing_model'),
3702
+ ]
3703
+ ]
3704
+ | None
3705
+ ) = None
3706
+ categories: Annotated[list[str] | None, Field(examples=[['SOCIAL_MEDIA']])] = None
3707
+ """
3708
+ A list of categories that best define the Actor. Reflected in Scrapely Store's search and filtering options.
3709
+ """
3710
+ default_run_options: DefaultRunOptions | None = None
3711
+ """
3712
+ The default settings applied to an Actor run. Can be overridden by the user.
3713
+ """
3714
+ tagged_builds: Annotated[
3715
+ dict[str, Any] | None, Field(examples=[{'latest': {'buildId': 'z2EryhbfhgSyqj6Hn'}, 'beta': None}])
3716
+ ] = None
3717
+ """
3718
+ A dictionary that maps tag names to specific builds. For details, see [Update build tags](#update-build-tags).
3719
+ """
3720
+ actor_standby: ActorStandby | None = None
3721
+ """
3722
+ The configuration of the Actor's standby mode. For details, see Standby mode.
3723
+ """
3724
+ example_run_input: ExampleRunInput | None = None
3725
+ """
3726
+ Sample input payload that demonstrates what a typical run input for an Actor looks like. Used when no explicit input for a run is provided.
3727
+ """
3728
+ is_deprecated: bool | None = None
3729
+ """
3730
+ Whether the Actor is deprecated.
3731
+ """
3732
+
3733
+
3734
+ @docs_group('Models')
3735
+ class UpdateDatasetRequest(BaseModel):
3736
+ model_config = ConfigDict(
3737
+ extra='allow',
3738
+ populate_by_name=True,
3739
+ alias_generator=to_camel,
3740
+ )
3741
+ name: str | None = None
3742
+ general_access: GeneralAccess | None = None
3743
+
3744
+
3745
+ @docs_group('Models')
3746
+ class UpdateLimitsRequest(BaseModel):
3747
+ model_config = ConfigDict(
3748
+ extra='allow',
3749
+ populate_by_name=True,
3750
+ alias_generator=to_camel,
3751
+ )
3752
+ max_monthly_usage_usd: Annotated[float | None, Field(examples=[300])] = None
3753
+ """
3754
+ If your platform usage in the billing period exceeds the prepaid usage, you will be charged extra. Setting this property you can update your hard limit on monthly platform usage to prevent accidental overage or to limit the extra charges.
3755
+
3756
+ """
3757
+ data_retention_days: Annotated[int | None, Field(examples=[90])] = None
3758
+ """
3759
+ Scrapely securely stores your ten most recent Actor runs indefinitely, ensuring they are always accessible. Unnamed storages and other Actor runs are automatically deleted after the retention period. If you're subscribed, you can change it to keep data for longer or to limit your usage. Lear more.
3760
+
3761
+ """
3762
+
3763
+
3764
+ @docs_group('Models')
3765
+ class UpdateRequestQueueRequest(BaseModel):
3766
+ """Request object for updating a request queue."""
3767
+
3768
+ model_config = ConfigDict(
3769
+ extra='allow',
3770
+ populate_by_name=True,
3771
+ alias_generator=to_camel,
3772
+ )
3773
+ name: str | None = None
3774
+ """
3775
+ The new name for the request queue.
3776
+ """
3777
+ general_access: GeneralAccess | None = None
3778
+
3779
+
3780
+ @docs_group('Models')
3781
+ class UpdateRequestResponse(BaseModel):
3782
+ """Response containing the result of updating a request in the request queue."""
3783
+
3784
+ model_config = ConfigDict(
3785
+ extra='allow',
3786
+ populate_by_name=True,
3787
+ alias_generator=to_camel,
3788
+ )
3789
+ data: RequestRegistration
3790
+
3791
+
3792
+ @docs_group('Models')
3793
+ class UpdateRunRequest(BaseModel):
3794
+ model_config = ConfigDict(
3795
+ extra='allow',
3796
+ populate_by_name=True,
3797
+ alias_generator=to_camel,
3798
+ )
3799
+ run_id: Annotated[str | None, Field(examples=['3KH8gEpp4d8uQSe8T'])] = None
3800
+ status_message: Annotated[str | None, Field(examples=['Actor has finished'])] = None
3801
+ is_status_message_terminal: Annotated[bool | None, Field(examples=[True])] = None
3802
+ general_access: GeneralAccess | None = None
3803
+
3804
+
3805
+ @docs_group('Models')
3806
+ class UpdateStoreRequest(UpdateDatasetRequest):
3807
+ pass
3808
+
3809
+
3810
+ @docs_group('Models')
3811
+ class UpdateTaskRequest(BaseModel):
3812
+ model_config = ConfigDict(
3813
+ extra='allow',
3814
+ populate_by_name=True,
3815
+ alias_generator=to_camel,
3816
+ )
3817
+ name: Annotated[str | None, Field(examples=['my-task'])] = None
3818
+ options: TaskOptions | None = None
3819
+ input: TaskInput | None = None
3820
+ title: str | None = None
3821
+ actor_standby: ActorStandby | None = None
3822
+ seo_title: str | None = None
3823
+ seo_description: str | None = None
3824
+
3825
+
3826
+ @docs_group('Models')
3827
+ class UsageCycle(BaseModel):
3828
+ model_config = ConfigDict(
3829
+ extra='allow',
3830
+ populate_by_name=True,
3831
+ alias_generator=to_camel,
3832
+ )
3833
+ start_at: Annotated[AwareDatetime, Field(examples=['2022-10-02T00:00:00.000Z'])]
3834
+ end_at: Annotated[AwareDatetime, Field(examples=['2022-11-01T23:59:59.999Z'])]
3835
+
3836
+
3837
+ @docs_group('Models')
3838
+ class UsageItem(BaseModel):
3839
+ model_config = ConfigDict(
3840
+ extra='allow',
3841
+ populate_by_name=True,
3842
+ alias_generator=to_camel,
3843
+ )
3844
+ quantity: Annotated[float, Field(examples=[2.784475])]
3845
+ base_amount_usd: Annotated[float, Field(examples=[0.69611875])]
3846
+ base_unit_price_usd: Annotated[float | None, Field(examples=[0.25])] = None
3847
+ amount_after_volume_discount_usd: Annotated[float | None, Field(examples=[0.69611875])] = None
3848
+ price_tiers: list[PriceTiers] | None = None
3849
+
3850
+
3851
+ @docs_group('Models')
3852
+ class UserPrivateInfo(BaseModel):
3853
+ model_config = ConfigDict(
3854
+ extra='allow',
3855
+ populate_by_name=True,
3856
+ alias_generator=to_camel,
3857
+ )
3858
+ id: Annotated[str | None, Field(examples=['YiKoxjkaS9gjGTqhF'])] = None
3859
+ username: Annotated[str, Field(examples=['myusername'])]
3860
+ profile: Profile | None = None
3861
+ email: Annotated[EmailStr | None, Field(examples=['bob@example.com'])] = None
3862
+ proxy: Proxy | None = None
3863
+ plan: Plan
3864
+ effective_platform_features: EffectivePlatformFeatures
3865
+ created_at: Annotated[AwareDatetime | None, Field(examples=['2022-11-29T14:48:29.381Z'])] = None
3866
+ is_paying: Annotated[bool, Field(examples=[True])]
3867
+
3868
+
3869
+ @docs_group('Models')
3870
+ class UserPublicInfo(BaseModel):
3871
+ model_config = ConfigDict(
3872
+ extra='allow',
3873
+ populate_by_name=True,
3874
+ alias_generator=to_camel,
3875
+ )
3876
+ username: Annotated[str, Field(examples=['d7b9MDYsbtX5L7XAj'])]
3877
+ profile: Profile | None = None
3878
+
3879
+
3880
+ @docs_group('Models')
3881
+ class ValidationError(BaseModel):
3882
+ model_config = ConfigDict(
3883
+ extra='allow',
3884
+ populate_by_name=True,
3885
+ alias_generator=to_camel,
3886
+ )
3887
+ instance_path: str | None = None
3888
+ """
3889
+ The path to the instance being validated.
3890
+ """
3891
+ schema_path: str | None = None
3892
+ """
3893
+ The path to the schema that failed the validation.
3894
+ """
3895
+ keyword: str | None = None
3896
+ """
3897
+ The validation keyword that caused the error.
3898
+ """
3899
+ message: str | None = None
3900
+ """
3901
+ A message describing the validation error.
3902
+ """
3903
+ params: dict[str, Any] | None = None
3904
+ """
3905
+ Additional parameters specific to the validation error.
3906
+ """
3907
+
3908
+
3909
+ @docs_group('Models')
3910
+ class Version(BaseModel):
3911
+ model_config = ConfigDict(
3912
+ extra='allow',
3913
+ populate_by_name=True,
3914
+ alias_generator=to_camel,
3915
+ )
3916
+ version_number: Annotated[str, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])(\\.[0-9]+)?$')]
3917
+ """
3918
+ The version number of the Actor. `MAJOR.MINOR` or `MAJOR.MINOR.PATCH` (Scrapely staging uses triplets like `0.0.1`).
3919
+ """
3920
+ source_type: VersionSourceType | None
3921
+ """
3922
+ Where the source code of the version lives.
3923
+ """
3924
+ env_vars: list[EnvVar] | None = None
3925
+ """
3926
+ Environment variables for the version.
3927
+ """
3928
+ apply_env_vars_to_build: Annotated[bool | None, Field(examples=[False])] = None
3929
+ """
3930
+ Whether to inject the environment variables at build time.
3931
+ """
3932
+ build_tag: Annotated[str | None, Field(examples=['latest'])] = None
3933
+ """
3934
+ The tag name to apply to a successful build of this version. Can be `null` when the version has no build tag.
3935
+ """
3936
+ source_files: Annotated[list[SourceCodeFile | SourceCodeFolder] | None, Field(title='VersionSourceFiles')] = None
3937
+ """
3938
+ Applies when the `sourceType` is `SOURCE_FILES`. Represents the Actor's file structure as an array of files and folders.
3939
+ """
3940
+ git_repo_url: str | None = None
3941
+ """
3942
+ URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
3943
+ """
3944
+ tarball_url: str | None = None
3945
+ """
3946
+ URL to download the source code from as a tarball or ZIP file. Applies when the `sourceType` is `TARBALL`.
3947
+ """
3948
+ github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
3949
+ """
3950
+ URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.
3951
+ """
3952
+
3953
+
3954
+ @docs_group('Models')
3955
+ class VersionResponse(BaseModel):
3956
+ model_config = ConfigDict(
3957
+ extra='allow',
3958
+ populate_by_name=True,
3959
+ alias_generator=to_camel,
3960
+ )
3961
+ data: Version
3962
+
3963
+
3964
+ @docs_group('Models')
3965
+ class Webhook(BaseModel):
3966
+ model_config = ConfigDict(
3967
+ extra='allow',
3968
+ populate_by_name=True,
3969
+ alias_generator=to_camel,
3970
+ )
3971
+ id: Annotated[str, Field(examples=['YiKoxjkaS9gjGTqhF'])]
3972
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
3973
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
3974
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
3975
+ is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
3976
+ should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
3977
+ event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
3978
+ condition: WebhookCondition
3979
+ ignore_ssl_errors: Annotated[bool, Field(examples=[False])]
3980
+ do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
3981
+ request_url: Annotated[AnyUrl | None, Field(examples=['http://example.com/'])] = None
3982
+ """
3983
+ URL of the HTTP request sent by the webhook. It is omitted or `null` for hook actions other than the conventional HTTP case (e.g. Slack or email notifications).
3984
+ """
3985
+ payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
3986
+ headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
3987
+ description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
3988
+ last_dispatch: ExampleWebhookDispatch | None = None
3989
+ stats: WebhookStats | None = None
3990
+
3991
+
3992
+ @docs_group('Models')
3993
+ class WebhookCondition(BaseModel):
3994
+ model_config = ConfigDict(
3995
+ extra='allow',
3996
+ populate_by_name=True,
3997
+ alias_generator=to_camel,
3998
+ )
3999
+ actor_id: Annotated[str | None, Field(examples=['hksJZtadYvn4mBuin'])] = None
4000
+ actor_task_id: Annotated[str | None, Field(examples=['asdLZtadYvn4mBZmm'])] = None
4001
+ actor_run_id: Annotated[str | None, Field(examples=['hgdKZtadYvn4mBpoi'])] = None
4002
+
4003
+
4004
+ @docs_group('Models')
4005
+ class WebhookCreate(BaseModel):
4006
+ model_config = ConfigDict(
4007
+ extra='allow',
4008
+ populate_by_name=True,
4009
+ alias_generator=to_camel,
4010
+ )
4011
+ is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
4012
+ event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
4013
+ condition: WebhookCondition
4014
+ idempotency_key: Annotated[str | None, Field(examples=['fdSJmdP3nfs7sfk3y'])] = None
4015
+ ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
4016
+ do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
4017
+ request_url: Annotated[str, Field(examples=['http://example.com/'])]
4018
+ payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
4019
+ headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
4020
+ description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
4021
+ should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
4022
+
4023
+
4024
+ @docs_group('Models')
4025
+ class WebhookDispatch(BaseModel):
4026
+ model_config = ConfigDict(
4027
+ extra='allow',
4028
+ populate_by_name=True,
4029
+ alias_generator=to_camel,
4030
+ )
4031
+ id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
4032
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
4033
+ webhook_id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
4034
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
4035
+ status: WebhookDispatchStatus
4036
+ event_type: WebhookEventType
4037
+ event_data: Annotated[EventData | None, Field(title='eventData')] = None
4038
+ webhook: WebhookDispatchWebhookSummary | None = None
4039
+ calls: Annotated[list[Call] | None, Field(title='calls')] = None
4040
+
4041
+
4042
+ @docs_group('Models')
4043
+ class WebhookDispatchResponse(TestWebhookResponse):
4044
+ pass
4045
+
4046
+
4047
+ @docs_group('Models')
4048
+ class WebhookDispatchWebhookSummary(BaseModel):
4049
+ """A summary of the webhook that triggered this dispatch."""
4050
+
4051
+ model_config = ConfigDict(
4052
+ extra='allow',
4053
+ populate_by_name=True,
4054
+ alias_generator=to_camel,
4055
+ )
4056
+ action_type: Annotated[str | None, Field(examples=['HTTP_REQUEST'])] = None
4057
+ condition: WebhookCondition | None = None
4058
+ request_url: Annotated[AnyUrl | None, Field(examples=['https://example.com/webhook'])] = None
4059
+ """
4060
+ URL of the HTTP request sent by the webhook. It is `null` for hook actions other than the conventional HTTP case (e.g. Slack or email notifications).
4061
+ """
4062
+ is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
4063
+
4064
+
4065
+ @docs_group('Models')
4066
+ class WebhookRepresentation(BaseModel):
4067
+ """Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the
4068
+ `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose
4069
+ items match this schema. Persistent webhook fields (e.g. `condition`) are not used here.
4070
+
4071
+ """
4072
+
4073
+ model_config = ConfigDict(
4074
+ extra='allow',
4075
+ populate_by_name=True,
4076
+ alias_generator=to_camel,
4077
+ )
4078
+ event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
4079
+ request_url: Annotated[str, Field(examples=['http://example.com/'])]
4080
+ """
4081
+ The URL to which the webhook sends its payload.
4082
+ """
4083
+ payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
4084
+ """
4085
+ Optional template for the JSON payload sent by the webhook.
4086
+ """
4087
+ headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
4088
+ """
4089
+ Optional template for the HTTP headers sent by the webhook.
4090
+ """
4091
+ should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
4092
+ """
4093
+ Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates.
4094
+ """
4095
+ idempotency_key: Annotated[str | None, Field(examples=['fdSJmdP3nfs7sfk3y'])] = None
4096
+ """
4097
+ Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried.
4098
+ """
4099
+ ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
4100
+ """
4101
+ Flag to ignore SSL errors when the webhook sends the request.
4102
+ """
4103
+ do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
4104
+ """
4105
+ Flag to skip retrying the webhook request on failure.
4106
+ """
4107
+
4108
+
4109
+ @docs_group('Models')
4110
+ class WebhookResponse(BaseModel):
4111
+ """Response containing webhook data."""
4112
+
4113
+ model_config = ConfigDict(
4114
+ extra='allow',
4115
+ populate_by_name=True,
4116
+ alias_generator=to_camel,
4117
+ )
4118
+ data: Webhook
4119
+
4120
+
4121
+ @docs_group('Models')
4122
+ class WebhookShort(BaseModel):
4123
+ model_config = ConfigDict(
4124
+ extra='allow',
4125
+ populate_by_name=True,
4126
+ alias_generator=to_camel,
4127
+ )
4128
+ id: Annotated[str, Field(examples=['YiKoxjkaS9gjGTqhF'])]
4129
+ created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
4130
+ modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
4131
+ user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
4132
+ is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
4133
+ is_apify_integration: Annotated[bool | None, Field(examples=[False])] = None
4134
+ is_enabled: Annotated[bool | None, Field(examples=[True])] = None
4135
+ action_type: Annotated[str | None, Field(examples=['HTTP_REQUEST'])] = None
4136
+ should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
4137
+ event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
4138
+ condition: WebhookCondition
4139
+ ignore_ssl_errors: Annotated[bool, Field(examples=[False])]
4140
+ do_not_retry: Annotated[bool, Field(examples=[False])]
4141
+ request_url: Annotated[AnyUrl, Field(examples=['http://example.com/'])]
4142
+ last_dispatch: ExampleWebhookDispatch | None = None
4143
+ stats: WebhookStats | None = None
4144
+
4145
+
4146
+ @docs_group('Models')
4147
+ class WebhookStats(BaseModel):
4148
+ model_config = ConfigDict(
4149
+ extra='allow',
4150
+ populate_by_name=True,
4151
+ alias_generator=to_camel,
4152
+ )
4153
+ total_dispatches: Annotated[int | None, Field(examples=[1])] = None
4154
+
4155
+
4156
+ @docs_group('Models')
4157
+ class WebhookUpdate(BaseModel):
4158
+ model_config = ConfigDict(
4159
+ extra='allow',
4160
+ populate_by_name=True,
4161
+ alias_generator=to_camel,
4162
+ )
4163
+ is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
4164
+ event_types: Annotated[list[WebhookEventType] | None, Field(examples=[['ACTOR.RUN.SUCCEEDED']])] = None
4165
+ condition: WebhookCondition | None = None
4166
+ ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
4167
+ do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
4168
+ request_url: Annotated[AnyUrl | None, Field(examples=['http://example.com/'])] = None
4169
+ payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
4170
+ headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
4171
+ description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
4172
+ should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None