Skip to content

Commit 5bfd6cf

Browse files
docs: Add field descriptions to Actor models (#919)
- Updates the auto-generated Pydantic models and TypedDicts based on the proposed OpenAPI specification changes. - Based on apify-docs PR [#2731](apify/apify-docs#2731).
1 parent 7f61a10 commit 5bfd6cf

1 file changed

Lines changed: 74 additions & 51 deletions

File tree

src/apify_client/_models.py

Lines changed: 74 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,17 @@ class BuildStats(BaseModel):
550550

551551
@docs_group('Models')
552552
class BuildTag(BaseModel):
553+
"""The name of the build tag."""
554+
553555
model_config = ConfigDict(
554556
extra='allow',
555557
populate_by_name=True,
556558
alias_generator=to_camel,
557559
)
558560
build_id: str
561+
"""
562+
The ID of the build to assign to the tag.
563+
"""
559564

560565

561566
@docs_group('Models')
@@ -714,24 +719,42 @@ class CreateOrUpdateVersionRequest(BaseModel):
714719
alias_generator=to_camel,
715720
)
716721
version_number: Annotated[
717-
str | None, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')
722+
str | None, Field(examples=['1.6'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')
718723
] = None
724+
"""
725+
The version number of the Actor. Two numbers separated by a dot, that represent the `MAJOR.MINOR` part of the semantic versioning.
726+
"""
719727
source_type: VersionSourceType | None = None
720-
env_vars: list[EnvVarRequest] | None = None
728+
"""
729+
Where the source code of the version lives.
730+
"""
731+
env_vars: list[EnvVar] | None = None
732+
"""
733+
Environment variables for the version.
734+
"""
721735
apply_env_vars_to_build: Annotated[bool | None, Field(examples=[False])] = None
736+
"""
737+
Whether to inject the environment variables at build time.
738+
"""
722739
build_tag: Annotated[str | None, Field(examples=['latest'])] = None
740+
"""
741+
The tag name to apply to a successful build of this version. Can be `null` when the version has no build tag.
742+
"""
723743
source_files: Annotated[list[SourceCodeFile | SourceCodeFolder] | None, Field(title='VersionSourceFiles')] = None
744+
"""
745+
Applies when the `sourceType` is `SOURCE_FILES`. Represents the Actor's file structure as an array of files and folders.
746+
"""
724747
git_repo_url: str | None = None
725748
"""
726-
URL of the Git repository when sourceType is GIT_REPO.
749+
URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
727750
"""
728751
tarball_url: str | None = None
729752
"""
730-
URL of the tarball when sourceType is TARBALL.
753+
URL of the tarball to download the source code from. Applies when the `sourceType` is `TARBALL`.
731754
"""
732755
github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
733756
"""
734-
URL of the GitHub Gist when sourceType is GITHUB_GIST.
757+
URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.
735758
"""
736759

737760

@@ -3491,15 +3514,38 @@ class UpdateActorRequest(BaseModel):
34913514
populate_by_name=True,
34923515
alias_generator=to_camel,
34933516
)
3494-
name: Annotated[str | None, Field(examples=['MyActor'])] = None
3495-
description: Annotated[str | None, Field(examples=['My favourite actor!'])] = None
3517+
name: Annotated[str | None, Field(examples=['instagram-scraper'])] = None
3518+
"""
3519+
The identifier of the Actor. Use lowercase letters, numbers, and hyphens. Spaces or special characters aren't allowed. Must be unique across your account.
3520+
"""
3521+
description: Annotated[str | None, Field(examples=['This scraper extracts posts and comments from Instagram.'])] = (
3522+
None
3523+
)
3524+
"""
3525+
Short description of the Actor, displayed in Apify Store and Console.
3526+
"""
34963527
is_public: Annotated[bool | None, Field(examples=[False])] = None
3528+
"""
3529+
Whether the Actor is available to users in Apify Store. If `false`, the Actor is private and only visible to you.
3530+
"""
34973531
actor_permission_level: ActorPermissionLevel | None = None
3498-
seo_title: Annotated[str | None, Field(examples=['My actor'])] = None
3499-
seo_description: Annotated[str | None, Field(examples=['My actor is the best'])] = None
3500-
title: Annotated[str | None, Field(examples=['My Actor'])] = None
3532+
seo_title: Annotated[str | None, Field(examples=['Free Instagram scraper'])] = None
3533+
"""
3534+
Name of the Actor to display by search engines such as Google. Can be different from the Actor's name displayed in Apify Store and Console. Recommended length is 40-50 characters.
3535+
"""
3536+
seo_description: Annotated[str | None, Field(examples=['The best scraper for Instagram'])] = None
3537+
"""
3538+
Description of the Actor to display by search engines such as Google. Recommended length is 140-156 characters.
3539+
"""
3540+
title: Annotated[str | None, Field(examples=['Instagram scraper'])] = None
3541+
"""
3542+
Human-readable name of the Actor, displayed in Apify 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.
3543+
"""
35013544
restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
35023545
versions: list[CreateOrUpdateVersionRequest] | None = None
3546+
"""
3547+
An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
3548+
"""
35033549
pricing_infos: (
35043550
list[
35053551
Annotated[
@@ -3512,55 +3558,32 @@ class UpdateActorRequest(BaseModel):
35123558
]
35133559
| None
35143560
) = None
3515-
categories: list[str] | None = None
3561+
categories: Annotated[list[str] | None, Field(examples=[['SOCIAL_MEDIA']])] = None
3562+
"""
3563+
A list of categories that best define the Actor. Reflected in Apify Store's search and filtering options.
3564+
"""
35163565
default_run_options: DefaultRunOptions | None = None
3566+
"""
3567+
The default settings applied to an Actor run. Can be overridden by the user.
3568+
"""
35173569
tagged_builds: Annotated[
35183570
dict[str, Any] | None, Field(examples=[{'latest': {'buildId': 'z2EryhbfhgSyqj6Hn'}, 'beta': None}])
35193571
] = None
35203572
"""
3521-
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`.
3522-
3523-
This operation is a patch; any existing tags that you omit from this object will be preserved.
3524-
3525-
- **To create or reassign a tag**, provide the tag name with a `buildId`. e.g., to assign the _latest_ tag:
3526-
3527-
 
3528-
3529-
```json
3530-
{
3531-
"latest": {
3532-
"buildId": "z2EryhbfhgSyqj6Hn"
3533-
}
3534-
}
3535-
```
3536-
3537-
- **To remove a tag**, provide the tag name with a `null` value. e.g., to remove the _beta_ tag:
3538-
3539-
 
3540-
3541-
```json
3542-
{
3543-
"beta": null
3544-
}
3545-
```
3546-
3547-
- **To perform multiple operations**, combine them. The following reassigns _latest_ and removes _beta_, while preserving any other existing tags.
3548-
3549-
 
3550-
3551-
```json
3552-
{
3553-
"latest": {
3554-
"buildId": "z2EryhbfhgSyqj6Hn"
3555-
},
3556-
"beta": null
3557-
}
3558-
```
3559-
3573+
A dictionary that maps tag names to specific builds. For details, see [Update build tags](#update-build-tags).
35603574
"""
35613575
actor_standby: ActorStandby | None = None
3576+
"""
3577+
The configuration of the Actor's standby mode. For details, see [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby).
3578+
"""
35623579
example_run_input: ExampleRunInput | None = None
3580+
"""
3581+
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.
3582+
"""
35633583
is_deprecated: bool | None = None
3584+
"""
3585+
Whether the Actor is deprecated.
3586+
"""
35643587

35653588

35663589
@docs_group('Models')
@@ -3745,7 +3768,7 @@ class Version(BaseModel):
37453768
)
37463769
version_number: Annotated[str, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')]
37473770
"""
3748-
The version number of the Actor. Must be a dot-separated sequence of numbers.
3771+
The version number of the Actor. Two numbers separated by a dot, that represent the `MAJOR.MINOR` part of the semantic versioning.
37493772
"""
37503773
source_type: VersionSourceType | None
37513774
"""

0 commit comments

Comments
 (0)