# 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_content import I18nContent
from .accounting_item_value import AccountingItemValue
from .segment_value import SegmentValue


class PaymentAccountingItem(object):
    _types = {
        "id": str,
        "accounting_item_names": List[I18nContent],
        "accounting_item_value": AccountingItemValue,
        "segment_values": List[SegmentValue],
        "accounting_item_type": int,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.accounting_item_names: Optional[List[I18nContent]] = None
        self.accounting_item_value: Optional[AccountingItemValue] = None
        self.segment_values: Optional[List[SegmentValue]] = None
        self.accounting_item_type: Optional[int] = None
        init(self, d, self._types)

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


class PaymentAccountingItemBuilder(object):
    def __init__(self) -> None:
        self._payment_accounting_item = PaymentAccountingItem()

    def id(self, id: str) -> "PaymentAccountingItemBuilder":
        self._payment_accounting_item.id = id
        return self

    def accounting_item_names(self, accounting_item_names: List[I18nContent]) -> "PaymentAccountingItemBuilder":
        self._payment_accounting_item.accounting_item_names = accounting_item_names
        return self

    def accounting_item_value(self, accounting_item_value: AccountingItemValue) -> "PaymentAccountingItemBuilder":
        self._payment_accounting_item.accounting_item_value = accounting_item_value
        return self

    def segment_values(self, segment_values: List[SegmentValue]) -> "PaymentAccountingItemBuilder":
        self._payment_accounting_item.segment_values = segment_values
        return self

    def accounting_item_type(self, accounting_item_type: int) -> "PaymentAccountingItemBuilder":
        self._payment_accounting_item.accounting_item_type = accounting_item_type
        return self

    def build(self) -> "PaymentAccountingItem":
        return self._payment_accounting_item
