# Generated by ariadne-codegen
# Source: gitsrht/graphql/

from typing import Optional

from pydantic import Field

from .base_model import BaseModel


class CodeSearch(BaseModel):
    user: Optional["CodeSearchUser"]


class CodeSearchUser(BaseModel):
    repository: Optional["CodeSearchUserRepository"]


class CodeSearchUserRepository(BaseModel):
    code_search: "CodeSearchUserRepositoryCodeSearch" = Field(alias="codeSearch")


class CodeSearchUserRepositoryCodeSearch(BaseModel):
    total_files: int = Field(alias="totalFiles")
    total_matches: int = Field(alias="totalMatches")
    results: list["CodeSearchUserRepositoryCodeSearchResults"]


class CodeSearchUserRepositoryCodeSearchResults(BaseModel):
    name: str
    lang: str
    lines: list["CodeSearchUserRepositoryCodeSearchResultsLines"]


class CodeSearchUserRepositoryCodeSearchResultsLines(BaseModel):
    line: str
    line_no: int = Field(alias="lineNo")
    before: str
    after: str


CodeSearch.model_rebuild()
CodeSearchUser.model_rebuild()
CodeSearchUserRepository.model_rebuild()
CodeSearchUserRepositoryCodeSearch.model_rebuild()
CodeSearchUserRepositoryCodeSearchResults.model_rebuild()
