# 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 DatasourceRecordFieldFilter(object):
    _types = {
        "field_code": str,
        "field_values": List[str],
        "operator": int,
    }

    def __init__(self, d=None):
        self.field_code: Optional[str] = None
        self.field_values: Optional[List[str]] = None
        self.operator: Optional[int] = None
        init(self, d, self._types)

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


class DatasourceRecordFieldFilterBuilder(object):
    def __init__(self) -> None:
        self._datasource_record_field_filter = DatasourceRecordFieldFilter()

    def field_code(self, field_code: str) -> "DatasourceRecordFieldFilterBuilder":
        self._datasource_record_field_filter.field_code = field_code
        return self

    def field_values(self, field_values: List[str]) -> "DatasourceRecordFieldFilterBuilder":
        self._datasource_record_field_filter.field_values = field_values
        return self

    def operator(self, operator: int) -> "DatasourceRecordFieldFilterBuilder":
        self._datasource_record_field_filter.operator = operator
        return self

    def build(self) -> "DatasourceRecordFieldFilter":
        return self._datasource_record_field_filter
