"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from friendli.core.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class AutoscalingPolicyTypedDict(TypedDict):
    """Autoscaling policy."""

    min_replica: NotRequired[int]
    "Setting `minReplica` to 0 allows the endpoint to sleep when idle, reducing costs. The minimum value is 0."
    max_replica: NotRequired[int]
    "The maximum replicas that the endpoint can scale up to. The maximum value is 10."
    cooldown_period: NotRequired[int]
    "Determines how long the endpoint waits before scaling down after the last request."


class AutoscalingPolicy(BaseModel):
    """Autoscaling policy."""

    min_replica: Annotated[Optional[int], pydantic.Field(alias="minReplica")] = 0
    "Setting `minReplica` to 0 allows the endpoint to sleep when idle, reducing costs. The minimum value is 0."
    max_replica: Annotated[Optional[int], pydantic.Field(alias="maxReplica")] = 1
    "The maximum replicas that the endpoint can scale up to. The maximum value is 10."
    cooldown_period: Annotated[
        Optional[int], pydantic.Field(alias="cooldownPeriod")
    ] = 300
    "Determines how long the endpoint waits before scaling down after the last request."
