# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .i18n import I18n


class Semester(object):
    _types = {
        "id": str,
        "name": I18n,
        "type": str,
        "type_group": str,
        "year": int,
        "start_time": str,
        "end_time": str,
        "create_time": str,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.type: Optional[str] = None
        self.type_group: Optional[str] = None
        self.year: Optional[int] = None
        self.start_time: Optional[str] = None
        self.end_time: Optional[str] = None
        self.create_time: Optional[str] = None
        init(self, d, self._types)

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


class SemesterBuilder(object):
    def __init__(self) -> None:
        self._semester = Semester()

    def id(self, id: str) -> "SemesterBuilder":
        self._semester.id = id
        return self

    def name(self, name: I18n) -> "SemesterBuilder":
        self._semester.name = name
        return self

    def type(self, type: str) -> "SemesterBuilder":
        self._semester.type = type
        return self

    def type_group(self, type_group: str) -> "SemesterBuilder":
        self._semester.type_group = type_group
        return self

    def year(self, year: int) -> "SemesterBuilder":
        self._semester.year = year
        return self

    def start_time(self, start_time: str) -> "SemesterBuilder":
        self._semester.start_time = start_time
        return self

    def end_time(self, end_time: str) -> "SemesterBuilder":
        self._semester.end_time = end_time
        return self

    def create_time(self, create_time: str) -> "SemesterBuilder":
        self._semester.create_time = create_time
        return self

    def build(self) -> "Semester":
        return self._semester
