# generated by datamodel-codegen

from __future__ import annotations

from enum import Enum
from typing import Annotated, Any, Literal

from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, EmailStr, Field, RootModel
from pydantic.alias_generators import to_camel

from apify_client._docs import docs_group
from apify_client._literals import (
    ActorJobStatus,
    ActorPermissionLevel,
    ErrorType,
    GeneralAccess,
    HttpMethod,
    RunOrigin,
    SourceCodeFileFormat,
    VersionSourceType,
    WebhookDispatchStatus,
    WebhookEventType,
)


@docs_group('Models')
class AccountLimits(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    monthly_usage_cycle: UsageCycle
    limits: Limits
    current: Current


@docs_group('Models')
class ActVersion(BaseModel):
    """Snapshot of the Actor version that this build was created from."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    source_type: VersionSourceType | None = None
    build_tag: Annotated[str | None, Field(examples=['experimental'])] = None
    version_number: Annotated[
        str | None, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')
    ] = None
    git_repo_url: Annotated[
        str | None, Field(examples=['https://github.com/apifytech/actor-crawler.git#experimental:web-scraper'])
    ] = None
    """
    URL of the git repository, present when sourceType is GIT_REPO.
    """
    source_files: list[SourceCodeFile] | None = None
    """
    Inline source files, present when sourceType is SOURCE_FILES.
    """


@docs_group('Models')
class Actor(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
    """
    The ID of the Actor.
    """
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    """
    The ID of the user who owns the Actor.
    """
    name: Annotated[str, Field(examples=['google-search-extractor'])]
    """
    The name of the Actor.
    """
    username: Annotated[str, Field(examples=['compass'])]
    """
    The username of the Actor owner.
    """
    description: Annotated[str | None, Field(examples=['Extract data from hundreds of places fast.'])] = None
    """
    Short description of the Actor, displayed in Apify Store and Console.
    """
    restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
    is_public: Annotated[bool, Field(examples=[False])]
    """
    Whether the Actor is available to users in Apify Store.
    """
    actor_permission_level: ActorPermissionLevel | None = None
    created_at: Annotated[AwareDatetime, Field(examples=['2019-07-08T11:27:57.401Z'])]
    """
    The date and time the Actor was created. Follows the ISO 8601 format.
    """
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-07-08T14:01:05.546Z'])]
    """
    The date and time the Actor was last modified. Follows the ISO 8601 format.
    """
    stats: ActorStats
    versions: list[Version]
    """
    An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
    """
    pricing_infos: (
        list[
            Annotated[
                PayPerEventActorPricingInfo
                | PricePerDatasetItemActorPricingInfo
                | FlatPricePerMonthActorPricingInfo
                | FreeActorPricingInfo,
                Field(discriminator='pricing_model'),
            ]
        ]
        | None
    ) = None
    default_run_options: DefaultRunOptions
    example_run_input: ExampleRunInput | None = None
    is_deprecated: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor is deprecated.
    """
    deployment_key: Annotated[str | None, Field(examples=['ssh-rsa AAAA ...'])] = None
    """
    The Actor's public SSH key, used as a deployment key for private Git repositories.
    """
    title: Annotated[str | None, Field(examples=['Google Search Extractor'])] = None
    """
    Human-readable name of the Actor, displayed in Apify Store and Console.
    """
    tagged_builds: dict[str, TaggedBuildInfo | None] | None = None
    actor_standby: ActorStandby | None = None
    readme_summary: str | None = None
    """
    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.
    """
    seo_title: Annotated[str | None, Field(examples=['Web Scraper'])] = None
    """
    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.
    """
    seo_description: Annotated[
        str | None, Field(examples=['Crawls websites using Chrome and extracts data from pages using JavaScript.'])
    ] = None
    """
    Description of the Actor to display by search engines such as Google.
    """
    picture_url: Annotated[
        str | None, Field(examples=['https://apify-image-uploads-prod.s3.amazonaws.com/.../actor-picture.png'])
    ] = None
    """
    URL of the Actor's icon, displayed on the Actor's page in Apify Store and Console.
    """
    standby_url: Annotated[str | None, Field(examples=['https://jane35--my-actor.apify.actor'])] = None
    """
    URL for sending requests to the Actor in Standby mode.
    `null` if the Standby mode isn't enabled.

    """
    notice: ActorNotice | None = None
    categories: Annotated[list[str] | None, Field(examples=[['DEVELOPER_TOOLS', 'OPEN_SOURCE']])] = None
    """
    A list of categories that best define the Actor. Reflected in Apify Store's search and filtering options.
    """
    is_critical: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor is maintained by Apify.
    """
    is_generic: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor is intended for developers. Set by Apify.
    """
    is_source_code_hidden: Annotated[bool | None, Field(examples=[True])] = True
    """
    Whether the Actor's source files are hidden on its detail page.
    """
    has_no_dataset: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor stores results in a dataset. Set by Apify.
    """


@docs_group('Models')
class ActorChargeEvent(BaseModel):
    """Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced
    (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    event_title: str
    """
    Human-readable title shown to users in the billing UI.
    """
    event_description: str
    """
    Human-readable description of what triggers this event.
    """
    event_price_usd: float | None = None
    """
    Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`.

    """
    event_tiered_pricing_usd: dict[str, TieredPricingPerEventEntry] | None = None
    is_primary_event: bool | None = None
    """
    Whether this event is the Actor's primary chargeable event.
    """
    is_one_time_event: bool | None = None
    """
    Whether this event can only be charged once per Actor run.
    """


@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,
        alias_generator=to_camel,
    )
    actor_specification: Literal[1] | None = None
    """
    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, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`).
    """
    build_tag: str | None = None
    """
    The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified.
    """
    environment_variables: dict[str, str] | None = 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: str | None = 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.
    """
    input: dict[str, Any] | None = None
    """
    The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema)
    """
    changelog: str | None = None
    """
    The path to the CHANGELOG file displayed in the Actor's information tab.
    """
    storages: Storages | None = None
    default_memory_mbytes: str | int | None = None
    """
    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](https://docs.apify.com/actors/development/actor-definition/dynamic-actor-memory).
    """
    min_memory_mbytes: Annotated[int | None, Field(ge=128)] = None
    """
    Specifies the minimum amount of memory in megabytes required by the Actor.
    """
    max_memory_mbytes: Annotated[int | None, Field(ge=128)] = None
    """
    Specifies the maximum amount of memory in megabytes required by the Actor.
    """
    uses_standby_mode: bool | None = None
    """
    Specifies whether Standby mode is enabled for the Actor.
    """


@docs_group('Models')
class ActorNotice(Enum):
    """A warning displayed on the Actor's page in Apify Store and Console. Can be set by the Actor's developer or automatically by Apify's quality checks."""

    NONE = 'NONE'
    RESIDENTIAL_PROXY_REQUIRED = 'RESIDENTIAL_PROXY_REQUIRED'
    UNDER_MAINTENANCE = 'UNDER_MAINTENANCE'
    NONE_TYPE_NONE = None


@docs_group('Models')
class ActorResponse(BaseModel):
    """Response containing Actor data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Actor


@docs_group('Models')
class ActorShort(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['br9CKmk457'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-10-29T07:34:24.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(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 ActorStandby(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    is_enabled: bool | None = None
    """
    Whether standby mode is enabled for the Actor.
    """
    desired_requests_per_actor_run: int | None = None
    """
    Target number of concurrent HTTP requests a single run is configured to handle.
    """
    max_requests_per_actor_run: int | None = None
    """
    Maximum number of concurrent HTTP requests that can be routed to a single run.
    """
    idle_timeout_secs: int | None = None
    """
    In seconds, how long a run can stay idle without incoming requests before it's terminated.
    """
    build: str | None = None
    """
    Which build to run in standby mode. Either a build tag or a version number.
    """
    memory_mbytes: int | None = None
    """
    In MB, the amount of memory allocated to the run.
    """
    disable_standby_fields_override: bool | None = None
    """
    If `true`, prevents the standby mode configuration from being overridden elsewhere.
    """
    should_pass_actor_input: bool | None = None
    """
    Whether to pass the Actor's input to the standby run. If `false`, the standby runs start with no input.
    """


@docs_group('Models')
class ActorStats(BaseModel):
    """Usage statistics and Apify Store metrics for the Actor."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    total_builds: Annotated[int | None, Field(examples=[9])] = None
    """
    The total number of builds of the Actor.
    """
    total_runs: Annotated[int | None, Field(examples=[16])] = None
    """
    The total number of runs of the Actor.
    """
    total_users: Annotated[int | None, Field(examples=[6])] = None
    """
    The total number of Actor users, including its owner.
    """
    total_users7_days: Annotated[int | None, Field(examples=[2])] = None
    """
    The number of active users of the Actor in the last 7 days.
    """
    total_users30_days: Annotated[int | None, Field(examples=[6])] = None
    """
    The number of active users of the Actor in the last 30 days.
    """
    total_users90_days: Annotated[int | None, Field(examples=[6])] = None
    """
    The number of active users of the Actor in the last 90 days.
    """
    total_metamorphs: Annotated[int | None, Field(examples=[2])] = None
    """
    The total number of times a run of another Actor was [metamorphed](https://docs.apify.com/platform/actors/development/programming-interface/metamorph) into this Actor.
    """
    last_run_started_at: Annotated[AwareDatetime | None, Field(examples=['2019-07-08T14:01:05.546Z'])] = None
    """
    The date and time the most recent run of the Actor started.
    """
    actor_review_count: Annotated[int | None, Field(examples=[69])] = None
    """
    The number of reviews the Actor has received in Apify Store.
    """
    actor_review_rating: Annotated[float | None, Field(examples=[4.7])] = None
    """
    The average rating of the Actor in Apify Store.
    """
    bookmark_count: Annotated[int | None, Field(examples=[1269])] = None
    """
    The number of users who bookmarked the Actor in Apify Store.
    """
    public_actor_run_stats30_days: PublicActorRunStats30Days | None = None
    """
    Run status counts from the last 30 days. Only for public Actors.
    Excludes runs started by the Actor's owner.

    """


@docs_group('Models')
class AddRequestResponse(BaseModel):
    """Response containing the result of adding a request to the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: RequestRegistration


@docs_group('Models')
class AddedRequest(BaseModel):
    """Information about a request that was successfully added to a request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    request_id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    was_already_present: Annotated[bool, Field(examples=[False])]
    """
    Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created.
    """
    was_already_handled: Annotated[bool, Field(examples=[False])]
    """
    Indicates whether a request with the same unique key has already been processed by the request queue.
    """


@docs_group('Models')
class BatchAddResponse(BaseModel):
    """Response containing the result of a batch add operation."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: BatchAddResult


@docs_group('Models')
class BatchAddResult(BaseModel):
    """Result of a batch add operation containing successfully processed and failed requests."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    processed_requests: list[AddedRequest]
    """
    Requests that were successfully added to the request queue.
    """
    unprocessed_requests: list[RequestDraft]
    """
    Requests that failed to be added and can be retried.
    """


@docs_group('Models')
class BatchDeleteResponse(BaseModel):
    """Response containing the result of a batch delete operation."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: BatchDeleteResult


@docs_group('Models')
class BatchDeleteResult(BaseModel):
    """Result of a batch delete operation containing successfully deleted and failed requests."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    processed_requests: list[DeletedRequestById | DeletedRequestByUniqueKey]
    """
    Requests that were successfully deleted from the request queue.
    """
    unprocessed_requests: list[RequestDraft]
    """
    Requests that failed to be deleted and can be retried.
    """


@docs_group('Models')
class BrowserInfoResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    method: Annotated[str, Field(examples=['GET'])]
    """
    HTTP method of the request.
    """
    client_ip: Annotated[str | None, Field(examples=['1.2.3.4'])]
    """
    IP address of the client.
    """
    country_code: Annotated[str | None, Field(examples=['US'])]
    """
    Two-letter country code resolved from the client IP address.
    """
    body_length: Annotated[int, Field(examples=[0])]
    """
    Length of the request body in bytes.
    """
    headers: dict[str, str | list[str]] | None = None
    """
    Request headers. Omitted when `skipHeaders=true`.

    """
    raw_headers: list[str] | None = None
    """
    Raw request headers as a flat list of alternating name/value strings.
    Included only when `rawHeaders=true`.

    """


@docs_group('Models')
class Build(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
    act_id: Annotated[str, Field(examples=['janedoe~my-actor'])]
    user_id: Annotated[str, Field(examples=['klmdEpoiojmdEMlk3'])]
    started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
    status: ActorJobStatus
    meta: BuildsMeta
    stats: BuildStats | None = None
    options: BuildOptions | None = None
    usage: BuildUsage | None = None
    usage_total_usd: Annotated[float | None, Field(examples=[0.02])] = None
    """
    Total cost in USD for this build. Requires authentication token to access.
    """
    usage_usd: BuildUsage | None = None
    """
    Platform usage costs breakdown in USD for this build. Requires authentication token to access.
    """
    input_schema: Annotated[str | None, Field(deprecated=True, examples=['{\\n  "title": "Schema for ... }'])] = None
    readme: Annotated[str | None, Field(deprecated=True, examples=['# Magic Actor\\nThis Actor is magic.'])] = None
    build_number: Annotated[
        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})$')
    ]
    act_version: Annotated[ActVersion | None, Field(title='BuildActVersion')] = None
    """
    Snapshot of the Actor version that this build was created from.
    """
    actor_definition: ActorDefinition | None = None


