# 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 .okr_progress_rate import OkrProgressRate


class OkrObjectiveKr(object):
    _types = {
        "id": str,
        "content": str,
        "score": int,
        "weight": float,
        "progress_rate": OkrProgressRate,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.content: Optional[str] = None
        self.score: Optional[int] = None
        self.weight: Optional[float] = None
        self.progress_rate: Optional[OkrProgressRate] = None
        init(self, d, self._types)

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


class OkrObjectiveKrBuilder(object):
    def __init__(self) -> None:
        self._okr_objective_kr = OkrObjectiveKr()

    def id(self, id: str) -> "OkrObjectiveKrBuilder":
        self._okr_objective_kr.id = id
        return self

    def content(self, content: str) -> "OkrObjectiveKrBuilder":
        self._okr_objective_kr.content = content
        return self

    def score(self, score: int) -> "OkrObjectiveKrBuilder":
        self._okr_objective_kr.score = score
        return self

    def weight(self, weight: float) -> "OkrObjectiveKrBuilder":
        self._okr_objective_kr.weight = weight
        return self

    def progress_rate(self, progress_rate: OkrProgressRate) -> "OkrObjectiveKrBuilder":
        self._okr_objective_kr.progress_rate = progress_rate
        return self

    def build(self) -> "OkrObjectiveKr":
        return self._okr_objective_kr
