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

from __future__ import annotations
from enum import Enum
from polar_sdk import utils
from polar_sdk.types import BaseModel
import pydantic
from typing import Final
from typing_extensions import Annotated


class AlreadySubscribedType(str, Enum):
    ALREADY_SUBSCRIBED = "AlreadySubscribed"
class AlreadySubscribedData(BaseModel):
    detail: str
    TYPE: Annotated[Final[AlreadySubscribedType], pydantic.Field(alias="type")] = AlreadySubscribedType.ALREADY_SUBSCRIBED # type: ignore
    


class AlreadySubscribed(Exception):
    data: AlreadySubscribedData

    def __init__(self, data: AlreadySubscribedData):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(self.data, AlreadySubscribedData)

