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

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from ...types.date import Date
from .organizations_subscription_response_current_plan import (
    OrganizationsSubscriptionResponseCurrentPlan,
)
from .organizations_subscription_response_payment_method import (
    OrganizationsSubscriptionResponsePaymentMethod,
)
from .organizations_subscription_response_scheduled_change import (
    OrganizationsSubscriptionResponseScheduledChange,
)


class OrganizationsSubscriptionResponse(UniversalBaseModel):
    subscription_id: typing_extensions.Annotated[
        str, FieldMetadata(alias="subscriptionId")
    ]
    current_plan: typing_extensions.Annotated[
        OrganizationsSubscriptionResponseCurrentPlan, FieldMetadata(alias="currentPlan")
    ]
    status: str
    current_period_end: typing_extensions.Annotated[
        Date, FieldMetadata(alias="currentPeriodEnd")
    ]
    has_payment_method: typing_extensions.Annotated[
        bool, FieldMetadata(alias="hasPaymentMethod")
    ]
    payment_method: typing_extensions.Annotated[
        typing.Optional[OrganizationsSubscriptionResponsePaymentMethod],
        FieldMetadata(alias="paymentMethod"),
    ] = None
    scheduled_change: typing_extensions.Annotated[
        typing.Optional[OrganizationsSubscriptionResponseScheduledChange],
        FieldMetadata(alias="scheduledChange"),
    ] = 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
