from __future__ import annotations from dataclasses import dataclass from typing import Any from .base import ExchangeOperation, ExchangeTemplateLayout, ExchangeTemplatePlan, ExchangeVariable @dataclass(frozen=True) class ExchangePlanInput: biz_domain: str biz_obj: str operation: ExchangeOperation | str template_id: str | None = None version_id: str | None = None version: str | None = None code: str | None = None name: str | None = None description: str | None = None layout: ExchangeTemplateLayout | dict[str, Any] | None = None variables: list[ExchangeVariable] | None = None def to_plan(self) -> ExchangeTemplatePlan: return ExchangeTemplatePlan.from_mapping( biz_domain=self.biz_domain, biz_obj=self.biz_obj, operation=self.operation, template_id=self.template_id, version_id=self.version_id, version=self.version, code=self.code, name=self.name, description=self.description, layout=self.layout, variables=self.variables, )