-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy path_models.py
More file actions
3805 lines (3251 loc) · 131 KB
/
_models.py
File metadata and controls
3805 lines (3251 loc) · 131 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# generated by datamodel-codegen:
# filename: openapi.json
# timestamp: 2026-04-09T11:54:55+00:00
from __future__ import annotations
from enum import StrEnum
from typing import Annotated, Any, Literal
from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, EmailStr, Field, RootModel
from apify_client._docs import docs_group
@docs_group('Models')
class PaginationResponse(BaseModel):
"""Common pagination fields for list responses."""
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
total: Annotated[int, Field(examples=[1], ge=0)]
"""
The total number of items available across all pages.
"""
offset: Annotated[int, Field(examples=[0], ge=0)]
"""
The starting position for this page of results.
"""
limit: Annotated[int, Field(examples=[1000], ge=1)]
"""
The maximum number of items returned per page.
"""
desc: Annotated[bool, Field(examples=[False])]
"""
Whether the results are sorted in descending order.
"""
count: Annotated[int, Field(examples=[1], ge=0)]
"""
The number of items returned in this response.
"""
@docs_group('Models')
class ActorStats(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
total_builds: Annotated[int | None, Field(alias='totalBuilds', examples=[9])] = None
total_runs: Annotated[int | None, Field(alias='totalRuns', examples=[16])] = None
total_users: Annotated[int | None, Field(alias='totalUsers', examples=[6])] = None
total_users7_days: Annotated[int | None, Field(alias='totalUsers7Days', examples=[2])] = None
total_users30_days: Annotated[int | None, Field(alias='totalUsers30Days', examples=[6])] = None
total_users90_days: Annotated[int | None, Field(alias='totalUsers90Days', examples=[6])] = None
total_metamorphs: Annotated[int | None, Field(alias='totalMetamorphs', examples=[2])] = None
last_run_started_at: Annotated[
AwareDatetime | None, Field(alias='lastRunStartedAt', examples=['2019-07-08T14:01:05.546Z'])
] = None
@docs_group('Models')
class ActorShort(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
id: Annotated[str, Field(examples=['br9CKmk457'])]
created_at: Annotated[AwareDatetime, Field(alias='createdAt', examples=['2019-10-29T07:34:24.202Z'])]
modified_at: Annotated[AwareDatetime, Field(alias='modifiedAt', examples=['2019-10-30T07:34:24.202Z'])]
name: Annotated[str, Field(examples=['MyAct'])]
username: Annotated[str, Field(examples=['janedoe'])]
title: Annotated[str | None, Field(examples=['Hello World Example'])] = None
stats: ActorStats | None = None
@docs_group('Models')
class ListOfActors(PaginationResponse):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
items: list[ActorShort]
@docs_group('Models')
class ListOfActorsResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: ListOfActors
@docs_group('Models')
class Error(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: Annotated[ErrorType | None, Field(title='ErrorType')] = None
"""
Machine-processable error type identifier.
"""
message: str | None = None
"""
Human-readable error message describing what went wrong.
"""
@docs_group('Models')
class ErrorResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: Annotated[Error, Field(title='ErrorDetail')]
@docs_group('Models')
class VersionSourceType(StrEnum):
SOURCE_FILES = 'SOURCE_FILES'
GIT_REPO = 'GIT_REPO'
TARBALL = 'TARBALL'
GITHUB_GIST = 'GITHUB_GIST'
@docs_group('Models')
class EnvVar(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
name: Annotated[str, Field(examples=['MY_ENV_VAR'])]
value: Annotated[str | None, Field(examples=['my-value'])] = None
"""
The environment variable value. This field is absent in responses when `isSecret` is `true`, as secret values are never returned by the API.
"""
is_secret: Annotated[bool | None, Field(alias='isSecret', examples=[False])] = None
@docs_group('Models')
class SourceCodeFileFormat(StrEnum):
BASE64 = 'BASE64'
TEXT = 'TEXT'
@docs_group('Models')
class SourceCodeFile(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
format: SourceCodeFileFormat
content: Annotated[str, Field(examples=["console.log('This is the main.js file');"])]
name: Annotated[str, Field(examples=['src/main.js'])]
@docs_group('Models')
class SourceCodeFolder(BaseModel):
"""Represents a folder in the Actor's source code structure. Distinguished from
SourceCodeFile by the presence of the `folder` property set to `true`.
"""
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
name: Annotated[str, Field(examples=['src/utils'])]
"""
The folder path relative to the Actor's root directory.
"""
folder: Annotated[bool, Field(examples=[True])]
"""
Always `true` for folders. Used to distinguish folders from files.
"""
@docs_group('Models')
class Version(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
version_number: Annotated[str, Field(alias='versionNumber', examples=['0.0'])]
source_type: Annotated[VersionSourceType | None, Field(alias='sourceType')]
env_vars: Annotated[list[EnvVar] | None, Field(alias='envVars')] = None
apply_env_vars_to_build: Annotated[bool | None, Field(alias='applyEnvVarsToBuild', examples=[False])] = None
build_tag: Annotated[str | None, Field(alias='buildTag', examples=['latest'])] = None
source_files: Annotated[
list[SourceCodeFile | SourceCodeFolder] | None, Field(alias='sourceFiles', title='VersionSourceFiles')
] = None
git_repo_url: Annotated[str | None, Field(alias='gitRepoUrl')] = None
"""
URL of the Git repository when sourceType is GIT_REPO.
"""
tarball_url: Annotated[str | None, Field(alias='tarballUrl')] = None
"""
URL of the tarball when sourceType is TARBALL.
"""
github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
"""
URL of the GitHub Gist when sourceType is GITHUB_GIST.
"""
@docs_group('Models')
class CommonActorPricingInfo(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
apify_margin_percentage: Annotated[float, Field(alias='apifyMarginPercentage')]
"""
In [0, 1], fraction of pricePerUnitUsd that goes to Apify
"""
created_at: Annotated[AwareDatetime, Field(alias='createdAt')]
"""
When this pricing info record has been created
"""
started_at: Annotated[AwareDatetime, Field(alias='startedAt')]
"""
Since when is this pricing info record effective for a given Actor
"""
notified_about_future_change_at: Annotated[AwareDatetime | None, Field(alias='notifiedAboutFutureChangeAt')] = None
notified_about_change_at: Annotated[AwareDatetime | None, Field(alias='notifiedAboutChangeAt')] = None
reason_for_change: Annotated[str | None, Field(alias='reasonForChange')] = None
@docs_group('Models')
class PricingModel(StrEnum):
PAY_PER_EVENT = 'PAY_PER_EVENT'
PRICE_PER_DATASET_ITEM = 'PRICE_PER_DATASET_ITEM'
FLAT_PRICE_PER_MONTH = 'FLAT_PRICE_PER_MONTH'
FREE = 'FREE'
@docs_group('Models')
class ActorChargeEvent(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
event_price_usd: Annotated[float, Field(alias='eventPriceUsd')]
event_title: Annotated[str, Field(alias='eventTitle')]
event_description: Annotated[str, Field(alias='eventDescription')]
@docs_group('Models')
class PricingPerEvent(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
actor_charge_events: Annotated[dict[str, ActorChargeEvent] | None, Field(alias='actorChargeEvents')] = None
@docs_group('Models')
class PayPerEventActorPricingInfo(CommonActorPricingInfo):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
pricing_model: Annotated[Literal['PAY_PER_EVENT'], Field(alias='pricingModel')]
pricing_per_event: Annotated[PricingPerEvent, Field(alias='pricingPerEvent')]
minimal_max_total_charge_usd: Annotated[float | None, Field(alias='minimalMaxTotalChargeUsd')] = None
@docs_group('Models')
class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
pricing_model: Annotated[Literal['PRICE_PER_DATASET_ITEM'], Field(alias='pricingModel')]
unit_name: Annotated[str, Field(alias='unitName')]
"""
Name of the unit that is being charged
"""
price_per_unit_usd: Annotated[float, Field(alias='pricePerUnitUsd')]
@docs_group('Models')
class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
pricing_model: Annotated[Literal['FLAT_PRICE_PER_MONTH'], Field(alias='pricingModel')]
trial_minutes: Annotated[int, Field(alias='trialMinutes')]
"""
For how long this Actor can be used for free in trial period
"""
price_per_unit_usd: Annotated[float, Field(alias='pricePerUnitUsd')]
"""
Monthly flat price in USD
"""
@docs_group('Models')
class FreeActorPricingInfo(CommonActorPricingInfo):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
pricing_model: Annotated[Literal['FREE'], Field(alias='pricingModel')]
@docs_group('Models')
class ActorPermissionLevel(StrEnum):
"""Determines permissions that the Actor requires to run. For more information, see the [Actor permissions documentation](https://docs.apify.com/platform/actors/development/permissions)."""
LIMITED_PERMISSIONS = 'LIMITED_PERMISSIONS'
FULL_PERMISSIONS = 'FULL_PERMISSIONS'
@docs_group('Models')
class DefaultRunOptions(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
build: Annotated[str | None, Field(examples=['latest'])] = None
timeout_secs: Annotated[int | None, Field(alias='timeoutSecs', examples=[3600])] = None
memory_mbytes: Annotated[int | None, Field(alias='memoryMbytes', examples=[2048])] = None
restart_on_error: Annotated[bool | None, Field(alias='restartOnError', examples=[False])] = None
max_items: Annotated[int | None, Field(alias='maxItems')] = None
force_permission_level: Annotated[ActorPermissionLevel | None, Field(alias='forcePermissionLevel')] = None
@docs_group('Models')
class ActorStandby(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
is_enabled: Annotated[bool | None, Field(alias='isEnabled')] = None
desired_requests_per_actor_run: Annotated[int | None, Field(alias='desiredRequestsPerActorRun')] = None
max_requests_per_actor_run: Annotated[int | None, Field(alias='maxRequestsPerActorRun')] = None
idle_timeout_secs: Annotated[int | None, Field(alias='idleTimeoutSecs')] = None
build: str | None = None
memory_mbytes: Annotated[int | None, Field(alias='memoryMbytes')] = None
disable_standby_fields_override: Annotated[bool | None, Field(alias='disableStandbyFieldsOverride')] = None
should_pass_actor_input: Annotated[bool | None, Field(alias='shouldPassActorInput')] = None
@docs_group('Models')
class ExampleRunInput(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
body: Annotated[str | None, Field(examples=['{ "helloWorld": 123 }'])] = None
content_type: Annotated[str | None, Field(alias='contentType', examples=['application/json; charset=utf-8'])] = None
@docs_group('Models')
class CreateActorRequest(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
name: Annotated[str | None, Field(examples=['MyActor'])] = None
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
title: Annotated[str | None, Field(examples=['My actor'])] = None
is_public: Annotated[bool | None, Field(alias='isPublic', examples=[False])] = None
seo_title: Annotated[str | None, Field(alias='seoTitle', examples=['My actor'])] = None
seo_description: Annotated[str | None, Field(alias='seoDescription', examples=['My actor is the best'])] = None
restart_on_error: Annotated[bool | None, Field(alias='restartOnError', deprecated=True, examples=[False])] = None
versions: list[Version] | None = None
pricing_infos: Annotated[
list[
Annotated[
PayPerEventActorPricingInfo
| PricePerDatasetItemActorPricingInfo
| FlatPricePerMonthActorPricingInfo
| FreeActorPricingInfo,
Field(discriminator='pricing_model'),
]
]
| None,
Field(alias='pricingInfos'),
] = None
categories: list[str] | None = None
default_run_options: Annotated[DefaultRunOptions | None, Field(alias='defaultRunOptions')] = None
actor_standby: Annotated[ActorStandby | None, Field(alias='actorStandby')] = None
example_run_input: Annotated[ExampleRunInput | None, Field(alias='exampleRunInput')] = None
is_deprecated: Annotated[bool | None, Field(alias='isDeprecated')] = None
@docs_group('Models')
class TaggedBuildInfo(BaseModel):
"""Information about a tagged build."""
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
build_id: Annotated[str | None, Field(alias='buildId', examples=['z2EryhbfhgSyqj6Hn'])] = None
"""
The ID of the build associated with this tag.
"""
build_number: Annotated[str | None, Field(alias='buildNumber', examples=['0.0.2'])] = None
"""
The build number/version string.
"""
finished_at: Annotated[AwareDatetime | None, Field(alias='finishedAt', examples=['2019-06-10T11:15:49.286Z'])] = (
None
)
"""
The timestamp when the build finished.
"""
@docs_group('Models')
class Actor(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
user_id: Annotated[str, Field(alias='userId', examples=['wRsJZtadYvn4mBZmm'])]
name: Annotated[str, Field(examples=['MyActor'])]
username: Annotated[str, Field(examples=['jane35'])]
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
restart_on_error: Annotated[bool | None, Field(alias='restartOnError', deprecated=True, examples=[False])] = None
is_public: Annotated[bool, Field(alias='isPublic', examples=[False])]
actor_permission_level: Annotated[ActorPermissionLevel | None, Field(alias='actorPermissionLevel')] = None
created_at: Annotated[AwareDatetime, Field(alias='createdAt', examples=['2019-07-08T11:27:57.401Z'])]
modified_at: Annotated[AwareDatetime, Field(alias='modifiedAt', examples=['2019-07-08T14:01:05.546Z'])]
stats: ActorStats
versions: list[Version]
pricing_infos: Annotated[
list[
Annotated[
PayPerEventActorPricingInfo
| PricePerDatasetItemActorPricingInfo
| FlatPricePerMonthActorPricingInfo
| FreeActorPricingInfo,
Field(discriminator='pricing_model'),
]
]
| None,
Field(alias='pricingInfos'),
] = None
default_run_options: Annotated[DefaultRunOptions, Field(alias='defaultRunOptions')]
example_run_input: Annotated[ExampleRunInput | None, Field(alias='exampleRunInput')] = None
is_deprecated: Annotated[bool | None, Field(alias='isDeprecated', examples=[False])] = None
deployment_key: Annotated[str | None, Field(alias='deploymentKey', examples=['ssh-rsa AAAA ...'])] = None
title: Annotated[str | None, Field(examples=['My Actor'])] = None
tagged_builds: Annotated[dict[str, TaggedBuildInfo | None] | None, Field(alias='taggedBuilds')] = None
actor_standby: Annotated[ActorStandby | None, Field(alias='actorStandby')] = None
readme_summary: Annotated[str | None, Field(alias='readmeSummary')] = None
"""
A brief, LLM-generated readme summary
"""
@docs_group('Models')
class ActorResponse(BaseModel):
"""Response containing Actor data."""
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: Actor
@docs_group('Models')
class EnvVarRequest(EnvVar):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
@docs_group('Models')
class CreateOrUpdateVersionRequest(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
version_number: Annotated[str | None, Field(alias='versionNumber', examples=['0.0'])] = None
source_type: Annotated[VersionSourceType | None, Field(alias='sourceType')] = None
env_vars: Annotated[list[EnvVarRequest] | None, Field(alias='envVars')] = None
apply_env_vars_to_build: Annotated[bool | None, Field(alias='applyEnvVarsToBuild', examples=[False])] = None
build_tag: Annotated[str | None, Field(alias='buildTag', examples=['latest'])] = None
source_files: Annotated[
list[SourceCodeFile | SourceCodeFolder] | None, Field(alias='sourceFiles', title='VersionSourceFiles')
] = None
git_repo_url: Annotated[str | None, Field(alias='gitRepoUrl')] = None
"""
URL of the Git repository when sourceType is GIT_REPO.
"""
tarball_url: Annotated[str | None, Field(alias='tarballUrl')] = None
"""
URL of the tarball when sourceType is TARBALL.
"""
github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
"""
URL of the GitHub Gist when sourceType is GITHUB_GIST.
"""
@docs_group('Models')
class BuildTag(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
build_id: Annotated[str, Field(alias='buildId')]
@docs_group('Models')
class UpdateActorRequest(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
name: Annotated[str | None, Field(examples=['MyActor'])] = None
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
is_public: Annotated[bool | None, Field(alias='isPublic', examples=[False])] = None
actor_permission_level: Annotated[ActorPermissionLevel | None, Field(alias='actorPermissionLevel')] = None
seo_title: Annotated[str | None, Field(alias='seoTitle', examples=['My actor'])] = None
seo_description: Annotated[str | None, Field(alias='seoDescription', examples=['My actor is the best'])] = None
title: Annotated[str | None, Field(examples=['My Actor'])] = None
restart_on_error: Annotated[bool | None, Field(alias='restartOnError', deprecated=True, examples=[False])] = None
versions: list[CreateOrUpdateVersionRequest] | None = None
pricing_infos: Annotated[
list[
Annotated[
PayPerEventActorPricingInfo
| PricePerDatasetItemActorPricingInfo
| FlatPricePerMonthActorPricingInfo
| FreeActorPricingInfo,
Field(discriminator='pricing_model'),
]
]
| None,
Field(alias='pricingInfos'),
] = None
categories: list[str] | None = None
default_run_options: Annotated[DefaultRunOptions | None, Field(alias='defaultRunOptions')] = None
tagged_builds: Annotated[
dict[str, Any] | None,
Field(alias='taggedBuilds', examples=[{'latest': {'buildId': 'z2EryhbfhgSyqj6Hn'}, 'beta': None}]),
] = None
"""
An object to modify tags on the Actor's builds. The key is the tag name (e.g., _latest_), and the value is either an object with a `buildId` or `null`.
This operation is a patch; any existing tags that you omit from this object will be preserved.
- **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag:
```json
{
"latest": {
"buildId": "z2EryhbfhgSyqj6Hn"
}
}
```
- **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag:
```json
{
"beta": null
}
```
- **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags.
```json
{
"latest": {
"buildId": "z2EryhbfhgSyqj6Hn"
},
"beta": null
}
```
"""
actor_standby: Annotated[ActorStandby | None, Field(alias='actorStandby')] = None
example_run_input: Annotated[ExampleRunInput | None, Field(alias='exampleRunInput')] = None
is_deprecated: Annotated[bool | None, Field(alias='isDeprecated')] = None
@docs_group('Models')
class ListOfVersions(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
total: Annotated[int, Field(examples=[5])]
items: list[Version]
@docs_group('Models')
class ListOfVersionsResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: ListOfVersions
@docs_group('Models')
class VersionResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: Version
@docs_group('Models')
class ErrorType(StrEnum):
"""Machine-processable error type identifier."""
ACTOR_MEMORY_LIMIT_EXCEEDED = 'actor-memory-limit-exceeded'
ACTOR_NOT_FOUND = 'actor-not-found'
INVALID_INPUT = 'invalid-input'
METHOD_NOT_ALLOWED = 'method-not-allowed'
PERMISSION_DENIED = 'permission-denied'
RATE_LIMIT_EXCEEDED = 'rate-limit-exceeded'
RECORD_NOT_FOUND = 'record-not-found'
RECORD_NOT_UNIQUE = 'record-not-unique'
RECORD_OR_TOKEN_NOT_FOUND = 'record-or-token-not-found'
REQUEST_ID_INVALID = 'request-id-invalid'
REQUEST_TOO_LARGE = 'request-too-large'
RUN_FAILED = 'run-failed'
RUN_TIMEOUT_EXCEEDED = 'run-timeout-exceeded'
TOKEN_NOT_VALID = 'token-not-valid'
UNKNOWN_BUILD_TAG = 'unknown-build-tag'
UNSUPPORTED_CONTENT_ENCODING = 'unsupported-content-encoding'
X402_PAYMENT_REQUIRED = 'x402-payment-required'
@docs_group('Models')
class ErrorDetail(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: ErrorType | None = None
message: str | None = None
"""
Human-readable error message describing what went wrong.
"""
@docs_group('Models')
class ActorNotFoundErrorDetail(ErrorDetail):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: Annotated[Literal['actor-not-found'], Field(title='ErrorType')] = 'actor-not-found'
"""
Machine-processable error type identifier.
"""
@docs_group('Models')
class ActorNotFoundError(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: ActorNotFoundErrorDetail | None = None
@docs_group('Models')
class RecordNotFoundErrorDetail(ErrorDetail):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
type: Annotated[Literal['record-not-found'], Field(title='ErrorType')] = 'record-not-found'
"""
Machine-processable error type identifier.
"""
@docs_group('Models')
class ActorVersionNotFoundError(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: RecordNotFoundErrorDetail | None = None
@docs_group('Models')
class ListOfEnvVars(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
total: Annotated[int, Field(examples=[5])]
items: list[EnvVar]
@docs_group('Models')
class ListOfEnvVarsResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: ListOfEnvVars
@docs_group('Models')
class EnvVarResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: EnvVar
@docs_group('Models')
class EnvironmentVariableNotFoundError(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
error: RecordNotFoundErrorDetail | None = None
@docs_group('Models')
class WebhookEventType(StrEnum):
"""Type of event that triggers the webhook."""
ACTOR_BUILD_ABORTED = 'ACTOR.BUILD.ABORTED'
ACTOR_BUILD_CREATED = 'ACTOR.BUILD.CREATED'
ACTOR_BUILD_FAILED = 'ACTOR.BUILD.FAILED'
ACTOR_BUILD_SUCCEEDED = 'ACTOR.BUILD.SUCCEEDED'
ACTOR_BUILD_TIMED_OUT = 'ACTOR.BUILD.TIMED_OUT'
ACTOR_RUN_ABORTED = 'ACTOR.RUN.ABORTED'
ACTOR_RUN_CREATED = 'ACTOR.RUN.CREATED'
ACTOR_RUN_FAILED = 'ACTOR.RUN.FAILED'
ACTOR_RUN_RESURRECTED = 'ACTOR.RUN.RESURRECTED'
ACTOR_RUN_SUCCEEDED = 'ACTOR.RUN.SUCCEEDED'
ACTOR_RUN_TIMED_OUT = 'ACTOR.RUN.TIMED_OUT'
TEST = 'TEST'
@docs_group('Models')
class WebhookCondition(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
actor_id: Annotated[str | None, Field(alias='actorId', examples=['hksJZtadYvn4mBuin'])] = None
actor_task_id: Annotated[str | None, Field(alias='actorTaskId', examples=['asdLZtadYvn4mBZmm'])] = None
actor_run_id: Annotated[str | None, Field(alias='actorRunId', examples=['hgdKZtadYvn4mBpoi'])] = None
@docs_group('Models')
class WebhookDispatchStatus(StrEnum):
"""Status of the webhook dispatch indicating whether the HTTP request was successful."""
ACTIVE = 'ACTIVE'
SUCCEEDED = 'SUCCEEDED'
FAILED = 'FAILED'
@docs_group('Models')
class ExampleWebhookDispatch(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
status: WebhookDispatchStatus
finished_at: Annotated[AwareDatetime | None, Field(alias='finishedAt', examples=['2019-12-13T08:36:13.202Z'])] = (
None
)
@docs_group('Models')
class WebhookStats(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
total_dispatches: Annotated[int, Field(alias='totalDispatches', examples=[1])]
@docs_group('Models')
class WebhookShort(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
id: Annotated[str, Field(examples=['YiKoxjkaS9gjGTqhF'])]
created_at: Annotated[AwareDatetime, Field(alias='createdAt', examples=['2019-12-12T07:34:14.202Z'])]
modified_at: Annotated[AwareDatetime, Field(alias='modifiedAt', examples=['2019-12-13T08:36:13.202Z'])]
user_id: Annotated[str, Field(alias='userId', examples=['wRsJZtadYvn4mBZmm'])]
is_ad_hoc: Annotated[bool | None, Field(alias='isAdHoc', examples=[False])] = None
should_interpolate_strings: Annotated[bool | None, Field(alias='shouldInterpolateStrings', examples=[False])] = None
event_types: Annotated[list[WebhookEventType], Field(alias='eventTypes', examples=[['ACTOR.RUN.SUCCEEDED']])]
condition: WebhookCondition
ignore_ssl_errors: Annotated[bool, Field(alias='ignoreSslErrors', examples=[False])]
do_not_retry: Annotated[bool, Field(alias='doNotRetry', examples=[False])]
request_url: Annotated[AnyUrl, Field(alias='requestUrl', examples=['http://example.com/'])]
last_dispatch: Annotated[ExampleWebhookDispatch | None, Field(alias='lastDispatch')] = None
stats: WebhookStats | None = None
@docs_group('Models')
class ListOfWebhooks(PaginationResponse):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
items: list[WebhookShort]
@docs_group('Models')
class ListOfWebhooksResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: ListOfWebhooks
@docs_group('Models')
class ActorJobStatus(StrEnum):
"""Status of an Actor job (run or build)."""
READY = 'READY'
RUNNING = 'RUNNING'
SUCCEEDED = 'SUCCEEDED'
FAILED = 'FAILED'
TIMING_OUT = 'TIMING-OUT'
TIMED_OUT = 'TIMED-OUT'
ABORTING = 'ABORTING'
ABORTED = 'ABORTED'
@docs_group('Models')
class RunOrigin(StrEnum):
DEVELOPMENT = 'DEVELOPMENT'
WEB = 'WEB'
API = 'API'
SCHEDULER = 'SCHEDULER'
TEST = 'TEST'
WEBHOOK = 'WEBHOOK'
ACTOR = 'ACTOR'
CLI = 'CLI'
STANDBY = 'STANDBY'
@docs_group('Models')
class BuildsMeta(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
origin: RunOrigin
client_ip: Annotated[str | None, Field(alias='clientIp', examples=['172.234.12.34'])] = None
"""
IP address of the client that started the build.
"""
user_agent: Annotated[str | None, Field(alias='userAgent', examples=['Mozilla/5.0 (iPad)'])] = None
"""
User agent of the client that started the build.
"""
@docs_group('Models')
class BuildShort(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
act_id: Annotated[str | None, Field(alias='actId', examples=['janedoe~my-actor'])] = None
status: ActorJobStatus
started_at: Annotated[AwareDatetime, Field(alias='startedAt', examples=['2019-11-30T07:34:24.202Z'])]
finished_at: Annotated[AwareDatetime | None, Field(alias='finishedAt', examples=['2019-12-12T09:30:12.202Z'])] = (
None
)
usage_total_usd: Annotated[float, Field(alias='usageTotalUsd', examples=[0.02])]
meta: BuildsMeta | None = None
@docs_group('Models')
class ListOfBuilds(PaginationResponse):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
items: list[BuildShort]
@docs_group('Models')
class ListOfBuildsResponse(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
data: ListOfBuilds
@docs_group('Models')
class BuildStats(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
duration_millis: Annotated[int | None, Field(alias='durationMillis', examples=[1000])] = None
run_time_secs: Annotated[float | None, Field(alias='runTimeSecs', examples=[45.718])] = None
compute_units: Annotated[float, Field(alias='computeUnits', examples=[0.0126994444444444])]
@docs_group('Models')
class BuildOptions(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
use_cache: Annotated[bool | None, Field(alias='useCache', examples=[False])] = None
beta_packages: Annotated[bool | None, Field(alias='betaPackages', examples=[False])] = None
memory_mbytes: Annotated[int | None, Field(alias='memoryMbytes', examples=[1024])] = None
disk_mbytes: Annotated[int | None, Field(alias='diskMbytes', examples=[2048])] = None
@docs_group('Models')
class BuildUsage(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[0.08])] = None
@docs_group('Models')
class Storages(BaseModel):
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
dataset: dict[str, Any] | None = None
"""
Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)
"""
@docs_group('Models')
class ActorDefinition(BaseModel):
"""The definition of the Actor, the full specification of this field can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json)."""
model_config = ConfigDict(
extra='allow',
populate_by_name=True,
)
actor_specification: Annotated[Literal[1], Field(alias='actorSpecification')] = 1
"""
The Actor specification version that this Actor follows. This property must be set to 1.
"""
name: str | None = None
"""
The name of the Actor.
"""
version: Annotated[str | None, Field(pattern='^[0-9]+\\.[0-9]+$')] = None
"""
The version of the Actor, specified in the format [Number].[Number], e.g., 0.1, 1.0.
"""
build_tag: Annotated[str | None, Field(alias='buildTag')] = None
"""
The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified.
"""
environment_variables: Annotated[dict[str, str] | None, Field(alias='environmentVariables')] = None
"""
A map of environment variables to be used during local development and deployment.
"""
dockerfile: str | None = None
"""
The path to the Dockerfile used for building the Actor on the platform.
"""
docker_context_dir: Annotated[str | None, Field(alias='dockerContextDir')] = None
"""
The path to the directory used as the Docker context when building the Actor.
"""
readme: str | None = None
"""
The path to the README file for the Actor.
"""