# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class VerifFieldSourceConfig(object):
    _types = {
        "formula_id": str,
        "formula_item_id": str,
        "formula_text": str,
        "api_name": str,
        "source_aggregation_type": int,
        "ref_type": int,
    }

    def __init__(self, d=None):
        self.formula_id: Optional[str] = None
        self.formula_item_id: Optional[str] = None
        self.formula_text: Optional[str] = None
        self.api_name: Optional[str] = None
        self.source_aggregation_type: Optional[int] = None
        self.ref_type: Optional[int] = None
        init(self, d, self._types)

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


class VerifFieldSourceConfigBuilder(object):
    def __init__(self) -> None:
        self._verif_field_source_config = VerifFieldSourceConfig()

    def formula_id(self, formula_id: str) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.formula_id = formula_id
        return self

    def formula_item_id(self, formula_item_id: str) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.formula_item_id = formula_item_id
        return self

    def formula_text(self, formula_text: str) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.formula_text = formula_text
        return self

    def api_name(self, api_name: str) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.api_name = api_name
        return self

    def source_aggregation_type(self, source_aggregation_type: int) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.source_aggregation_type = source_aggregation_type
        return self

    def ref_type(self, ref_type: int) -> "VerifFieldSourceConfigBuilder":
        self._verif_field_source_config.ref_type = ref_type
        return self

    def build(self) -> "VerifFieldSourceConfig":
        return self._verif_field_source_config
