# 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 AppConnector(object):
    _types = {
        "token": str,
        "table_id": str,
        "src_table_path": str,
        "source_type": int,
        "sync_type": int,
        "field_sync_type": int,
        "sync_fields": List[str],
    }

    def __init__(self, d=None):
        self.token: Optional[str] = None
        self.table_id: Optional[str] = None
        self.src_table_path: Optional[str] = None
        self.source_type: Optional[int] = None
        self.sync_type: Optional[int] = None
        self.field_sync_type: Optional[int] = None
        self.sync_fields: Optional[List[str]] = None
        init(self, d, self._types)

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


class AppConnectorBuilder(object):
    def __init__(self) -> None:
        self._app_connector = AppConnector()

    def token(self, token: str) -> "AppConnectorBuilder":
        self._app_connector.token = token
        return self

    def table_id(self, table_id: str) -> "AppConnectorBuilder":
        self._app_connector.table_id = table_id
        return self

    def src_table_path(self, src_table_path: str) -> "AppConnectorBuilder":
        self._app_connector.src_table_path = src_table_path
        return self

    def source_type(self, source_type: int) -> "AppConnectorBuilder":
        self._app_connector.source_type = source_type
        return self

    def sync_type(self, sync_type: int) -> "AppConnectorBuilder":
        self._app_connector.sync_type = sync_type
        return self

    def field_sync_type(self, field_sync_type: int) -> "AppConnectorBuilder":
        self._app_connector.field_sync_type = field_sync_type
        return self

    def sync_fields(self, sync_fields: List[str]) -> "AppConnectorBuilder":
        self._app_connector.sync_fields = sync_fields
        return self

    def build(self) -> "AppConnector":
        return self._app_connector
