# 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 .patch_rate_limit_policy_configuration_request_content_action_action import (
    PatchRateLimitPolicyConfigurationRequestContentActionAction,
)


class PatchRateLimitPolicyConfigurationRequestContentAction(UniversalBaseModel):
    action: PatchRateLimitPolicyConfigurationRequestContentActionAction = pydantic.Field()
    """
    Determines the action to take when the rate limit is exceeded.
    """

    limit: int = pydantic.Field()
    """
    The maximum number of requests allowed per second.
    """

    redirect_uri: str = pydantic.Field()
    """
    The HTTPS URI to redirect to when the rate limit is exceeded.
    """

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

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