# 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 .dataset_source_setting import DatasetSourceSetting


class DatasetSource(object):
    _types = {
        "type": str,
        "settings": DatasetSourceSetting,
    }

    def __init__(self, d=None):
        self.type: Optional[str] = None
        self.settings: Optional[DatasetSourceSetting] = None
        init(self, d, self._types)

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


class DatasetSourceBuilder(object):
    def __init__(self) -> None:
        self._dataset_source = DatasetSource()

    def type(self, type: str) -> "DatasetSourceBuilder":
        self._dataset_source.type = type
        return self

    def settings(self, settings: DatasetSourceSetting) -> "DatasetSourceBuilder":
        self._dataset_source.settings = settings
        return self

    def build(self) -> "DatasetSource":
        return self._dataset_source
