# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class KnowledgeQaSearchEnterprisePassage(object):
    _types = {
        "id": str,
        "source_type": int,
        "title": str,
        "content": str,
        "url": str,
        "score": float,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.source_type: Optional[int] = None
        self.title: Optional[str] = None
        self.content: Optional[str] = None
        self.url: Optional[str] = None
        self.score: Optional[float] = None
        init(self, d, self._types)

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


class KnowledgeQaSearchEnterprisePassageBuilder(object):
    def __init__(self) -> None:
        self._knowledge_qa_search_enterprise_passage = KnowledgeQaSearchEnterprisePassage()

    def id(self, id: str) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.id = id
        return self

    def source_type(self, source_type: int) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.source_type = source_type
        return self

    def title(self, title: str) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.title = title
        return self

    def content(self, content: str) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.content = content
        return self

    def url(self, url: str) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.url = url
        return self

    def score(self, score: float) -> "KnowledgeQaSearchEnterprisePassageBuilder":
        self._knowledge_qa_search_enterprise_passage.score = score
        return self

    def build(self) -> "KnowledgeQaSearchEnterprisePassage":
        return self._knowledge_qa_search_enterprise_passage
