# 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 .query_application_object_record_request_body import QueryApplicationObjectRecordRequestBody


class QueryApplicationObjectRecordRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.namespace: Optional[str] = None
        self.object_api_name: Optional[str] = None
        self.id: Optional[str] = None
        self.request_body: Optional[QueryApplicationObjectRecordRequestBody] = None

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


class QueryApplicationObjectRecordRequestBuilder(object):

    def __init__(self) -> None:
        query_application_object_record_request = QueryApplicationObjectRecordRequest()
        query_application_object_record_request.http_method = HttpMethod.POST
        query_application_object_record_request.uri = "/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query"
        query_application_object_record_request.token_types = {AccessTokenType.TENANT}
        self._query_application_object_record_request: QueryApplicationObjectRecordRequest = query_application_object_record_request

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

    def object_api_name(self, object_api_name: str) -> "QueryApplicationObjectRecordRequestBuilder":
        self._query_application_object_record_request.object_api_name = object_api_name
        self._query_application_object_record_request.paths["object_api_name"] = str(object_api_name)
        return self

    def id(self, id: str) -> "QueryApplicationObjectRecordRequestBuilder":
        self._query_application_object_record_request.id = id
        self._query_application_object_record_request.paths["id"] = str(id)
        return self

    def request_body(self,
                     request_body: QueryApplicationObjectRecordRequestBody) -> "QueryApplicationObjectRecordRequestBuilder":
        self._query_application_object_record_request.request_body = request_body
        self._query_application_object_record_request.body = request_body
        return self

    def build(self) -> QueryApplicationObjectRecordRequest:
        return self._query_application_object_record_request
