from dataclasses import dataclass
from enum import Enum
import os

OCR_PROJECT_ID = os.getenv("OCR_PROJECT_ID")
OCR_LOCATION = os.getenv("OCR_LOCATION")

class OCRProcessorName(str, Enum):
    WTP_LEFT_PAGE = "wtp_left_page"
    WTP_RIGHT_PAGE = "wtp_right_page"
    WTP_COAGULATION = "wtp_coagulation"

@dataclass
class OCRProcessor:
    processor_id: str
    project_id: str = OCR_PROJECT_ID
    location: str = OCR_LOCATION

WTP_LEFT_PAGE_OCR_PROCESSOR_ID = os.getenv("WTP_LEFT_PAGE_OCR_PROCESSOR_ID")
WTP_LEFT_PAGE_OCR_PROCESSOR = OCRProcessor(processor_id=WTP_LEFT_PAGE_OCR_PROCESSOR_ID)

WTP_RIGHT_PAGE_OCR_PROCESSOR_ID = os.getenv("WTP_RIGHT_PAGE_OCR_PROCESSOR_ID")
WTP_RIGHT_PAGE_OCR_PROCESSOR = OCRProcessor(processor_id=WTP_RIGHT_PAGE_OCR_PROCESSOR_ID)

WTP_COAGULATION_OCR_PROCESSOR_ID = os.getenv("WTP_COAGULATION_OCR_PROCESSOR_ID")
WTP_COAGULATION_OCR_PROCESSOR = OCRProcessor(processor_id=WTP_COAGULATION_OCR_PROCESSOR_ID)

OCR_PROCESSORS: dict[OCRProcessorName, type[OCRProcessor]]  = {
    OCRProcessorName.WTP_LEFT_PAGE: WTP_LEFT_PAGE_OCR_PROCESSOR,
    OCRProcessorName.WTP_RIGHT_PAGE: WTP_RIGHT_PAGE_OCR_PROCESSOR,
    OCRProcessorName.WTP_COAGULATION: WTP_COAGULATION_OCR_PROCESSOR

}