# 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 import DatasourceRecord


class QueryDatasourceRecordResponseBody(object):
    _types = {
        "page_token": str,
        "has_more": bool,
        "records": List[DatasourceRecord],
    }

    def __init__(self, d=None):
        self.page_token: Optional[str] = None
        self.has_more: Optional[bool] = None
        self.records: Optional[List[DatasourceRecord]] = None
        init(self, d, self._types)

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


class QueryDatasourceRecordResponseBodyBuilder(object):
    def __init__(self) -> None:
        self._query_datasource_record_response_body = QueryDatasourceRecordResponseBody()

    def page_token(self, page_token: str) -> "QueryDatasourceRecordResponseBodyBuilder":
        self._query_datasource_record_response_body.page_token = page_token
        return self

    def has_more(self, has_more: bool) -> "QueryDatasourceRecordResponseBodyBuilder":
        self._query_datasource_record_response_body.has_more = has_more
        return self

    def records(self, records: List[DatasourceRecord]) -> "QueryDatasourceRecordResponseBodyBuilder":
        self._query_datasource_record_response_body.records = records
        return self

    def build(self) -> "QueryDatasourceRecordResponseBody":
        return self._query_datasource_record_response_body
