# 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 .id_with_name import IdWithName
from .verif_source_config import VerifSourceConfig


class VerifItem(object):
    _types = {
        "item_id": str,
        "item_name": IdWithName,
        "field_type": int,
        "decimal_places": int,
        "aggregation_type": int,
        "seq": int,
        "source_type": int,
        "source_config": VerifSourceConfig,
        "status": int,
    }

    def __init__(self, d=None):
        self.item_id: Optional[str] = None
        self.item_name: Optional[IdWithName] = None
        self.field_type: Optional[int] = None
        self.decimal_places: Optional[int] = None
        self.aggregation_type: Optional[int] = None
        self.seq: Optional[int] = None
        self.source_type: Optional[int] = None
        self.source_config: Optional[VerifSourceConfig] = None
        self.status: Optional[int] = None
        init(self, d, self._types)

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


class VerifItemBuilder(object):
    def __init__(self) -> None:
        self._verif_item = VerifItem()

    def item_id(self, item_id: str) -> "VerifItemBuilder":
        self._verif_item.item_id = item_id
        return self

    def item_name(self, item_name: IdWithName) -> "VerifItemBuilder":
        self._verif_item.item_name = item_name
        return self

    def field_type(self, field_type: int) -> "VerifItemBuilder":
        self._verif_item.field_type = field_type
        return self

    def decimal_places(self, decimal_places: int) -> "VerifItemBuilder":
        self._verif_item.decimal_places = decimal_places
        return self

    def aggregation_type(self, aggregation_type: int) -> "VerifItemBuilder":
        self._verif_item.aggregation_type = aggregation_type
        return self

    def seq(self, seq: int) -> "VerifItemBuilder":
        self._verif_item.seq = seq
        return self

    def source_type(self, source_type: int) -> "VerifItemBuilder":
        self._verif_item.source_type = source_type
        return self

    def source_config(self, source_config: VerifSourceConfig) -> "VerifItemBuilder":
        self._verif_item.source_config = source_config
        return self

    def status(self, status: int) -> "VerifItemBuilder":
        self._verif_item.status = status
        return self

    def build(self) -> "VerifItem":
        return self._verif_item
