# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init
from .time_info import TimeInfo


class Instance(object):
    _types = {
        "event_id": str,
        "summary": str,
        "description": str,
        "start_time": TimeInfo,
        "end_time": TimeInfo,
        "status": str,
        "is_exception": bool,
        "app_link": str,
    }

    def __init__(self, d=None):
        self.event_id: Optional[str] = None
        self.summary: Optional[str] = None
        self.description: Optional[str] = None
        self.start_time: Optional[TimeInfo] = None
        self.end_time: Optional[TimeInfo] = None
        self.status: Optional[str] = None
        self.is_exception: Optional[bool] = None
        self.app_link: Optional[str] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "InstanceBuilder":
        return InstanceBuilder()


class InstanceBuilder(object):
    def __init__(self) -> None:
        self._instance = Instance()

    def event_id(self, event_id: str) -> "InstanceBuilder":
        self._instance.event_id = event_id
        return self

    def summary(self, summary: str) -> "InstanceBuilder":
        self._instance.summary = summary
        return self

    def description(self, description: str) -> "InstanceBuilder":
        self._instance.description = description
        return self

    def start_time(self, start_time: TimeInfo) -> "InstanceBuilder":
        self._instance.start_time = start_time
        return self

    def end_time(self, end_time: TimeInfo) -> "InstanceBuilder":
        self._instance.end_time = end_time
        return self

    def status(self, status: str) -> "InstanceBuilder":
        self._instance.status = status
        return self

    def is_exception(self, is_exception: bool) -> "InstanceBuilder":
        self._instance.is_exception = is_exception
        return self

    def app_link(self, app_link: str) -> "InstanceBuilder":
        self._instance.app_link = app_link
        return self

    def build(self) -> "Instance":
        return self._instance
