# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class RuleDetail(object):
    _types = {
        "effective_time": int,
        "expiration_time": int,
        "anniversary": int,
        "effective_period": int,
    }

    def __init__(self, d=None):
        self.effective_time: Optional[int] = None
        self.expiration_time: Optional[int] = None
        self.anniversary: Optional[int] = None
        self.effective_period: Optional[int] = None
        init(self, d, self._types)

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


class RuleDetailBuilder(object):
    def __init__(self) -> None:
        self._rule_detail = RuleDetail()

    def effective_time(self, effective_time: int) -> "RuleDetailBuilder":
        self._rule_detail.effective_time = effective_time
        return self

    def expiration_time(self, expiration_time: int) -> "RuleDetailBuilder":
        self._rule_detail.expiration_time = expiration_time
        return self

    def anniversary(self, anniversary: int) -> "RuleDetailBuilder":
        self._rule_detail.anniversary = anniversary
        return self

    def effective_period(self, effective_period: int) -> "RuleDetailBuilder":
        self._rule_detail.effective_period = effective_period
        return self

    def build(self) -> "RuleDetail":
        return self._rule_detail
