# 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 .enterprise_knowledge_source_param import EnterpriseKnowledgeSourceParam


class KnowledgeQaSearchRequest(object):
    _types = {
        "query": str,
        "enterprise_knowledge_source": EnterpriseKnowledgeSourceParam,
    }

    def __init__(self, d=None):
        self.query: Optional[str] = None
        self.enterprise_knowledge_source: Optional[EnterpriseKnowledgeSourceParam] = None
        init(self, d, self._types)

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


class KnowledgeQaSearchRequestBuilder(object):
    def __init__(self) -> None:
        self._knowledge_qa_search_request = KnowledgeQaSearchRequest()

    def query(self, query: str) -> "KnowledgeQaSearchRequestBuilder":
        self._knowledge_qa_search_request.query = query
        return self

    def enterprise_knowledge_source(self,
                                    enterprise_knowledge_source: EnterpriseKnowledgeSourceParam) -> "KnowledgeQaSearchRequestBuilder":
        self._knowledge_qa_search_request.enterprise_knowledge_source = enterprise_knowledge_source
        return self

    def build(self) -> "KnowledgeQaSearchRequest":
        return self._knowledge_qa_search_request