@docs_group('Models')
class BuildOptions(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    use_cache: Annotated[bool | None, Field(examples=[False])] = None
    beta_packages: Annotated[bool | None, Field(examples=[False])] = None
    memory_mbytes: Annotated[int | None, Field(examples=[1024])] = None
    disk_mbytes: Annotated[int | None, Field(examples=[2048])] = None


@docs_group('Models')
class BuildResponse(BaseModel):
    """Response containing Actor build data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Build


@docs_group('Models')
class BuildShort(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
    act_id: Annotated[str | None, Field(examples=['janedoe~my-actor'])] = None
    user_id: Annotated[str | None, Field(examples=['klmdEpoiojmdEMlk3'])] = None
    status: ActorJobStatus
    started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
    usage_total_usd: Annotated[float, Field(examples=[0.02])]
    build_number: Annotated[
        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})$')
    ]
    build_number_int: Annotated[int | None, Field(examples=[10000])] = None
    meta: BuildsMeta | None = None


@docs_group('Models')
class BuildStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    duration_millis: Annotated[int | None, Field(examples=[1000])] = None
    run_time_secs: Annotated[float | None, Field(examples=[45.718])] = None
    compute_units: Annotated[float | None, Field(examples=[0.0126994444444444])] = None
    image_size_bytes: Annotated[int | None, Field(examples=[975770223])] = None


@docs_group('Models')
class BuildTag(BaseModel):
    """The name of the build tag."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    build_id: str
    """
    The ID of the build to assign to the tag.
    """


@docs_group('Models')
class BuildUsage(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[0.08])] = None


