# 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
from .okr_objective import OkrObjective


class Okr(object):
    _types = {
        "id": str,
        "period_id": str,
        "create_date": str,
        "name": I18n,
        "objectives": List[OkrObjective],
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.period_id: Optional[str] = None
        self.create_date: Optional[str] = None
        self.name: Optional[I18n] = None
        self.objectives: Optional[List[OkrObjective]] = None
        init(self, d, self._types)

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


class OkrBuilder(object):
    def __init__(self) -> None:
        self._okr = Okr()

    def id(self, id: str) -> "OkrBuilder":
        self._okr.id = id
        return self

    def period_id(self, period_id: str) -> "OkrBuilder":
        self._okr.period_id = period_id
        return self

    def create_date(self, create_date: str) -> "OkrBuilder":
        self._okr.create_date = create_date
        return self

    def name(self, name: I18n) -> "OkrBuilder":
        self._okr.name = name
        return self

    def objectives(self, objectives: List[OkrObjective]) -> "OkrBuilder":
        self._okr.objectives = objectives
        return self

    def build(self) -> "Okr":
        return self._okr
