# 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 .social_plan_item_setting import SocialPlanItemSetting
from .social_plan_item_setting import SocialPlanItemSetting


class SocialArchiveItem(object):
    _types = {
        "insurance_id": str,
        "insurance_name": I18n,
        "company_deduction": str,
        "company_setting": SocialPlanItemSetting,
        "personal_deduction": str,
        "personal_setting": SocialPlanItemSetting,
        "payment_frequency": str,
        "payment_months": List[int],
    }

    def __init__(self, d=None):
        self.insurance_id: Optional[str] = None
        self.insurance_name: Optional[I18n] = None
        self.company_deduction: Optional[str] = None
        self.company_setting: Optional[SocialPlanItemSetting] = None
        self.personal_deduction: Optional[str] = None
        self.personal_setting: Optional[SocialPlanItemSetting] = None
        self.payment_frequency: Optional[str] = None
        self.payment_months: Optional[List[int]] = None
        init(self, d, self._types)

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


class SocialArchiveItemBuilder(object):
    def __init__(self) -> None:
        self._social_archive_item = SocialArchiveItem()

    def insurance_id(self, insurance_id: str) -> "SocialArchiveItemBuilder":
        self._social_archive_item.insurance_id = insurance_id
        return self

    def insurance_name(self, insurance_name: I18n) -> "SocialArchiveItemBuilder":
        self._social_archive_item.insurance_name = insurance_name
        return self

    def company_deduction(self, company_deduction: str) -> "SocialArchiveItemBuilder":
        self._social_archive_item.company_deduction = company_deduction
        return self

    def company_setting(self, company_setting: SocialPlanItemSetting) -> "SocialArchiveItemBuilder":
        self._social_archive_item.company_setting = company_setting
        return self

    def personal_deduction(self, personal_deduction: str) -> "SocialArchiveItemBuilder":
        self._social_archive_item.personal_deduction = personal_deduction
        return self

    def personal_setting(self, personal_setting: SocialPlanItemSetting) -> "SocialArchiveItemBuilder":
        self._social_archive_item.personal_setting = personal_setting
        return self

    def payment_frequency(self, payment_frequency: str) -> "SocialArchiveItemBuilder":
        self._social_archive_item.payment_frequency = payment_frequency
        return self

    def payment_months(self, payment_months: List[int]) -> "SocialArchiveItemBuilder":
        self._social_archive_item.payment_months = payment_months
        return self

    def build(self) -> "SocialArchiveItem":
        return self._social_archive_item
