# ActorVersionCollectionClient<!-- -->

Sub-client for the Actor version collection.

Provides methods to manage Actor versions, e.g. list or create them. Obtain an instance via an appropriate method on the `ActorClient` class.

### Hierarchy

* [ResourceClient](https://docs.apify.com/api/client/python/reference/class/ResourceClient.md)
  * *ActorVersionCollectionClient*

## Index[](#Index)

### Methods

* [\_\_init\_\_](https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md#__init__)
* [create](https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md#create)
* [iterate](https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md#iterate)
* [list](https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md#list)

### Properties

* [resource_id](https://docs.apify.com/api/client/python/reference/class/ActorVersionCollectionClient.md#resource_id)

## Methods<!-- -->[](#Methods)

### [](#__init__)\_\_init\_\_

* **\_\_init\_\_**(\*, base_url, public_base_url, http_client, resource_path, client_registry, resource_id, params, api_base_url): None

- Overrides [ResourceClient.\_\_init\_\_](https://docs.apify.com/api/client/python/reference/class/ResourceClient.md#__init__)

  Initialize the resource client.

  ***

  #### Parameters

  * ##### keyword-onlybase_url: str

    API base URL.

  * ##### keyword-onlypublic_base_url: str

    Public CDN base URL.

  * ##### keyword-onlyhttp_client: [HttpClient](https://docs.apify.com/api/client/python/reference/class/HttpClient.md)

    HTTP client for making requests.

  * ##### keyword-onlyresource_path: str

    Resource endpoint path (e.g., 'actors', 'datasets').

  * ##### keyword-onlyclient_registry: [ClientRegistry](https://docs.apify.com/api/client/python/reference/class/ClientRegistry.md)

    Bundle of client classes for dependency injection.

  * ##### optionalkeyword-onlyresource_id: str | None = <!-- -->None

    Optional resource ID for single-resource clients.

  * ##### optionalkeyword-onlyparams: [QueryParams](https://docs.apify.com/api/client/python/reference.md#QueryParams) | None = <!-- -->None

    Optional default parameters for all requests.

  * ##### optionalkeyword-onlyapi_base_url: str | None = <!-- -->None

    Base URL of the API itself, for clients of top-level resources. Defaults to `base_url`.

  #### Returns None

### [](#create)create

* **create**(\*, version_number, build_tag, env_vars, apply_env_vars_to_build, source_type, source_files, git_repo_url, tarball_url, github_gist_url, actor_path, timeout): [Version](https://docs.apify.com/api/client/python/reference/class/Version.md)

- Create a new Actor version.

  <https://docs.apify.com/api/v2#/reference/actors/version-collection/create-version>

  ***

  #### Parameters

  * ##### keyword-onlyversion_number: str

    Major and minor version of the Actor (e.g. `1.0`).

  * ##### optionalkeyword-onlybuild_tag: str | None = <!-- -->None

    Tag that is automatically set to the latest successful build of the current version.

  * ##### optionalkeyword-onlyenv_vars: [list](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#list)\[dict\[str, Any]] | None = <!-- -->None

    Environment variables that will be available to the Actor run process, and optionally also to the build process. See the API docs for their exact structure.

  * ##### optionalkeyword-onlyapply_env_vars_to_build: bool | None = <!-- -->None

    Whether the environment variables specified for the Actor run will also be set to the Actor build process.

  * ##### keyword-onlysource_type: [VersionSourceType](https://docs.apify.com/api/client/python/reference.md#VersionSourceType)

    What source type is the Actor version using.

  * ##### optionalkeyword-onlysource_files: [list](https://docs.apify.com/api/client/python/reference/class/ActorCollectionClient.md#list)\[dict\[str, Any]] | None = <!-- -->None

    Source code comprised of multiple files, each an item of the array. Required when `source_type` is `'SOURCE_FILES'`. See the API docs for the exact structure.

  * ##### optionalkeyword-onlygit_repo_url: str | None = <!-- -->None

    The URL of a Git repository from which the source code will be cloned. Required when `source_type` is `'GIT_REPO'`.

  * ##### optionalkeyword-onlytarball_url: str | None = <!-- -->None

    The URL of a tarball or a zip archive from which the source code will be downloaded. Required when `source_type` is `'TARBALL'`.

  * ##### optionalkeyword-onlygithub_gist_url: str | None = <!-- -->None

    The URL of a GitHub Gist from which the source will be downloaded. Required when `source_type` is `'GITHUB_GIST'`.

  * ##### optionalkeyword-onlyactor_path: str | None = <!-- -->None

    The Actor's directory inside the uploaded source, only for `'SOURCE_FILES'` and `'TARBALL'` versions. A relative path with `/` separators, such as `actors/my-actor`, of 1 to 255 characters, with no leading, trailing, or repeated `/` and no `.` or `..` segment. Without it, the root of the uploaded source is the Actor's directory.

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'short'

    Timeout for the API HTTP request.

  #### Returns [Version](https://docs.apify.com/api/client/python/reference/class/Version.md)

  The created Actor version.

### [](#iterate)iterate

* **iterate**(\*, timeout): Iterator\[[Version](https://docs.apify.com/api/client/python/reference/class/Version.md)]

- Iterate over the available Actor versions.

  The underlying API endpoint does not support pagination, so this method performs a single API call and yields the items from its response. If the endpoint returns more items than fit in one response (the API caps the page size), the rest are not returned. In practice this is rarely a concern — Actors are not expected to have more versions than the cap.

  <https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions>

  ***

  #### Parameters

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'short'

    Timeout for the API HTTP request.

  #### Returns Iterator\[[Version](https://docs.apify.com/api/client/python/reference/class/Version.md)]

### [](#list)list

* **list**(\*, timeout): [ListOfVersions](https://docs.apify.com/api/client/python/reference/class/ListOfVersions.md)

- List the available Actor versions.

  <https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-versions>

  ***

  #### Parameters

  * ##### optionalkeyword-onlytimeout: [Timeout](https://docs.apify.com/api/client/python/reference.md#Timeout) = <!-- -->'short'

    Timeout for the API HTTP request.

  #### Returns [ListOfVersions](https://docs.apify.com/api/client/python/reference/class/ListOfVersions.md)

  The list of available Actor versions.

## Properties<!-- -->[](#Properties)

### [](#resource_id)resource_id

resource_id: str | None

Inherited from [ResourceClientBase.resource_id](https://docs.apify.com/api/client/python/reference/class/ResourceClientBase.md#resource_id)

Get the resource ID.