@docs_group('Models')
class BuildsMeta(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    origin: RunOrigin
    client_ip: Annotated[str | None, Field(examples=['172.234.12.34'])] = None
    """
    IP address of the client that started the build.
    """
    user_agent: Annotated[str | None, Field(examples=['Mozilla/5.0 (iPad)'])] = None
    """
    User agent of the client that started the build.
    """


@docs_group('Models')
class Call(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    started_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T07:34:14.202Z'])] = None
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T07:34:14.202Z'])] = None
    error_message: Annotated[str | None, Field(examples=['Cannot send request'])] = None
    response_status: Annotated[int | None, Field(examples=[200])] = None
    response_body: Annotated[str | None, Field(examples=['{"foo": "bar"}'])] = None


@docs_group('Models')
class ChargeRunRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    event_name: Annotated[str, Field(examples=['ANALYZE_PAGE'])]
    count: Annotated[int, Field(examples=[1])]


@docs_group('Models')
class CommonActorPricingInfo(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    apify_margin_percentage: Annotated[float, Field(examples=[0.2])]
    """
    Apify's share of the revenue generated under this pricing info record, as a fraction between 0 and 1. Set by the Apify platform.

    """
    created_at: AwareDatetime
    """
    When this pricing info record has been created
    """
    started_at: AwareDatetime
    """
    Since when is this pricing info record effective for a given Actor
    """
    notified_about_future_change_at: AwareDatetime | None = None
    notified_about_change_at: AwareDatetime | None = None
    reason_for_change: str | None = None
    is_price_change_notification_suppressed: bool | None = None
    force_contains_significant_price_change: bool | None = None


@docs_group('Models')
class CreateActorRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str | None, Field(examples=['instagram-scraper'])] = None
    """
    The identifier of the Actor. Use lowercase letters, numbers, and hyphens. Spaces or special characters aren't allowed. Must be unique across your account.
    """
    description: Annotated[str | None, Field(examples=['This scraper extracts posts and comments from Instagram.'])] = (
        None
    )
    """
    Short description of the Actor, displayed in Apify Store and Console.
    """
    title: Annotated[str | None, Field(examples=['Instagram scraper'])] = None
    """
    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.
    """
    is_public: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor is available to users in Apify Store. If `false`, the Actor is private and only visible to you.
    """
    seo_title: Annotated[str | None, Field(examples=['Free Instagram scraper'])] = None
    """
    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.
    """
    seo_description: Annotated[str | None, Field(examples=['The best scraper for Instagram'])] = None
    """
    Description of the Actor to display by search engines such as Google. Recommended length is 140-156 characters.
    """
    restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
    versions: list[Version] | None = None
    """
    An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
    """
    categories: Annotated[list[str] | None, Field(examples=[['SOCIAL_MEDIA']])] = None
    """
    A list of categories that best define the Actor. Reflected in Apify Store's search and filtering options.
    """
    default_run_options: DefaultRunOptions | None = None
    actor_standby: ActorStandby | None = None
    """
    The configuration of the Actor's standby mode. For details, see [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby).
    """
    example_run_input: ExampleRunInput | None = None
    """
    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.
    """
    is_deprecated: bool | None = None
    """
    Whether the Actor is deprecated.
    """


@docs_group('Models')
class CreateOrUpdateVersionRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    version_number: Annotated[
        str | None, Field(examples=['1.6'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')
    ] = None
    """
    The version number of the Actor. Two numbers separated by a dot, that represent the `MAJOR.MINOR` part of the semantic versioning.
    """
    source_type: VersionSourceType | None = None
    """
    Where the source code of the version lives.
    """
    env_vars: list[EnvVar] | None = None
    """
    Environment variables for the version.
    """
    apply_env_vars_to_build: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether to inject the environment variables at build time.
    """
    build_tag: Annotated[str | None, Field(examples=['latest'])] = None
    """
    The tag name to apply to a successful build of this version. Can be `null` when the version has no build tag.
    """
    source_files: Annotated[list[SourceCodeFile | SourceCodeFolder] | None, Field(title='VersionSourceFiles')] = None
    """
    Applies when the `sourceType` is `SOURCE_FILES`. Represents the Actor's file structure as an array of files and folders.
    """
    git_repo_url: str | None = None
    """
    URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
    """
    tarball_url: str | None = None
    """
    URL of the tarball to download the source code from. Applies when the `sourceType` is `TARBALL`.
    """
    github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
    """
    URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.
    """


@docs_group('Models')
class CreateTaskRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
    name: Annotated[str | None, Field(examples=['my-task'])] = None
    options: TaskOptions | None = None
    input: TaskInput | list[TaskInput] | None = None
    title: str | None = None
    description: str | None = None
    actor_standby: ActorStandby | None = None
    public_config: TaskPublicConfig | None = None
    """
    Configuration that controls how the published task appears on its public landing page.
    Editing this object requires write permission to the Actor that the task belongs to.

    """


@docs_group('Models')
class Current(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    monthly_usage_usd: Annotated[float, Field(examples=[43])]
    monthly_actor_compute_units: Annotated[float, Field(examples=[500.784475])]
    monthly_external_data_transfer_gbytes: Annotated[float, Field(examples=[3.00861903931946])]
    monthly_proxy_serps: Annotated[int, Field(examples=[34])]
    monthly_residential_proxy_gbytes: Annotated[float, Field(examples=[0.4])]
    actor_memory_gbytes: Annotated[float, Field(examples=[8])]
    actor_count: Annotated[int, Field(examples=[31])]
    actor_task_count: Annotated[int, Field(examples=[130])]
    active_actor_job_count: Annotated[int, Field(examples=[0])]
    team_account_seat_count: Annotated[int, Field(examples=[5])]
    schedule_count: Annotated[int | None, Field(examples=[77])] = None


@docs_group('Models')
class CurrentPricingInfo(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    pricing_model: Annotated[str, Field(examples=['FREE'])]
    apify_margin_percentage: Annotated[float | None, Field(examples=[0.2])] = None
    """
    Apify's share of the revenue generated under this pricing info record, as a fraction between 0 and 1. Set by the Apify platform.

    """
    created_at: Annotated[AwareDatetime | None, Field(examples=['2023-01-01T00:00:00.000Z'])] = None
    started_at: Annotated[AwareDatetime | None, Field(examples=['2023-01-01T00:00:00.000Z'])] = None
    notified_about_change_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None
    notified_about_future_change_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None
    is_price_change_notification_suppressed: Annotated[bool | None, Field(examples=[False])] = None
    force_contains_significant_price_change: Annotated[bool | None, Field(examples=[False])] = None
    is_ppe_platform_usage_paid_by_user: Annotated[
        bool | None, Field(alias='isPPEPlatformUsagePaidByUser', examples=[False])
    ] = None
    reason_for_change: Annotated[str | None, Field(examples=[None])] = None
    trial_minutes: Annotated[int | None, Field(examples=[None])] = None
    unit_name: Annotated[str | None, Field(examples=[None])] = None
    price_per_unit_usd: Annotated[float | None, Field(examples=[None])] = None
    minimal_max_total_charge_usd: Annotated[float | None, Field(examples=[0.5])] = None
    pricing_per_event: dict[str, Any] | None = None
    """
    Per-event pricing configuration for pay-per-event Actors.
    """


@docs_group('Models')
class DailyServiceUsages(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    date: Annotated[AwareDatetime, Field(examples=['2022-10-02T00:00:00.000Z'])]
    service_usage: dict[str, UsageItem]
    total_usage_credits_usd: Annotated[float, Field(examples=[0.0474385791970591])]


@docs_group('Models')
class Dataset(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
    name: Annotated[str | None, Field(examples=['d7b9MDYsbtX5L7XAj'])] = None
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
    item_count: Annotated[int, Field(examples=[7], ge=0)]
    clean_item_count: Annotated[int, Field(examples=[5], ge=0)]
    act_id: str | None = None
    act_run_id: str | None = None
    fields: list[str] | None = None
    schema_: Annotated[
        dict[str, Any] | None,
        Field(
            alias='schema',
            examples=[
                {
                    'actorSpecification': 1,
                    'title': 'My dataset',
                    'views': {
                        'overview': {
                            'title': 'Overview',
                            'transformation': {'fields': ['linkUrl']},
                            'display': {
                                'component': 'table',
                                'properties': {'linkUrl': {'label': 'Link URL', 'format': 'link'}},
                            },
                        }
                    },
                }
            ],
        ),
    ] = None
    """
    Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/storage/dataset-schema)
    """
    console_url: Annotated[AnyUrl, Field(examples=['https://console.apify.com/storage/datasets/27TmTznX9YPeAYhkC'])]
    items_public_url: Annotated[
        AnyUrl | None, Field(examples=['https://api.apify.com/v2/datasets/WkzbQMuFYuamGv3YF/items?signature=abc123'])
    ] = None
    """
    A public link to access the dataset items directly.
    """
    url_signing_secret_key: str | None = None
    """
    A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the dataset.
    """
    general_access: GeneralAccess | None = None
    stats: DatasetStats | None = None


@docs_group('Models')
class DatasetFieldStatistics(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    min: float | None = None
    """
    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.
    """
    max: float | None = None
    """
    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.
    """
    null_count: int | None = None
    """
    How many items in the dataset have a null value for this field.
    """
    empty_count: int | None = None
    """
    How many items in the dataset are `undefined`, meaning that for example empty string is not considered empty.
    """


@docs_group('Models')
class DatasetListItem(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
    name: Annotated[str, Field(examples=['d7b9MDYsbtX5L7XAj'])]
    user_id: Annotated[str, Field(examples=['tbXmWu7GCxnyYtSiL'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
    item_count: Annotated[int, Field(examples=[7])]
    clean_item_count: Annotated[int, Field(examples=[5])]
    act_id: Annotated[str | None, Field(examples=['zdc3Pyhyz3m8vjDeM'])] = None
    act_run_id: Annotated[str | None, Field(examples=['HG7ML7M8z78YcAPEB'])] = None
    title: Annotated[str | None, Field(examples=['My Dataset'])] = None
    username: Annotated[str | None, Field(examples=['janedoe'])] = None
    general_access: GeneralAccess | None = None
    stats: DatasetStats | None = None


@docs_group('Models')
class DatasetResponse(BaseModel):
    """Response containing dataset metadata."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Dataset


@docs_group('Models')
class DatasetSchemaValidationError(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    type: Annotated[str | None, Field(examples=['schema-validation-error'])] = None
    """
    The type of the error.
    """
    message: Annotated[str | None, Field(examples=['Schema validation failed'])] = None
    """
    A human-readable message describing the error.
    """
    data: SchemaValidationErrorData | None = None


@docs_group('Models')
class DatasetStatistics(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    field_statistics: dict[str, Any] | None = None
    """
    When you configure the dataset [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation), 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](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation#dataset-field-statistics) for more information.
    """


@docs_group('Models')
class DatasetStatisticsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: DatasetStatistics


@docs_group('Models')
class DatasetStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    read_count: Annotated[int | None, Field(examples=[22])] = None
    write_count: Annotated[int | None, Field(examples=[3])] = None
    storage_bytes: Annotated[int | None, Field(examples=[783])] = None
    """
    Total storage size in bytes. Only returned by the single-dataset endpoint.
    """
    inflated_bytes: Annotated[int | None, Field(examples=[0])] = None
    """
    Uncompressed size in bytes. Only returned by the dataset list endpoint.
    """


@docs_group('Models')
class Datasets(BaseModel):
    """Aliased dataset IDs for this run."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    __annotations__ = {
        '__pydantic_extra__': dict[str, str],
    }
    default: Annotated[str | None, Field(examples=['wmKPijuyDnPZAPRMk'])] = None
    """
    ID of the default dataset for this run.
    """


@docs_group('Models')
class DecodeAndVerifyData(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    decoded: Any
    """
    The original object that was encoded.
    """
    encoded_by_user_id: Annotated[str | None, Field(examples=['wRwJZtadYvn4mBZmm'])]
    is_verified_user: Annotated[bool, Field(examples=[False])]


@docs_group('Models')
class DecodeAndVerifyResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: DecodeAndVerifyData


@docs_group('Models')
class DefaultRunOptions(BaseModel):
    """The default settings applied to an Actor run. Can be overridden elsewhere."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    build: Annotated[str | None, Field(examples=['latest'])] = None
    """
    Which build to run. Either a build tag or a version number.
    """
    timeout_secs: Annotated[int | None, Field(examples=[3600])] = None
    """
    Timeout in seconds. 0 if no timeout.
    """
    memory_mbytes: Annotated[int | None, Field(examples=[2048])] = None
    """
    In MB, the amount of memory allocated to the run.
    """
    restart_on_error: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether to automatically restart the run if it fails.
    """
    max_items: int | None = None
    """
    Maximum number of items the run might produce.
    """
    force_permission_level: ActorPermissionLevel | None = None


@docs_group('Models')
class DeletedRequestById(BaseModel):
    """Confirmation of a request that was successfully deleted, identified by its ID."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])] = None
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """


@docs_group('Models')
class DeletedRequestByUniqueKey(BaseModel):
    """Confirmation of a request that was successfully deleted, identified by its unique key."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
    """
    A unique identifier assigned to the request.
    """


@docs_group('Models')
class EffectivePlatformFeature(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    is_enabled: Annotated[bool, Field(examples=[True])]
    disabled_reason: Annotated[
        str | None,
        Field(
            examples=[
                'The "Selected public Actors for developers" feature is not enabled for your account. Please upgrade your plan or contact support@apify.com'
            ]
        ),
    ]
    disabled_reason_type: Annotated[str | None, Field(examples=['DISABLED'])]
    is_trial: Annotated[bool, Field(examples=[False])]
    trial_expiration_at: Annotated[AwareDatetime | None, Field(examples=['2025-01-01T14:00:00.000Z'])]


@docs_group('Models')
class EffectivePlatformFeatures(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actors: Annotated[EffectivePlatformFeature, Field(alias='ACTORS')]
    storage: Annotated[EffectivePlatformFeature, Field(alias='STORAGE')]
    scheduler: Annotated[EffectivePlatformFeature, Field(alias='SCHEDULER')]
    proxy: Annotated[EffectivePlatformFeature, Field(alias='PROXY')]
    proxy_external_access: Annotated[EffectivePlatformFeature, Field(alias='PROXY_EXTERNAL_ACCESS')]
    proxy_residential: Annotated[EffectivePlatformFeature, Field(alias='PROXY_RESIDENTIAL')]
    proxy_serps: Annotated[EffectivePlatformFeature, Field(alias='PROXY_SERPS')]
    webhooks: Annotated[EffectivePlatformFeature, Field(alias='WEBHOOKS')]
    actors_public_all: Annotated[EffectivePlatformFeature, Field(alias='ACTORS_PUBLIC_ALL')]
    actors_public_developer: Annotated[EffectivePlatformFeature, Field(alias='ACTORS_PUBLIC_DEVELOPER')]


@docs_group('Models')
class EncodeAndSignData(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    encoded: Annotated[str, Field(examples=['eyJwYXlsb2FkIjoiLi4uIiwic2lnbmF0dXJlIjoiLi4uIn0='])]


@docs_group('Models')
class DecodeAndVerifyRequest(EncodeAndSignData):
    pass


@docs_group('Models')
class EncodeAndSignResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: EncodeAndSignData


@docs_group('Models')
class EnvVar(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str, Field(examples=['MY_ENV_VAR'])]
    """
    The name of the environment variable.
    """
    value: Annotated[str | None, Field(examples=['my-value'])] = None
    """
    The value of the environment variable. If `isSecret` is `true`, this value isn't returned by the API.
    """
    is_secret: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the environment variable is encrypted. Secret values aren't returned by the API.
    """


@docs_group('Models')
class EnvVarRequest(EnvVar):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    value: Annotated[str, Field(examples=['my-value'])]
    """
    The value of the environment variable. If `isSecret` is `true`, this value isn't returned by the API.
    """


@docs_group('Models')
class EnvVarResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: EnvVar


@docs_group('Models')
class ErrorDetail(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    type: ErrorType | None = None
    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,
        alias_generator=to_camel,
    )
    error: ErrorDetail


@docs_group('Models')
class EventData(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_id: Annotated[str, Field(examples=['vvE7iMKuMc5qTHHsR'])]
    actor_run_id: Annotated[str | None, Field(examples=['JgwXN9BdwxGcu9MMF'])] = None
    actor_build_id: Annotated[str | None, Field(examples=['HG7ML7M8z78YcAPEB'])] = None
    actor_task_id: Annotated[str | None, Field(examples=['zRLp8SDOZz2NyLg7K'])] = None


@docs_group('Models')
class ExampleRunInput(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    body: Annotated[str | None, Field(examples=['{ "helloWorld": 123 }'])] = None
    """
    Sample input, serialized as a string.
    """
    content_type: Annotated[str | None, Field(examples=['application/json; charset=utf-8'])] = None
    """
    MIME type of `body`.
    """


@docs_group('Models')
class ExampleWebhookDispatch(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    status: WebhookDispatchStatus
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-13T08:36:13.202Z'])] = None
    removed_at: Annotated[AwareDatetime | None, Field(examples=[None])] = None


@docs_group('Models')
class FlatPricePerMonthActorPricingInfo(CommonActorPricingInfo):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    pricing_model: Literal['FLAT_PRICE_PER_MONTH']
    trial_minutes: int
    """
    For how long this Actor can be used for free in trial period
    """
    price_per_unit_usd: float
    """
    Monthly flat price in USD
    """


@docs_group('Models')
class FreeActorPricingInfo(CommonActorPricingInfo):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    pricing_model: Literal['FREE']


@docs_group('Models')
class HeadAndLockResponse(BaseModel):
    """Response containing locked requests from the request queue head."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: LockedRequestQueueHead


@docs_group('Models')
class HeadRequest(BaseModel):
    """A request from the request queue head without lock information."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    url: Annotated[str, Field(examples=['https://apify.com'])]
    """
    The URL of the request.
    """
    method: HttpMethod | None = None
    retry_count: Annotated[int | None, Field(examples=[0])] = None
    """
    The number of times this request has been retried.
    """


@docs_group('Models')
class HeadResponse(BaseModel):
    """Response containing requests from the request queue head without locking."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: RequestQueueHead


@docs_group('Models')
class InvalidItem(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    item_position: Annotated[int | None, Field(examples=[2])] = None
    """
    The position of the invalid item in the array.
    """
    validation_errors: list[ValidationError] | None = None
    """
    A complete list of AJV validation error objects for the invalid item.
    """


@docs_group('Models')
class KeyValueStore(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
    name: Annotated[str | None, Field(examples=['d7b9MDYsbtX5L7XAj'])] = None
    user_id: Annotated[str | None, Field(examples=['BPWDBd7Z9c746JAnF'])] = None
    username: Annotated[str | None, Field(examples=['janedoe'])] = None
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
    act_id: Annotated[str | None, Field(examples=[None])] = None
    act_run_id: Annotated[str | None, Field(examples=[None])] = None
    console_url: Annotated[
        AnyUrl | None, Field(examples=['https://console.apify.com/storage/key-value-stores/27TmTznX9YPeAYhkC'])
    ] = None
    keys_public_url: Annotated[
        AnyUrl | None,
        Field(examples=['https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/keys?signature=abc123']),
    ] = None
    """
    A public link to access keys of the key-value store directly.
    """
    records_public_url: Annotated[
        AnyUrl | None, Field(examples=['https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records'])
    ] = None
    """
    A public link to access records of the key-value store directly.
    """
    schema_: Annotated[dict[str, Any] | None, Field(alias='schema')] = None
    """
    Optional JSON schema describing the keys stored in the key-value store.
    """
    url_signing_secret_key: str | None = None
    """
    A secret key for generating signed public URLs. It is only provided to clients with WRITE permission for the key-value store.
    """
    general_access: GeneralAccess | None = None
    stats: KeyValueStoreStats | None = None


@docs_group('Models')
class KeyValueStoreKey(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    key: Annotated[str, Field(examples=['second-key'])]
    size: Annotated[int, Field(examples=[36])]
    record_public_url: Annotated[
        AnyUrl,
        Field(
            examples=['https://api.apify.com/v2/key-value-stores/WkzbQMuFYuamGv3YF/records/some-key?signature=abc123']
        ),
    ]
    """
    A public link to access this record directly.
    """


@docs_group('Models')
class KeyValueStoreResponse(BaseModel):
    """Response containing key-value store data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: KeyValueStore


@docs_group('Models')
class KeyValueStoreStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    read_count: Annotated[int | None, Field(examples=[9])] = None
    write_count: Annotated[int | None, Field(examples=[3])] = None
    delete_count: Annotated[int | None, Field(examples=[6])] = None
    list_count: Annotated[int | None, Field(examples=[2])] = None
    s3_storage_bytes: Annotated[int | None, Field(examples=[18])] = None
    storage_bytes: Annotated[int | None, Field(examples=[457225])] = None


@docs_group('Models')
class KeyValueStores(BaseModel):
    """Aliased key-value store IDs for this run."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    __annotations__ = {
        '__pydantic_extra__': dict[str, str],
    }
    default: Annotated[str | None, Field(examples=['eJNzqsbPiopwJcgGQ'])] = None
    """
    ID of the default key-value store for this run.
    """


@docs_group('Models')
class Limits(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    max_monthly_usage_usd: Annotated[float, Field(examples=[300])]
    max_monthly_actor_compute_units: Annotated[float, Field(examples=[1000])]
    max_monthly_external_data_transfer_gbytes: Annotated[float, Field(examples=[7])]
    max_monthly_proxy_serps: Annotated[int, Field(examples=[50])]
    max_monthly_residential_proxy_gbytes: Annotated[float, Field(examples=[0.5])]
    max_actor_memory_gbytes: Annotated[float, Field(examples=[16])]
    max_actor_count: Annotated[int, Field(examples=[100])]
    max_actor_task_count: Annotated[int, Field(examples=[1000])]
    max_concurrent_actor_jobs: Annotated[int, Field(examples=[256])]
    max_team_account_seat_count: Annotated[int, Field(examples=[9])]
    data_retention_days: Annotated[int, Field(examples=[90])]
    max_schedule_count: Annotated[int | None, Field(examples=[100])] = None


@docs_group('Models')
class LimitsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: AccountLimits


@docs_group('Models')
class ListOfActorsInStoreResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfStoreActors


@docs_group('Models')
class ListOfActorsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfActors


@docs_group('Models')
class ListOfBuildsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfBuilds


@docs_group('Models')
class ListOfDatasetsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfDatasets


@docs_group('Models')
class ListOfEnvVars(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    total: Annotated[int, Field(examples=[5])]
    items: list[EnvVar]


@docs_group('Models')
class ListOfEnvVarsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfEnvVars


@docs_group('Models')
class ListOfKeyValueStoresResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfKeyValueStores


@docs_group('Models')
class ListOfKeys(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[KeyValueStoreKey]
    count: Annotated[int, Field(examples=[2])]
    limit: Annotated[int, Field(examples=[2])]
    exclusive_start_key: Annotated[str | None, Field(examples=['some-key'])] = None
    is_truncated: Annotated[bool, Field(examples=[True])]
    next_exclusive_start_key: Annotated[str | None, Field(examples=['third-key'])] = None


@docs_group('Models')
class ListOfKeysResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfKeys


@docs_group('Models')
class ListOfRequestQueuesResponse(BaseModel):
    """Response containing a list of request queues."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfRequestQueues


@docs_group('Models')
class ListOfRequests(BaseModel):
    """A paginated list of requests from the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[Request]
    """
    The array of requests.
    """
    limit: Annotated[int, Field(examples=[2])]
    """
    The maximum number of requests returned in this response.
    """
    exclusive_start_id: Annotated[str | None, Field(deprecated=True, examples=['Ihnsp8YrvJ8102Kj'])] = None
    """
    The ID of the last request from the previous page, used for pagination.
    """
    cursor: Annotated[str | None, Field(examples=['eyJyZXF1ZXN0SWQiOiI0SVlLUWFXZ2FKUUlWNlMifQ'])] = None
    """
    A cursor string used for current page of results.
    """
    next_cursor: Annotated[str | None, Field(examples=['eyJyZXF1ZXN0SWQiOiI5eFNNc1BrN1J6VUxTNXoifQ'])] = None
    """
    A cursor string to be used to continue pagination.
    """


@docs_group('Models')
class ListOfRequestsResponse(BaseModel):
    """Response containing a list of requests from the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfRequests


@docs_group('Models')
class ListOfRunsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfRuns


@docs_group('Models')
class ListOfSchedulesResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfSchedules


@docs_group('Models')
class ListOfTasksResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfTasks


@docs_group('Models')
class ListOfVersions(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    total: Annotated[int, Field(examples=[5])]
    items: list[Version]


@docs_group('Models')
class ListOfVersionsResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfVersions


@docs_group('Models')
class ListOfWebhookDispatchesResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfWebhookDispatches


@docs_group('Models')
class ListOfWebhooksResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: ListOfWebhooks


@docs_group('Models')
class LockedHeadRequest(BaseModel):
    """A request from the request queue head that has been locked for processing."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    url: Annotated[str, Field(examples=['https://apify.com'])]
    """
    The URL of the request.
    """
    method: HttpMethod | None = None
    retry_count: Annotated[int | None, Field(examples=[0])] = None
    """
    The number of times this request has been retried.
    """
    lock_expires_at: Annotated[AwareDatetime, Field(examples=['2022-06-14T23:00:00.000Z'])]
    """
    The timestamp when the lock on this request expires.
    """


@docs_group('Models')
class LockedRequestQueueHead(BaseModel):
    """A batch of locked requests from the request queue head."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    limit: Annotated[int, Field(examples=[1000])]
    """
    The maximum number of requests returned.
    """
    queue_modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    """
    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.
    """
    queue_has_locked_requests: Annotated[bool | None, Field(examples=[True])] = None
    """
    Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one).
    """
    client_key: Annotated[str | None, Field(examples=['client-one'])] = None
    """
    The client key used for locking the requests.
    """
    had_multiple_clients: Annotated[bool, Field(examples=[True])]
    """
    Whether the request queue has been accessed by multiple different clients.
    """
    lock_secs: Annotated[int, Field(examples=[60])]
    """
    The number of seconds the locks will be held.
    """
    items: list[LockedHeadRequest]
    """
    The array of locked requests from the request queue head.
    """


@docs_group('Models')
class Metamorph(BaseModel):
    """Information about a metamorph event that occurred during the run."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    created_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:39:24.202Z'])]
    """
    Time when the metamorph occurred.
    """
    actor_id: Annotated[str, Field(examples=['nspoEjklmnsF2oosD'])]
    """
    ID of the Actor that the run was metamorphed to.
    """
    build_id: Annotated[str, Field(examples=['ME6oKecqy5kXDS4KQ'])]
    """
    ID of the build used for the metamorphed Actor.
    """
    input_key: Annotated[str | None, Field(examples=['INPUT-METAMORPH-1'])] = None
    """
    Key of the input record in the key-value store.
    """


@docs_group('Models')
class MonthlyUsage(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    usage_cycle: UsageCycle
    monthly_service_usage: dict[str, UsageItem]
    daily_service_usages: list[DailyServiceUsages]
    total_usage_credits_usd_before_volume_discount: Annotated[float, Field(examples=[0.786143673840067])]
    total_usage_credits_usd_after_volume_discount: Annotated[float, Field(examples=[0.786143673840067])]


@docs_group('Models')
class MonthlyUsageResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: MonthlyUsage


@docs_group('Models')
class Notifications(BaseModel):
    """Notification settings for this schedule."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    email: Annotated[bool | None, Field(examples=[True])] = None


@docs_group('Models')
class PaginationResponse(BaseModel):
    """Common pagination fields for list responses."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    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 ListOfActors(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[ActorShort]


@docs_group('Models')
class ListOfBuilds(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[BuildShort]


@docs_group('Models')
class ListOfDatasets(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unnamed: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the listing was filtered to only unnamed datasets.
    """
    items: list[DatasetListItem]


@docs_group('Models')
class ListOfKeyValueStores(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unnamed: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the listing was filtered to only unnamed key-value stores.
    """
    items: list[KeyValueStore]


@docs_group('Models')
class ListOfRequestQueues(PaginationResponse):
    """A paginated list of request queues."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unnamed: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the listing was filtered to only unnamed request queues.
    """
    items: list[RequestQueueShort]
    """
    The array of request queues.
    """


@docs_group('Models')
class ListOfRuns(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[RunShort]


@docs_group('Models')
class ListOfSchedules(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[ScheduleShort]


@docs_group('Models')
class ListOfStoreActors(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[StoreListActor]


@docs_group('Models')
class ListOfTasks(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[TaskShort]


@docs_group('Models')
class ListOfWebhookDispatches(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[WebhookDispatch]


@docs_group('Models')
class ListOfWebhooks(PaginationResponse):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    items: list[WebhookShort]


@docs_group('Models')
class PayPerEventActorPricingInfo(CommonActorPricingInfo):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    pricing_model: Literal['PAY_PER_EVENT']
    pricing_per_event: PricingPerEvent
    minimal_max_total_charge_usd: float | None = None


@docs_group('Models')
class Plan(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str | None, Field(examples=['Personal'])] = None
    description: Annotated[
        str | None, Field(examples=['Cost-effective plan for freelancers, developers and students.'])
    ] = None
    is_enabled: Annotated[bool | None, Field(examples=[True])] = None
    monthly_base_price_usd: Annotated[float | None, Field(examples=[49])] = None
    monthly_usage_credits_usd: Annotated[float | None, Field(examples=[49])] = None
    usage_discount_percent: Annotated[float | None, Field(examples=[0])] = None
    enabled_platform_features: Annotated[
        list[str] | None, Field(examples=[['ACTORS', 'STORAGE', 'PROXY_SERPS', 'SCHEDULER', 'WEBHOOKS']])
    ] = None
    max_monthly_usage_usd: Annotated[float | None, Field(examples=[9999])] = None
    max_actor_memory_gbytes: Annotated[float | None, Field(examples=[32])] = None
    max_monthly_actor_compute_units: Annotated[float | None, Field(examples=[1000])] = None
    max_monthly_residential_proxy_gbytes: Annotated[float | None, Field(examples=[10])] = None
    max_monthly_proxy_serps: Annotated[int | None, Field(examples=[30000])] = None
    max_monthly_external_data_transfer_gbytes: Annotated[float | None, Field(examples=[1000])] = None
    max_actor_count: Annotated[int | None, Field(examples=[100])] = None
    max_actor_task_count: Annotated[int | None, Field(examples=[1000])] = None
    data_retention_days: Annotated[int | None, Field(examples=[14])] = None
    available_proxy_groups: dict[str, int]
    team_account_seat_count: Annotated[int | None, Field(examples=[1])] = None
    support_level: Annotated[str | None, Field(examples=['COMMUNITY'])] = None
    available_add_ons: Annotated[list[str] | None, Field(examples=[[]])] = None
    tier: Annotated[str | None, Field(examples=['FREE'])] = None
    api_rate_limit_boosts: Annotated[int | None, Field(examples=[0])] = None
    max_schedule_count: Annotated[int | None, Field(examples=[100])] = None
    max_concurrent_actor_runs: Annotated[int | None, Field(examples=[25])] = None
    plan_pricing: dict[str, Any] | None = None
    """
    Pricing details for this plan.
    """


@docs_group('Models')
class PricePerDatasetItemActorPricingInfo(CommonActorPricingInfo):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    pricing_model: Literal['PRICE_PER_DATASET_ITEM']
    unit_name: str
    """
    Name of the unit that is being charged
    """
    price_per_unit_usd: float | None = None
    """
    Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present
    on a pricing record.

    """
    tiered_pricing: dict[str, TieredPricingPerDatasetItemEntry] | None = None


@docs_group('Models')
class PriceTiers(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    quantity_above: Annotated[float, Field(examples=[0])]
    discount_percent: Annotated[float, Field(examples=[100])]
    tier_quantity: Annotated[float, Field(examples=[0.39])]
    unit_price_usd: Annotated[float, Field(examples=[0])]
    price_usd: Annotated[float, Field(examples=[0])]


@docs_group('Models')
class PricingPerEvent(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_charge_events: dict[str, ActorChargeEvent] | None = None


@docs_group('Models')
class PrivateUserDataResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: UserPrivateInfo


@docs_group('Models')
class Profile(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    bio: Annotated[str | None, Field(examples=['I started web scraping in 1985 using Altair BASIC.'])] = None
    name: Annotated[str | None, Field(examples=['Jane Doe'])] = None
    picture_url: Annotated[AnyUrl | None, Field(examples=['https://apify.com/img/anonymous_user_picture.png'])] = None
    github_username: Annotated[str | None, Field(examples=['torvalds.'])] = None
    website_url: Annotated[AnyUrl | None, Field(examples=['http://www.example.com'])] = None
    twitter_username: Annotated[str | None, Field(examples=['@BillGates'])] = None


@docs_group('Models')
class ProlongRequestLockResponse(BaseModel):
    """Response containing updated lock information after prolonging a request lock."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: RequestLockInfo


@docs_group('Models')
class Proxy(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    password: Annotated[str, Field(examples=['ad78knd9Jkjd86'])]
    groups: list[ProxyGroup]


@docs_group('Models')
class ProxyGroup(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str, Field(examples=['Group1'])]
    description: Annotated[str | None, Field(examples=['Group1 description'])]
    available_count: Annotated[int, Field(examples=[10])]


@docs_group('Models')
class PublicActorRunStats30Days(BaseModel):
    """Run status counts from the last 30 days. Only for public Actors.
    Excludes runs started by the Actor's owner.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    aborted: Annotated[int | None, Field(alias='ABORTED', examples=[2542])] = None
    """
    The number of runs that were aborted.
    """
    failed: Annotated[int | None, Field(alias='FAILED', examples=[1234])] = None
    """
    The number of runs that failed.
    """
    succeeded: Annotated[int | None, Field(alias='SUCCEEDED', examples=[732805])] = None
    """
    The number of runs that succeeded.
    """
    timed_out: Annotated[int | None, Field(alias='TIMED-OUT', examples=[12556])] = None
    """
    The number of runs that timed out.
    """
    total: Annotated[int | None, Field(alias='TOTAL', examples=[749137])] = None
    """
    The total number of runs.
    """


@docs_group('Models')
class PublicUserDataResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: UserPublicInfo


@docs_group('Models')
class PutItemResponseError(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    error: DatasetSchemaValidationError


@docs_group('Models')
class PutItemsRequest(BaseModel):
    """The request body containing the item(s) to add to the dataset. Can be a single
    object or an array of objects. Each object represents one dataset item.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class PutRecordRequest(BaseModel):
    """The request body contains the value to store in the record. The content type
    should be specified in the Content-Type header.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class RecordResponse(BaseModel):
    """The response body contains the value of the record. The content type of the response
    is determined by the Content-Type header stored with the record.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class RequestBase(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    url: Annotated[str, Field(examples=['https://apify.com'])]
    """
    The URL of the request.
    """
    method: HttpMethod | None = None
    retry_count: Annotated[int | None, Field(examples=[0])] = None
    """
    The number of times this request has been retried.
    """
    loaded_url: Annotated[str | None, Field(examples=['https://apify.com/jobs'])] = None
    """
    The final URL that was loaded, after redirects (if any).
    """
    payload: Annotated[str | dict[str, Any] | None, Field(examples=[None])] = None
    """
    The request payload, typically used with POST or PUT requests.
    """
    headers: Annotated[dict[str, Any] | None, Field(examples=[None])] = None
    """
    HTTP headers sent with the request.
    """
    user_data: RequestUserData | None = None
    no_retry: Annotated[bool | None, Field(examples=[False])] = None
    """
    Indicates whether the request should not be retried if processing fails.
    """
    error_messages: Annotated[list[str] | None, Field(examples=[None])] = None
    """
    Error messages recorded from failed processing attempts.
    """
    handled_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-16T10:23:31.607Z'])] = None
    """
    The timestamp when the request was marked as handled, if applicable.
    """


@docs_group('Models')
class Request(RequestBase):
    """A request stored in the request queue, including its metadata and processing state."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
    """
    A unique identifier assigned to the request.
    """


@docs_group('Models')
class RequestDraft(BaseModel):
    """A request that failed to be processed during a request queue operation and can be retried."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """
    url: Annotated[str, Field(examples=['https://apify.com'])]
    """
    The URL of the request.
    """
    method: HttpMethod | None = None


@docs_group('Models')
class RequestDraftDeleteById(BaseModel):
    """A request that should be deleted, identified by its ID."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str | None, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])] = None
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """


@docs_group('Models')
class RequestDraftDeleteByUniqueKey(BaseModel):
    """A request that should be deleted, identified by its unique key."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str | None, Field(examples=['sbJ7klsdf7ujN9l'])] = None
    """
    A unique identifier assigned to the request.
    """
    unique_key: Annotated[str, Field(examples=['GET|60d83e70|e3b0c442|https://apify.com'])]
    """
    A unique key used for request de-duplication. Requests with the same unique key are considered identical.
    """


@docs_group('Models')
class RequestDraftDelete(RootModel[RequestDraftDeleteById | RequestDraftDeleteByUniqueKey]):
    root: Annotated[RequestDraftDeleteById | RequestDraftDeleteByUniqueKey, Field(title='RequestDraftDelete')]
    """
    A request that should be deleted.
    """


@docs_group('Models')
class RequestLockInfo(BaseModel):
    """Information about a request lock."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    lock_expires_at: Annotated[AwareDatetime, Field(examples=['2022-06-14T23:00:00.000Z'])]
    """
    The timestamp when the lock on this request expires.
    """


@docs_group('Models')
class RequestQueue(BaseModel):
    """A request queue object containing metadata and statistics."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
    """
    A unique identifier assigned to the request queue.
    """
    name: Annotated[str | None, Field(examples=['some-name'])] = None
    """
    The name of the request queue.
    """
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    """
    The ID of the user who owns the request queue.
    """
    act_id: str | None = None
    """
    The ID of the Actor that created this request queue.
    """
    act_run_id: str | None = None
    """
    The ID of the Actor run that created this request queue.
    """
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    """
    The timestamp when the request queue was created.
    """
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    """
    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.
    """
    accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
    """
    The timestamp when the request queue was last accessed.
    """
    total_request_count: Annotated[int, Field(examples=[870], ge=0)]
    """
    The total number of requests in the request queue.
    """
    handled_request_count: Annotated[int, Field(examples=[100], ge=0)]
    """
    The number of requests that have been handled.
    """
    pending_request_count: Annotated[int, Field(examples=[670])]
    """
    The number of requests that are pending and have not been handled yet.
    """
    had_multiple_clients: Annotated[bool, Field(examples=[True])]
    """
    Whether the request queue has been accessed by multiple different clients.
    """
    console_url: Annotated[AnyUrl, Field(examples=['https://api.apify.com/v2/request-queues/27TmTznX9YPeAYhkC'])]
    """
    The URL to view the request queue in the Apify console.
    """
    stats: RequestQueueStats | None = None
    general_access: GeneralAccess | None = None


@docs_group('Models')
class RequestQueueHead(BaseModel):
    """A batch of requests from the request queue head without locking."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    limit: Annotated[int, Field(examples=[1000])]
    """
    The maximum number of requests returned.
    """
    queue_modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    """
    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.
    """
    had_multiple_clients: Annotated[bool, Field(examples=[True])]
    """
    Whether the request queue has been accessed by multiple different clients.
    """
    items: list[HeadRequest]
    """
    The array of requests from the request queue head.
    """


@docs_group('Models')
class RequestQueueResponse(BaseModel):
    """Response containing request queue data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: RequestQueue


@docs_group('Models')
class RequestQueueShort(BaseModel):
    """A shortened request queue object for list responses."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['WkzbQMuFYuamGv3YF'])]
    """
    A unique identifier assigned to the request queue.
    """
    name: Annotated[str, Field(examples=['some-name'])]
    """
    The name of the request queue.
    """
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    """
    The ID of the user who owns the request queue.
    """
    username: Annotated[str, Field(examples=['janedoe'])]
    """
    The username of the user who owns the request queue.
    """
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    """
    The timestamp when the request queue was created.
    """
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    """
    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.
    """
    accessed_at: Annotated[AwareDatetime, Field(examples=['2019-12-14T08:36:13.202Z'])]
    """
    The timestamp when the request queue was last accessed.
    """
    expire_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-02T17:15:06.751Z'])] = None
    """
    The timestamp when the request queue will expire and be deleted.
    """
    total_request_count: Annotated[int, Field(examples=[870], ge=0)]
    """
    The total number of requests in the request queue.
    """
    handled_request_count: Annotated[int, Field(examples=[100], ge=0)]
    """
    The number of requests that have been handled.
    """
    pending_request_count: Annotated[int, Field(examples=[670])]
    """
    The number of requests that are pending and have not been handled yet.
    """
    act_id: str | None = None
    """
    The ID of the Actor that created this request queue.
    """
    act_run_id: str | None = None
    """
    The ID of the Actor run that created this request queue.
    """
    had_multiple_clients: Annotated[bool, Field(examples=[True])]
    """
    Whether the request queue has been accessed by multiple different clients.
    """
    general_access: GeneralAccess | None = None
    stats: RequestQueueStats | None = None


@docs_group('Models')
class RequestQueueStats(BaseModel):
    """Statistics about request queue operations and storage."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    delete_count: Annotated[int | None, Field(examples=[0])] = None
    """
    The number of delete operations performed on the request queue.
    """
    head_item_read_count: Annotated[int | None, Field(examples=[5])] = None
    """
    The number of times requests from the head were read.
    """
    read_count: Annotated[int | None, Field(examples=[100])] = None
    """
    The total number of read operations performed on the request queue.
    """
    storage_bytes: Annotated[int | None, Field(examples=[1024])] = None
    """
    The total storage size in bytes used by the request queue.
    """
    write_count: Annotated[int | None, Field(examples=[10])] = None
    """
    The total number of write operations performed on the request queue.
    """


@docs_group('Models')
class RequestQueues(BaseModel):
    """Aliased request queue IDs for this run."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    __annotations__ = {
        '__pydantic_extra__': dict[str, str],
    }
    default: Annotated[str | None, Field(examples=['FL35cSF7jrxr3BY39'])] = None
    """
    ID of the default request queue for this run.
    """


@docs_group('Models')
class RequestRegistration(BaseModel):
    """Result of registering a request in the request queue, either by adding a new request or updating an existing one."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    request_id: Annotated[str, Field(examples=['sbJ7klsdf7ujN9l'])]
    """
    A unique identifier assigned to the request.
    """
    was_already_present: Annotated[bool, Field(examples=[False])]
    """
    Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created.
    """
    was_already_handled: Annotated[bool, Field(examples=[False])]
    """
    Indicates whether a request with the same unique key has already been processed by the request queue.
    """


@docs_group('Models')
class RequestResponse(BaseModel):
    """Response containing a single request from the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Request


@docs_group('Models')
class RequestUserData(BaseModel):
    """Custom user data attached to the request. Can contain arbitrary fields."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class RequestWithoutId(RequestBase):
    """A request stored in the request queue, including its metadata and processing state, without the assigned ID."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class Run(BaseModel):
    """Represents an Actor run and its associated data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
    """
    Unique identifier of the Actor run.
    """
    act_id: Annotated[str, Field(examples=['HDSasDasz78YcAPEB'])]
    """
    ID of the Actor that was run.
    """
    user_id: Annotated[str, Field(examples=['7sT5jcggjjA9fNcxF'])]
    """
    ID of the user who started the run.
    """
    actor_task_id: Annotated[str | None, Field(examples=['KJHSKHausidyaJKHs'])] = None
    """
    ID of the Actor task, if the run was started from a task.
    """
    started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
    """
    Time when the Actor run started.
    """
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
    """
    Time when the Actor run finished.
    """
    status: ActorJobStatus
    """
    Current status of the Actor run.
    """
    status_message: Annotated[str | None, Field(examples=['Actor is running'])] = None
    """
    Detailed message about the run status.
    """
    is_status_message_terminal: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the status message is terminal (final).
    """
    meta: RunMeta
    """
    Metadata about the Actor run.
    """
    pricing_info: Annotated[
        PayPerEventActorPricingInfo
        | PricePerDatasetItemActorPricingInfo
        | FlatPricePerMonthActorPricingInfo
        | FreeActorPricingInfo
        | None,
        Field(discriminator='pricing_model', title='ActorRunPricingInfo'),
    ] = None
    """
    Pricing information for the Actor.
    """
    stats: RunStats
    """
    Statistics of the Actor run.
    """
    charged_event_counts: Annotated[
        dict[str, int] | None, Field(examples=[{'actor-start': 1, 'page-crawled': 150, 'data-extracted': 75}])
    ] = None
    """
    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.
    """
    options: RunOptions
    """
    Configuration options for the Actor run.
    """
    build_id: Annotated[str, Field(examples=['7sT5jcggjjA9fNcxF'])]
    """
    ID of the Actor build used for this run.
    """
    exit_code: Annotated[int | None, Field(examples=[0])] = None
    """
    Exit code of the Actor run process.
    """
    general_access: GeneralAccess | None = None
    """
    General access level for the Actor run.
    """
    default_key_value_store_id: Annotated[str, Field(examples=['eJNzqsbPiopwJcgGQ'])]
    """
    ID of the default key-value store for this run.
    """
    default_dataset_id: Annotated[str, Field(examples=['wmKPijuyDnPZAPRMk'])]
    """
    ID of the default dataset for this run.
    """
    default_request_queue_id: Annotated[str, Field(examples=['FL35cSF7jrxr3BY39'])]
    """
    ID of the default request queue for this run.
    """
    storage_ids: StorageIds | None = None
    """
    A map of aliased storage IDs associated with this run, grouped by storage type.
    """
    build_number: Annotated[
        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})$')
    ] = None
    """
    Build number of the Actor build used for this run.
    """
    container_url: Annotated[AnyUrl | None, Field(examples=['https://g8kd8kbc5ge8.runs.apify.net'])] = None
    """
    URL of the container running the Actor.
    """
    is_container_server_ready: Annotated[bool | None, Field(examples=[True])] = None
    """
    Whether the container's HTTP server is ready to accept requests.
    """
    git_branch_name: Annotated[str | None, Field(examples=['master'])] = None
    """
    Name of the git branch used for the Actor build.
    """
    usage: RunUsage | None = None
    """
    Resource usage statistics for the run.
    """
    usage_total_usd: Annotated[float | None, Field(examples=[0.2654])] = None
    """
    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.
    """
    usage_usd: RunUsageUsd | None = None
    """
    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.
    """
    metamorphs: list[Metamorph] | None = None
    """
    List of metamorph events that occurred during the run.
    """
    platform_usage_billing_model: Annotated[str | None, Field(examples=['USER'])] = None
    """
    Indicates which party covers platform usage costs for this run.
    """


@docs_group('Models')
class RunMeta(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    origin: RunOrigin
    client_ip: str | None = None
    """
    IP address of the client that started the run.
    """
    user_agent: str | None = None
    """
    User agent of the client that started the run.
    """
    schedule_id: str | None = None
    """
    ID of the schedule that triggered the run.
    """
    scheduled_at: AwareDatetime | None = None
    """
    Time when the run was scheduled.
    """


@docs_group('Models')
class RunOptions(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    build: Annotated[str, Field(examples=['latest'])]
    timeout_secs: Annotated[int, Field(examples=[300], ge=0)]
    memory_mbytes: Annotated[int, Field(examples=[1024], ge=128, le=32768)]
    disk_mbytes: Annotated[int, Field(examples=[2048], ge=0)]
    max_items: Annotated[int | None, Field(examples=[1000], ge=0)] = None
    max_total_charge_usd: Annotated[float | None, Field(examples=[5], ge=0.0)] = None


@docs_group('Models')
class RunResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Run


@docs_group('Models')
class RunShort(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
    act_id: Annotated[str, Field(examples=['HDSasDasz78YcAPEB'])]
    user_id: Annotated[str | None, Field(examples=['7sT5jcggjjA9fNcxF'])] = None
    actor_task_id: Annotated[str | None, Field(examples=['KJHSKHausidyaJKHs'])] = None
    status: ActorJobStatus
    started_at: Annotated[AwareDatetime, Field(examples=['2019-11-30T07:34:24.202Z'])]
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-12-12T09:30:12.202Z'])] = None
    build_id: Annotated[str, Field(examples=['HG7ML7M8z78YcAPEB'])]
    build_number: Annotated[
        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})$')
    ] = None
    build_number_int: Annotated[int | None, Field(examples=[10000])] = None
    meta: RunMeta
    usage_total_usd: Annotated[float, Field(examples=[0.2])]
    default_key_value_store_id: Annotated[str, Field(examples=['sfAjeR4QmeJCQzTfe'])]
    default_dataset_id: Annotated[str, Field(examples=['3ZojQDdFTsyE7Moy4'])]
    default_request_queue_id: Annotated[str, Field(examples=['so93g2shcDzK3pA85'])]


@docs_group('Models')
class RunStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    input_body_len: Annotated[int | None, Field(examples=[240], ge=0)] = None
    migration_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
    reboot_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
    restart_count: Annotated[int | None, Field(examples=[0], ge=0)] = None
    resurrect_count: Annotated[int | None, Field(examples=[2], ge=0)] = None
    mem_avg_bytes: Annotated[float | None, Field(examples=[267874071.9])] = None
    mem_max_bytes: Annotated[int | None, Field(examples=[404713472], ge=0)] = None
    mem_current_bytes: Annotated[int | None, Field(examples=[0], ge=0)] = None
    cpu_avg_usage: Annotated[float | None, Field(examples=[33.7532101107538])] = None
    cpu_max_usage: Annotated[float | None, Field(examples=[169.650735534941])] = None
    cpu_current_usage: Annotated[float | None, Field(examples=[0])] = None
    net_rx_bytes: Annotated[int | None, Field(examples=[103508042], ge=0)] = None
    net_tx_bytes: Annotated[int | None, Field(examples=[4854600], ge=0)] = None
    duration_millis: Annotated[int | None, Field(examples=[248472], ge=0)] = None
    run_time_secs: Annotated[float | None, Field(examples=[248.472], ge=0.0)] = None
    metamorph: Annotated[int | None, Field(examples=[0], ge=0)] = None
    compute_units: Annotated[float | None, Field(examples=[0.13804], ge=0.0)] = None


@docs_group('Models')
class RunUsage(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[3])] = None
    dataset_reads: Annotated[int | None, Field(alias='DATASET_READS', examples=[4])] = None
    dataset_writes: Annotated[int | None, Field(alias='DATASET_WRITES', examples=[4])] = None
    key_value_store_reads: Annotated[int | None, Field(alias='KEY_VALUE_STORE_READS', examples=[5])] = None
    key_value_store_writes: Annotated[int | None, Field(alias='KEY_VALUE_STORE_WRITES', examples=[3])] = None
    key_value_store_lists: Annotated[int | None, Field(alias='KEY_VALUE_STORE_LISTS', examples=[5])] = None
    request_queue_reads: Annotated[int | None, Field(alias='REQUEST_QUEUE_READS', examples=[2])] = None
    request_queue_writes: Annotated[int | None, Field(alias='REQUEST_QUEUE_WRITES', examples=[1])] = None
    data_transfer_internal_gbytes: Annotated[
        float | None, Field(alias='DATA_TRANSFER_INTERNAL_GBYTES', examples=[1])
    ] = None
    data_transfer_external_gbytes: Annotated[
        float | None, Field(alias='DATA_TRANSFER_EXTERNAL_GBYTES', examples=[3])
    ] = None
    proxy_residential_transfer_gbytes: Annotated[
        float | None, Field(alias='PROXY_RESIDENTIAL_TRANSFER_GBYTES', examples=[34])
    ] = None
    proxy_serps: Annotated[int | None, Field(alias='PROXY_SERPS', examples=[3])] = None


@docs_group('Models')
class RunUsageUsd(BaseModel):
    """Resource usage costs in USD. All values are monetary amounts in US dollars."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_compute_units: Annotated[float | None, Field(alias='ACTOR_COMPUTE_UNITS', examples=[0.0003])] = None
    dataset_reads: Annotated[float | None, Field(alias='DATASET_READS', examples=[0.0001])] = None
    dataset_writes: Annotated[float | None, Field(alias='DATASET_WRITES', examples=[0.0001])] = None
    key_value_store_reads: Annotated[float | None, Field(alias='KEY_VALUE_STORE_READS', examples=[0.0001])] = None
    key_value_store_writes: Annotated[float | None, Field(alias='KEY_VALUE_STORE_WRITES', examples=[5e-05])] = None
    key_value_store_lists: Annotated[float | None, Field(alias='KEY_VALUE_STORE_LISTS', examples=[0.0001])] = None
    request_queue_reads: Annotated[float | None, Field(alias='REQUEST_QUEUE_READS', examples=[0.0001])] = None
    request_queue_writes: Annotated[float | None, Field(alias='REQUEST_QUEUE_WRITES', examples=[0.0001])] = None
    data_transfer_internal_gbytes: Annotated[
        float | None, Field(alias='DATA_TRANSFER_INTERNAL_GBYTES', examples=[0.001])
    ] = None
    data_transfer_external_gbytes: Annotated[
        float | None, Field(alias='DATA_TRANSFER_EXTERNAL_GBYTES', examples=[0.003])
    ] = None
    proxy_residential_transfer_gbytes: Annotated[
        float | None, Field(alias='PROXY_RESIDENTIAL_TRANSFER_GBYTES', examples=[0.034])
    ] = None
    proxy_serps: Annotated[float | None, Field(alias='PROXY_SERPS', examples=[0.003])] = None


@docs_group('Models')
class ScheduleActionRunActor(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['c6KfSgoQzFhMk3etc'])]
    type: Literal['RUN_ACTOR']
    actor_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
    run_input: ScheduleActionRunInput | None = None
    run_options: TaskOptions | None = None


@docs_group('Models')
class ScheduleActionRunActorTask(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['c6KfSgoQzFhMk3etc'])]
    type: Literal['RUN_ACTOR_TASK']
    actor_task_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
    input: dict[str, Any] | None = None


@docs_group('Models')
class ScheduleActionRunInput(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    body: Annotated[str | None, Field(examples=['{\\n   "foo": "actor"\\n}'])] = None
    content_type: Annotated[str | None, Field(examples=['application/json; charset=utf-8'])] = None


@docs_group('Models')
class ScheduleActionShortRunActor(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['ZReCs7hkdieq8ZUki'])]
    type: Literal['RUN_ACTOR']
    actor_id: Annotated[str, Field(examples=['HKhKmiCMrDgu9eXeE'])]


@docs_group('Models')
class ScheduleActionShortRunActorTask(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['ZReCs7hkdieq8ZUki'])]
    type: Literal['RUN_ACTOR_TASK']
    actor_task_id: Annotated[str, Field(examples=['HKhKmiCMrDgu9eXeE'])]


@docs_group('Models')
class ScheduleBase(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    name: Annotated[str, Field(examples=['my-schedule'])]
    cron_expression: Annotated[str, Field(examples=['* * * * *'])]
    timezone: Annotated[str, Field(examples=['UTC'])]
    is_enabled: Annotated[bool, Field(examples=[True])]
    is_exclusive: Annotated[bool, Field(examples=[True])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-20T06:33:11.202Z'])]
    next_run_at: Annotated[AwareDatetime | None, Field(examples=['2019-04-12T07:34:10.202Z'])] = None
    last_run_at: Annotated[AwareDatetime | None, Field(examples=['2019-04-12T07:33:10.202Z'])] = None


@docs_group('Models')
class Schedule(ScheduleBase):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    description: Annotated[str | None, Field(examples=['Schedule of actor ...'])] = None
    title: str | None = None
    notifications: Annotated[Notifications | None, Field(title='ScheduleNotifications')] = None
    """
    Notification settings for this schedule.
    """
    actions: list[Annotated[ScheduleActionRunActor | ScheduleActionRunActorTask, Field(discriminator='type')]]


@docs_group('Models')
class ScheduleCreate(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str | None, Field(examples=['my-schedule'])] = None
    is_enabled: Annotated[bool | None, Field(examples=[True])] = None
    is_exclusive: Annotated[bool | None, Field(examples=[True])] = None
    cron_expression: Annotated[str | None, Field(examples=['* * * * *'])] = None
    timezone: Annotated[str | None, Field(examples=['UTC'])] = None
    description: Annotated[str | None, Field(examples=['Schedule of actor ...'])] = None
    title: str | None = None
    actions: (
        list[Annotated[ScheduleCreateActionRunActor | ScheduleCreateActionRunActorTask, Field(discriminator='type')]]
        | None
    ) = None


@docs_group('Models')
class ScheduleCreateActionRunActor(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    type: Literal['RUN_ACTOR']
    actor_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
    run_input: ScheduleActionRunInput | None = None
    run_options: TaskOptions | None = None


@docs_group('Models')
class ScheduleCreateActionRunActorTask(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    type: Literal['RUN_ACTOR_TASK']
    actor_task_id: Annotated[str, Field(examples=['jF8GGEvbEg4Au3NLA'])]
    input: dict[str, Any] | None = None


@docs_group('Models')
class ScheduleInvoked(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    message: Annotated[str, Field(examples=['Schedule invoked'])]
    level: Annotated[str, Field(examples=['INFO'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-03-26T12:28:00.370Z'])]


@docs_group('Models')
class ScheduleLogResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: list[ScheduleInvoked]


@docs_group('Models')
class ScheduleResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Schedule


@docs_group('Models')
class ScheduleShort(ScheduleBase):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actions: list[Annotated[ScheduleActionShortRunActor | ScheduleActionShortRunActorTask, Field(discriminator='type')]]


@docs_group('Models')
class SchemaValidationErrorData(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    invalid_items: list[InvalidItem]
    """
    A list of invalid items in the received array of items.
    """


@docs_group('Models')
class SourceCodeFile(BaseModel):
    """Represents a single file in the Actor's source code."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    format: SourceCodeFileFormat | None = None
    """
    Format of the file's content, `TEXT` for plain text and `BASE64` for encoded content.
    """
    content: Annotated[str | None, Field(examples=["console.log('This is the main.js file');"])] = None
    """
    The contents of the file. Interpreted based on the value of `format`.
    """
    name: Annotated[str, Field(examples=['src/main.js'])]
    """
    The path of the file relative to the Actor's root directory.
    """


@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,
        alias_generator=to_camel,
    )
    name: Annotated[str, Field(examples=['src/utils'])]
    """
    The path of the folder relative to the Actor's root directory.
    """
    folder: Annotated[bool, Field(examples=[True])]
    """
    Whether it's a folder. Distinguishes folders from files.
    """


@docs_group('Models')
class StorageIds(BaseModel):
    """A map of aliased storage IDs associated with this run, grouped by storage type."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    datasets: Datasets | None = None
    """
    Aliased dataset IDs for this run.
    """
    key_value_stores: KeyValueStores | None = None
    """
    Aliased key-value store IDs for this run.
    """
    request_queues: RequestQueues | None = None
    """
    Aliased request queue IDs for this run.
    """


@docs_group('Models')
class Storages(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    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 StoreListActor(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
    title: Annotated[str, Field(examples=['My Public Actor'])]
    name: Annotated[str, Field(examples=['my-public-actor'])]
    username: Annotated[str, Field(examples=['jane35'])]
    user_full_name: Annotated[str | None, Field(examples=['Jane H. Doe'])] = None
    description: Annotated[str | None, Field(examples=['My public actor!'])] = None
    categories: Annotated[list[str] | None, Field(examples=[['MARKETING', 'LEAD_GENERATION']])] = None
    notice: ActorNotice | None = None
    picture_url: Annotated[str | None, Field(examples=['https://...'])] = None
    user_picture_url: Annotated[AnyUrl | None, Field(examples=['https://...'])] = None
    url: Annotated[AnyUrl | None, Field(examples=['https://...'])] = None
    stats: ActorStats
    current_pricing_info: CurrentPricingInfo | None = None
    is_white_listed_for_agentic_payments: bool | None = None
    """
    Whether the Actor is whitelisted for agentic payment processing.
    """
    actor_review_count: Annotated[int | None, Field(examples=[69])] = None
    actor_review_rating: Annotated[float | None, Field(examples=[4.7])] = None
    bookmark_count: Annotated[int | None, Field(examples=[1269])] = None
    badge: Annotated[str | None, Field(examples=[None])] = None
    readme_summary: str | None = None
    """
    A brief, LLM-generated readme summary
    """


@docs_group('Models')
class TaggedBuildInfo(BaseModel):
    """Information about a tagged build."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    build_id: Annotated[str | None, Field(examples=['z2EryhbfhgSyqj6Hn'])] = None
    """
    The ID of the build associated with this tag.
    """
    build_number: Annotated[
        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})$')
    ] = None
    """
    The build number/version string. Can be `null` for legacy builds that lack a valid build number.
    """
    build_number_int: Annotated[int | None, Field(examples=[42])] = None
    """
    The build number encoded as a single integer.
    """
    finished_at: Annotated[AwareDatetime | None, Field(examples=['2019-06-10T11:15:49.286Z'])] = None
    """
    The timestamp when the build finished.
    """


@docs_group('Models')
class Task(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
    name: Annotated[str, Field(examples=['my-task'])]
    username: Annotated[str | None, Field(examples=['janedoe'])] = None
    created_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T07:23:14.855Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T13:30:49.578Z'])]
    removed_at: AwareDatetime | None = None
    stats: TaskStats | None = None
    options: TaskOptions | None = None
    input: TaskInput | list[TaskInput] | None = None
    title: str | None = None
    description: str | None = None
    actor_standby: ActorStandby | None = None
    standby_url: AnyUrl | None = None
    is_public: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the task is published. Based on the `publicConfig.publishedAt` field.

    """
    public_config: TaskPublicConfig | None = None


@docs_group('Models')
class TaskInput(BaseModel):
    """The input configuration for the Actor task. This is a user-defined JSON object
    that will be passed to the Actor when the task is run.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )


@docs_group('Models')
class TaskOptions(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    build: Annotated[str | None, Field(examples=['latest'])] = None
    timeout_secs: Annotated[int | None, Field(examples=[300])] = None
    memory_mbytes: Annotated[int | None, Field(examples=[1024])] = None
    max_items: Annotated[int | None, Field(examples=[1000])] = None
    max_total_charge_usd: Annotated[float | None, Field(examples=[5])] = None
    restart_on_error: Annotated[bool | None, Field(examples=[False])] = None


@docs_group('Models')
class TaskPublicConfig(BaseModel):
    """Public-facing configuration of a published task, used by the task's public landing page.
    The task's publication state is determined by `publishedAt` - a task is published when
    `publishedAt` is set and unpublished when it is `null`.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    published_at: Annotated[AwareDatetime | None, Field(examples=['2025-06-16T09:20:45.777Z'])] = None
    """
    Time when the task was published, or `null` if the task isn't published.
    This field is server-controlled. To publish or unpublish a task, use the
    [Update task](https://docs.apify.com/api/v2/actor-task-put) endpoint and set `isPublic`.

    """
    seo_title: Annotated[str | None, Field(examples=['Scrape data from a website'], max_length=60)] = None
    """
    Name of the Actor task to display by search engines such as Google. Defaults to the task
    title. At most 60 characters.

    """
    seo_description: Annotated[str | None, Field(max_length=160)] = None
    """
    Description of the Actor task to display by search engines such as Google. Defaults to the
    task description. At most 160 characters.

    """
    input_schema_fields: list[str] | None = None
    """
    Names of the task input fields displayed on the public task page.
    """
    dataset_name: str | None = None
    """
    Name of the dataset from the Actor's dataset schema whose results are displayed. When
    `null`, the Actor's default dataset is used. That is, the only dataset the Actor declares,
    or the one named `default` when it declares several.

    """
    dataset_view: str | None = None
    """
    Key of the dataset view from the Actor's dataset schema used to display results. Must be
    one of the views declared on the resolved dataset. You can't publish a task without it.

    """


@docs_group('Models')
class TaskResponse(BaseModel):
    """Response containing Actor task data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Task


@docs_group('Models')
class TaskShort(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['zdc3Pyhyz3m8vjDeM'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    act_id: Annotated[str, Field(examples=['asADASadYvn4mBZmm'])]
    act_name: Annotated[str | None, Field(examples=['my-actor'])] = None
    name: Annotated[str, Field(examples=['my-task'])]
    username: Annotated[str | None, Field(examples=['janedoe'])] = None
    act_username: Annotated[str | None, Field(examples=['janedoe'])] = None
    created_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T07:23:14.855Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2018-10-26T13:30:49.578Z'])]
    stats: TaskStats | None = None


@docs_group('Models')
class TaskStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    total_runs: Annotated[int | None, Field(examples=[15])] = None


@docs_group('Models')
class TestWebhookResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: WebhookDispatch


@docs_group('Models')
class TieredPricingPerDatasetItemEntry(BaseModel):
    """A single tier's price-per-dataset-item entry."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    tiered_price_per_unit_usd: float
    """
    Price per unit in USD for this tier.
    """


@docs_group('Models')
class TieredPricingPerEventEntry(BaseModel):
    """A single tier's price-per-event entry."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    tiered_event_price_usd: float
    """
    Price per event in USD for this tier.
    """


@docs_group('Models')
class UnlockRequestsResponse(BaseModel):
    """Response containing the result of unlocking requests."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: UnlockRequestsResult


@docs_group('Models')
class UnlockRequestsResult(BaseModel):
    """Result of unlocking requests in the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    unlocked_count: Annotated[int, Field(examples=[10])]
    """
    Number of requests that were successfully unlocked.
    """


@docs_group('Models')
class UpdateActorRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str | None, Field(examples=['instagram-scraper'])] = None
    """
    The identifier of the Actor. Use lowercase letters, numbers, and hyphens. Spaces or special characters aren't allowed. Must be unique across your account.
    """
    description: Annotated[str | None, Field(examples=['This scraper extracts posts and comments from Instagram.'])] = (
        None
    )
    """
    Short description of the Actor, displayed in Apify Store and Console.
    """
    is_public: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether the Actor is available to users in Apify Store. If `false`, the Actor is private and only visible to you.
    """
    actor_permission_level: ActorPermissionLevel | None = None
    seo_title: Annotated[str | None, Field(examples=['Free Instagram scraper'])] = None
    """
    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.
    """
    seo_description: Annotated[str | None, Field(examples=['The best scraper for Instagram'])] = None
    """
    Description of the Actor to display by search engines such as Google. Recommended length is 140-156 characters.
    """
    title: Annotated[str | None, Field(examples=['Instagram scraper'])] = None
    """
    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.
    """
    restart_on_error: Annotated[bool | None, Field(deprecated=True, examples=[False])] = None
    versions: list[CreateOrUpdateVersionRequest] | None = None
    """
    An array of `Version` objects. Each object represents a specific version of the Actor's source code: its location, builds, and environment configuration.
    """
    pricing_infos: (
        list[
            Annotated[
                PayPerEventActorPricingInfo
                | PricePerDatasetItemActorPricingInfo
                | FlatPricePerMonthActorPricingInfo
                | FreeActorPricingInfo,
                Field(discriminator='pricing_model'),
            ]
        ]
        | None
    ) = None
    categories: Annotated[list[str] | None, Field(examples=[['SOCIAL_MEDIA']])] = None
    """
    A list of categories that best define the Actor. Reflected in Apify Store's search and filtering options.
    """
    default_run_options: DefaultRunOptions | None = None
    """
    The default settings applied to an Actor run. Can be overridden by the user.
    """
    tagged_builds: Annotated[
        dict[str, Any] | None, Field(examples=[{'latest': {'buildId': 'z2EryhbfhgSyqj6Hn'}, 'beta': None}])
    ] = None
    """
    A dictionary that maps tag names to specific builds. For details, see [Update build tags](#update-build-tags).
    """
    actor_standby: ActorStandby | None = None
    """
    The configuration of the Actor's standby mode. For details, see [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby).
    """
    example_run_input: ExampleRunInput | None = None
    """
    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.
    """
    is_deprecated: bool | None = None
    """
    Whether the Actor is deprecated.
    """


@docs_group('Models')
class UpdateDatasetRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: str | None = None
    general_access: GeneralAccess | None = None


@docs_group('Models')
class UpdateLimitsRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    max_monthly_usage_usd: Annotated[float | None, Field(examples=[300])] = None
    """
    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.

    """
    data_retention_days: Annotated[int | None, Field(examples=[90])] = None
    """
    Apify 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](https://docs.apify.com/storage#data-retention).

    """


@docs_group('Models')
class UpdateRequestQueueRequest(BaseModel):
    """Request object for updating a request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: str | None = None
    """
    The new name for the request queue.
    """
    general_access: GeneralAccess | None = None


@docs_group('Models')
class UpdateRequestResponse(BaseModel):
    """Response containing the result of updating a request in the request queue."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: RequestRegistration


@docs_group('Models')
class UpdateRunRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    run_id: Annotated[str | None, Field(examples=['3KH8gEpp4d8uQSe8T'])] = None
    status_message: Annotated[str | None, Field(examples=['Actor has finished'])] = None
    is_status_message_terminal: Annotated[bool | None, Field(examples=[True])] = None
    general_access: GeneralAccess | None = None


@docs_group('Models')
class UpdateStoreRequest(UpdateDatasetRequest):
    pass


@docs_group('Models')
class UpdateTaskRequest(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    name: Annotated[str | None, Field(examples=['my-task'])] = None
    options: TaskOptions | None = None
    input: TaskInput | list[TaskInput] | None = None
    title: str | None = None
    description: str | None = None
    actor_standby: ActorStandby | None = None
    public_config: TaskPublicConfig | None = None
    """
    Configuration that controls how the published task appears on its public landing page.
    Editing this object requires write permission to the Actor that the task belongs to.

    The fields you send are merged into the stored configuration, so you only need to include
    the ones you're changing. To clear a field, set it to `null`. Sending `publicConfig: null`
    is rejected, so the object as a whole can't be cleared.

    """
    is_public: Annotated[bool | None, Field(examples=[True])] = None
    """
    Set to `true` to publish the task on its public landing page, or `false` to unpublish it.
    Sending the value the task already has does nothing.

    """


@docs_group('Models')
class UsageCycle(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    start_at: Annotated[AwareDatetime, Field(examples=['2022-10-02T00:00:00.000Z'])]
    end_at: Annotated[AwareDatetime, Field(examples=['2022-11-01T23:59:59.999Z'])]


@docs_group('Models')
class UsageItem(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    quantity: Annotated[float, Field(examples=[2.784475])]
    base_amount_usd: Annotated[float, Field(examples=[0.69611875])]
    base_unit_price_usd: Annotated[float | None, Field(examples=[0.25])] = None
    amount_after_volume_discount_usd: Annotated[float | None, Field(examples=[0.69611875])] = None
    price_tiers: list[PriceTiers] | None = None


@docs_group('Models')
class UserPrivateInfo(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str | None, Field(examples=['YiKoxjkaS9gjGTqhF'])] = None
    username: Annotated[str, Field(examples=['myusername'])]
    profile: Profile | None = None
    email: Annotated[EmailStr | None, Field(examples=['bob@example.com'])] = None
    proxy: Proxy | None = None
    plan: Plan | None = None
    effective_platform_features: EffectivePlatformFeatures | None = None
    created_at: Annotated[AwareDatetime | None, Field(examples=['2022-11-29T14:48:29.381Z'])] = None
    is_paying: Annotated[bool | None, Field(examples=[True])] = None


@docs_group('Models')
class UserPublicInfo(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    username: Annotated[str, Field(examples=['d7b9MDYsbtX5L7XAj'])]
    profile: Profile | None = None


@docs_group('Models')
class ValidationError(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    instance_path: str | None = None
    """
    The path to the instance being validated.
    """
    schema_path: str | None = None
    """
    The path to the schema that failed the validation.
    """
    keyword: str | None = None
    """
    The validation keyword that caused the error.
    """
    message: str | None = None
    """
    A message describing the validation error.
    """
    params: dict[str, Any] | None = None
    """
    Additional parameters specific to the validation error.
    """


@docs_group('Models')
class Version(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    version_number: Annotated[str, Field(examples=['0.0'], pattern='^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$')]
    """
    The version number of the Actor. Two numbers separated by a dot, that represent the `MAJOR.MINOR` part of the semantic versioning.
    """
    source_type: VersionSourceType | None
    """
    Where the source code of the version lives.
    """
    env_vars: list[EnvVar] | None = None
    """
    Environment variables for the version.
    """
    apply_env_vars_to_build: Annotated[bool | None, Field(examples=[False])] = None
    """
    Whether to inject the environment variables at build time.
    """
    build_tag: Annotated[str | None, Field(examples=['latest'])] = None
    """
    The tag name to apply to a successful build of this version. Can be `null` when the version has no build tag.
    """
    source_files: Annotated[list[SourceCodeFile | SourceCodeFolder] | None, Field(title='VersionSourceFiles')] = None
    """
    Applies when the `sourceType` is `SOURCE_FILES`. Represents the Actor's file structure as an array of files and folders.
    """
    git_repo_url: str | None = None
    """
    URL of the Git repository to clone the source code from. Applies when the `sourceType` is `GIT_REPO`.
    """
    tarball_url: str | None = None
    """
    URL to download the source code from as a tarball or ZIP file. Applies when the `sourceType` is `TARBALL`.
    """
    github_gist_url: Annotated[str | None, Field(alias='gitHubGistUrl')] = None
    """
    URL of the GitHub Gist to clone the source code from. Applies when the `sourceType` is `GITHUB_GIST`.
    """


@docs_group('Models')
class VersionResponse(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Version


@docs_group('Models')
class Webhook(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['YiKoxjkaS9gjGTqhF'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
    should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
    event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
    condition: WebhookCondition
    ignore_ssl_errors: Annotated[bool, Field(examples=[False])]
    do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
    request_url: Annotated[AnyUrl | None, Field(examples=['http://example.com/'])] = None
    """
    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).
    """
    payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
    headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
    description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
    last_dispatch: ExampleWebhookDispatch | None = None
    stats: WebhookStats | None = None


@docs_group('Models')
class WebhookCondition(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    actor_id: Annotated[str | None, Field(examples=['hksJZtadYvn4mBuin'])] = None
    actor_task_id: Annotated[str | None, Field(examples=['asdLZtadYvn4mBZmm'])] = None
    actor_run_id: Annotated[str | None, Field(examples=['hgdKZtadYvn4mBpoi'])] = None


@docs_group('Models')
class WebhookCreate(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
    event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
    condition: WebhookCondition
    idempotency_key: Annotated[str | None, Field(examples=['fdSJmdP3nfs7sfk3y'])] = None
    ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
    do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
    request_url: Annotated[str, Field(examples=['http://example.com/'])]
    payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
    headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
    description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
    should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None


@docs_group('Models')
class WebhookDispatch(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    webhook_id: Annotated[str, Field(examples=['asdLZtadYvn4mBZmm'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    status: WebhookDispatchStatus
    event_type: WebhookEventType
    event_data: Annotated[EventData | None, Field(title='eventData')] = None
    webhook: WebhookDispatchWebhookSummary | None = None
    calls: Annotated[list[Call] | None, Field(title='calls')] = None


@docs_group('Models')
class WebhookDispatchResponse(TestWebhookResponse):
    pass


@docs_group('Models')
class WebhookDispatchWebhookSummary(BaseModel):
    """A summary of the webhook that triggered this dispatch."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    action_type: Annotated[str | None, Field(examples=['HTTP_REQUEST'])] = None
    condition: WebhookCondition | None = None
    request_url: Annotated[AnyUrl | None, Field(examples=['https://example.com/webhook'])] = None
    """
    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).
    """
    is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None


@docs_group('Models')
class WebhookRepresentation(BaseModel):
    """Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the
    `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose
    items match this schema. Persistent webhook fields (e.g. `condition`) are not used here.

    """

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
    request_url: Annotated[str, Field(examples=['http://example.com/'])]
    """
    The URL to which the webhook sends its payload.
    """
    payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
    """
    Optional template for the JSON payload sent by the webhook.
    """
    headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
    """
    Optional template for the HTTP headers sent by the webhook.
    """
    should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
    """
    Flag to also interpolate `{{...}}` variables inside string values of the payload and headers templates.
    """
    idempotency_key: Annotated[str | None, Field(examples=['fdSJmdP3nfs7sfk3y'])] = None
    """
    Key that prevents creating duplicate webhooks, e.g. when the run-starting request is retried.
    """
    ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
    """
    Flag to ignore SSL errors when the webhook sends the request.
    """
    do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
    """
    Flag to skip retrying the webhook request on failure.
    """


@docs_group('Models')
class WebhookResponse(BaseModel):
    """Response containing webhook data."""

    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    data: Webhook


@docs_group('Models')
class WebhookShort(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    id: Annotated[str, Field(examples=['YiKoxjkaS9gjGTqhF'])]
    created_at: Annotated[AwareDatetime, Field(examples=['2019-12-12T07:34:14.202Z'])]
    modified_at: Annotated[AwareDatetime, Field(examples=['2019-12-13T08:36:13.202Z'])]
    user_id: Annotated[str, Field(examples=['wRsJZtadYvn4mBZmm'])]
    is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
    is_apify_integration: Annotated[bool | None, Field(examples=[False])] = None
    is_enabled: Annotated[bool | None, Field(examples=[True])] = None
    action_type: Annotated[str | None, Field(examples=['HTTP_REQUEST'])] = None
    should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
    event_types: Annotated[list[WebhookEventType], Field(examples=[['ACTOR.RUN.SUCCEEDED']])]
    condition: WebhookCondition
    ignore_ssl_errors: Annotated[bool, Field(examples=[False])]
    do_not_retry: Annotated[bool, Field(examples=[False])]
    request_url: Annotated[AnyUrl, Field(examples=['http://example.com/'])]
    last_dispatch: ExampleWebhookDispatch | None = None
    stats: WebhookStats | None = None


@docs_group('Models')
class WebhookStats(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    total_dispatches: Annotated[int | None, Field(examples=[1])] = None


@docs_group('Models')
class WebhookUpdate(BaseModel):
    model_config = ConfigDict(
        extra='allow',
        populate_by_name=True,
        alias_generator=to_camel,
    )
    is_ad_hoc: Annotated[bool | None, Field(examples=[False])] = None
    event_types: Annotated[list[WebhookEventType] | None, Field(examples=[['ACTOR.RUN.SUCCEEDED']])] = None
    condition: WebhookCondition | None = None
    ignore_ssl_errors: Annotated[bool | None, Field(examples=[False])] = None
    do_not_retry: Annotated[bool | None, Field(examples=[False])] = None
    request_url: Annotated[AnyUrl | None, Field(examples=['http://example.com/'])] = None
    payload_template: Annotated[str | None, Field(examples=['{\\n "userId": {{userId}}...'])] = None
    headers_template: Annotated[str | None, Field(examples=['{\\n "Authorization": "Bearer ..."}'])] = None
    description: Annotated[str | None, Field(examples=['this is webhook description'])] = None
    should_interpolate_strings: Annotated[bool | None, Field(examples=[False])] = None
