# 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 .criterion import Criterion
from .sort import Sort
from .record_group_by_item import RecordGroupByItem


class BatchQueryApplicationObjectRecordRequestBody(object):
    _types = {
        "select": List[str],
        "filter": Criterion,
        "order_by": List[Sort],
        "group_by": List[RecordGroupByItem],
        "page_token": str,
        "use_page_token": bool,
        "page_size": int,
        "offset": int,
        "need_total_count": bool,
    }

    def __init__(self, d=None):
        self.select: Optional[List[str]] = None
        self.filter: Optional[Criterion] = None
        self.order_by: Optional[List[Sort]] = None
        self.group_by: Optional[List[RecordGroupByItem]] = None
        self.page_token: Optional[str] = None
        self.use_page_token: Optional[bool] = None
        self.page_size: Optional[int] = None
        self.offset: Optional[int] = None
        self.need_total_count: Optional[bool] = None
        init(self, d, self._types)

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


class BatchQueryApplicationObjectRecordRequestBodyBuilder(object):
    def __init__(self) -> None:
        self._batch_query_application_object_record_request_body = BatchQueryApplicationObjectRecordRequestBody()

    def select(self, select: List[str]) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.select = select
        return self

    def filter(self, filter: Criterion) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.filter = filter
        return self

    def order_by(self, order_by: List[Sort]) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.order_by = order_by
        return self

    def group_by(self, group_by: List[RecordGroupByItem]) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.group_by = group_by
        return self

    def page_token(self, page_token: str) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.page_token = page_token
        return self

    def use_page_token(self, use_page_token: bool) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.use_page_token = use_page_token
        return self

    def page_size(self, page_size: int) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.page_size = page_size
        return self

    def offset(self, offset: int) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.offset = offset
        return self

    def need_total_count(self, need_total_count: bool) -> "BatchQueryApplicationObjectRecordRequestBodyBuilder":
        self._batch_query_application_object_record_request_body.need_total_count = need_total_count
        return self

    def build(self) -> "BatchQueryApplicationObjectRecordRequestBody":
        return self._batch_query_application_object_record_request_body
