# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .search_application_object_request_body import SearchApplicationObjectRequestBody


class SearchApplicationObjectRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.namespace: Optional[str] = None
        self.request_body: Optional[SearchApplicationObjectRequestBody] = None

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


class SearchApplicationObjectRequestBuilder(object):

    def __init__(self) -> None:
        search_application_object_request = SearchApplicationObjectRequest()
        search_application_object_request.http_method = HttpMethod.POST
        search_application_object_request.uri = "/open-apis/apaas/v1/applications/:namespace/objects/search"
        search_application_object_request.token_types = {AccessTokenType.TENANT}
        self._search_application_object_request: SearchApplicationObjectRequest = search_application_object_request

    def namespace(self, namespace: str) -> "SearchApplicationObjectRequestBuilder":
        self._search_application_object_request.namespace = namespace
        self._search_application_object_request.paths["namespace"] = str(namespace)
        return self

    def request_body(self, request_body: SearchApplicationObjectRequestBody) -> "SearchApplicationObjectRequestBuilder":
        self._search_application_object_request.request_body = request_body
        self._search_application_object_request.body = request_body
        return self

    def build(self) -> SearchApplicationObjectRequest:
        return self._search_application_object_request
