# 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 .user_id import UserId


class OpenResult(object):
    _types = {
        "user_id": UserId,
        "semester_id": str,
        "activity_id": str,
        "open_time": str,
    }

    def __init__(self, d=None):
        self.user_id: Optional[UserId] = None
        self.semester_id: Optional[str] = None
        self.activity_id: Optional[str] = None
        self.open_time: Optional[str] = None
        init(self, d, self._types)

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


class OpenResultBuilder(object):
    def __init__(self) -> None:
        self._open_result = OpenResult()

    def user_id(self, user_id: UserId) -> "OpenResultBuilder":
        self._open_result.user_id = user_id
        return self

    def semester_id(self, semester_id: str) -> "OpenResultBuilder":
        self._open_result.semester_id = semester_id
        return self

    def activity_id(self, activity_id: str) -> "OpenResultBuilder":
        self._open_result.activity_id = activity_id
        return self

    def open_time(self, open_time: str) -> "OpenResultBuilder":
        self._open_result.open_time = open_time
        return self

    def build(self) -> "OpenResult":
        return self._open_result
