# 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 .billing_price_view import BillingPriceView
from .entitlement_price_behavior import EntitlementPriceBehavior
from .entitlement_value_type import EntitlementValueType


class UsageBasedEntitlementResponseData(UniversalBaseModel):
    billing_threshold: typing.Optional[int] = None
    consumption_rate: typing.Optional[float] = None
    feature_id: str
    metered_price: typing.Optional[BillingPriceView] = None
    metric_period: typing.Optional[str] = None
    metric_period_month_reset: typing.Optional[str] = None
    monthly_usage_based_price: typing.Optional[BillingPriceView] = None
    price_behavior: typing.Optional[EntitlementPriceBehavior] = None
    value_bool: typing.Optional[bool] = None
    value_numeric: typing.Optional[int] = None
    value_type: EntitlementValueType
    yearly_usage_based_price: typing.Optional[BillingPriceView] = None

    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
