# 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 .verif_filter_rule import VerifFilterRule
from .verif_item import VerifItem
from .verif_data_source_rule import VerifDataSourceRule


class VerifDatasourceConfig(object):
    _types = {
        "filter_type": int,
        "filter_rule": VerifFilterRule,
        "is_collect": bool,
        "is_proration": bool,
        "is_retro": bool,
        "items": List[VerifItem],
        "data_source_rule": VerifDataSourceRule,
    }

    def __init__(self, d=None):
        self.filter_type: Optional[int] = None
        self.filter_rule: Optional[VerifFilterRule] = None
        self.is_collect: Optional[bool] = None
        self.is_proration: Optional[bool] = None
        self.is_retro: Optional[bool] = None
        self.items: Optional[List[VerifItem]] = None
        self.data_source_rule: Optional[VerifDataSourceRule] = None
        init(self, d, self._types)

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


class VerifDatasourceConfigBuilder(object):
    def __init__(self) -> None:
        self._verif_datasource_config = VerifDatasourceConfig()

    def filter_type(self, filter_type: int) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.filter_type = filter_type
        return self

    def filter_rule(self, filter_rule: VerifFilterRule) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.filter_rule = filter_rule
        return self

    def is_collect(self, is_collect: bool) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.is_collect = is_collect
        return self

    def is_proration(self, is_proration: bool) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.is_proration = is_proration
        return self

    def is_retro(self, is_retro: bool) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.is_retro = is_retro
        return self

    def items(self, items: List[VerifItem]) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.items = items
        return self

    def data_source_rule(self, data_source_rule: VerifDataSourceRule) -> "VerifDatasourceConfigBuilder":
        self._verif_datasource_config.data_source_rule = data_source_rule
        return self

    def build(self) -> "VerifDatasourceConfig":
        return self._verif_datasource_config
