# 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 .reward_user import RewardUser
from .reward_candidate import RewardCandidate
from .object_id_name import ObjectIdName
from .i18n import I18n
from .bonus_amount import BonusAmount
from .object_id_name import ObjectIdName
from .reward_user import RewardUser
from .reward_user import RewardUser
from .reward_user import RewardUser
from .reward_user import RewardUser


class Reward(object):
    _types = {
        "id": str,
        "referrer": RewardUser,
        "candidate": RewardCandidate,
        "referral_job": ObjectIdName,
        "reason": I18n,
        "bonus": BonusAmount,
        "create_time": str,
        "rule": ObjectIdName,
        "reward_type": int,
        "job_manager": RewardUser,
        "offer_manager": RewardUser,
        "onborad_time": str,
        "conversion_time": str,
        "confirm_user": RewardUser,
        "confirm_time": str,
        "pay_user": RewardUser,
        "pay_time": str,
        "stage": int,
        "is_import": bool,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.referrer: Optional[RewardUser] = None
        self.candidate: Optional[RewardCandidate] = None
        self.referral_job: Optional[ObjectIdName] = None
        self.reason: Optional[I18n] = None
        self.bonus: Optional[BonusAmount] = None
        self.create_time: Optional[str] = None
        self.rule: Optional[ObjectIdName] = None
        self.reward_type: Optional[int] = None
        self.job_manager: Optional[RewardUser] = None
        self.offer_manager: Optional[RewardUser] = None
        self.onborad_time: Optional[str] = None
        self.conversion_time: Optional[str] = None
        self.confirm_user: Optional[RewardUser] = None
        self.confirm_time: Optional[str] = None
        self.pay_user: Optional[RewardUser] = None
        self.pay_time: Optional[str] = None
        self.stage: Optional[int] = None
        self.is_import: Optional[bool] = None
        init(self, d, self._types)

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


class RewardBuilder(object):
    def __init__(self) -> None:
        self._reward = Reward()

    def id(self, id: str) -> "RewardBuilder":
        self._reward.id = id
        return self

    def referrer(self, referrer: RewardUser) -> "RewardBuilder":
        self._reward.referrer = referrer
        return self

    def candidate(self, candidate: RewardCandidate) -> "RewardBuilder":
        self._reward.candidate = candidate
        return self

    def referral_job(self, referral_job: ObjectIdName) -> "RewardBuilder":
        self._reward.referral_job = referral_job
        return self

    def reason(self, reason: I18n) -> "RewardBuilder":
        self._reward.reason = reason
        return self

    def bonus(self, bonus: BonusAmount) -> "RewardBuilder":
        self._reward.bonus = bonus
        return self

    def create_time(self, create_time: str) -> "RewardBuilder":
        self._reward.create_time = create_time
        return self

    def rule(self, rule: ObjectIdName) -> "RewardBuilder":
        self._reward.rule = rule
        return self

    def reward_type(self, reward_type: int) -> "RewardBuilder":
        self._reward.reward_type = reward_type
        return self

    def job_manager(self, job_manager: RewardUser) -> "RewardBuilder":
        self._reward.job_manager = job_manager
        return self

    def offer_manager(self, offer_manager: RewardUser) -> "RewardBuilder":
        self._reward.offer_manager = offer_manager
        return self

    def onborad_time(self, onborad_time: str) -> "RewardBuilder":
        self._reward.onborad_time = onborad_time
        return self

    def conversion_time(self, conversion_time: str) -> "RewardBuilder":
        self._reward.conversion_time = conversion_time
        return self

    def confirm_user(self, confirm_user: RewardUser) -> "RewardBuilder":
        self._reward.confirm_user = confirm_user
        return self

    def confirm_time(self, confirm_time: str) -> "RewardBuilder":
        self._reward.confirm_time = confirm_time
        return self

    def pay_user(self, pay_user: RewardUser) -> "RewardBuilder":
        self._reward.pay_user = pay_user
        return self

    def pay_time(self, pay_time: str) -> "RewardBuilder":
        self._reward.pay_time = pay_time
        return self

    def stage(self, stage: int) -> "RewardBuilder":
        self._reward.stage = stage
        return self

    def is_import(self, is_import: bool) -> "RewardBuilder":
        self._reward.is_import = is_import
        return self

    def build(self) -> "Reward":
        return self._reward
