# 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 .datasource_record_field import DatasourceRecordField


class DatasourceRecord(object):
    _types = {
        "active_status": int,
        "field_values": List[DatasourceRecordField],
    }

    def __init__(self, d=None):
        self.active_status: Optional[int] = None
        self.field_values: Optional[List[DatasourceRecordField]] = None
        init(self, d, self._types)

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


class DatasourceRecordBuilder(object):
    def __init__(self) -> None:
        self._datasource_record = DatasourceRecord()

    def active_status(self, active_status: int) -> "DatasourceRecordBuilder":
        self._datasource_record.active_status = active_status
        return self

    def field_values(self, field_values: List[DatasourceRecordField]) -> "DatasourceRecordBuilder":
        self._datasource_record.field_values = field_values
        return self

    def build(self) -> "DatasourceRecord":
        return self._datasource_record
