# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .sqs_queue_metric_config_auth import SqsQueueMetricConfigAuth


class SqsQueueMetricConfig(UniversalBaseModel):
    type: typing.Literal["sqs"] = pydantic.Field(default="sqs")
    """
    +value=sqs
    """

    queue_length: int = pydantic.Field()
    """
    Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the queue and one replica, the auto-scaler will scale the number of replicas to 3.
    """

    auth: typing.Optional[SqsQueueMetricConfigAuth] = pydantic.Field(default=None)
    """
    Receive permissions on the SQS Queue
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow")  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
