import re
from typing import Any, List, Mapping, Optional, Sequence, Type

from django.db import models
from django.db.models.base import Model
from rest_framework.fields import Field

header_regex = re.compile("^[a-zA-Z][0-9A-Za-z_]*:")

def field_to_schema(field: Field) -> Any: ...
def get_pk_description(model: Type[Model], model_field: models.Field) -> str: ...

class ViewInspector(object):
    instance_schemas: Mapping[str, Any]
    view: Any
    def __init__(self) -> None: ...
    def get_link(self, path: str, method: str, base_url: str) -> Any: ...

class AutoSchema(ViewInspector):
    def __init__(self, manual_fields: Optional[Sequence[Any]] = ...) -> None: ...
    def get_description(self, path: str, method: str) -> str: ...
    def get_path_fields(self, path: str, method: str) -> List[Any]: ...
    def get_serializer_fields(self, path: str, method: str) -> List[Any]: ...
    def get_pagination_fields(self, path: str, method: str) -> List[Any]: ...
    def get_filter_fields(self, path: str, method: str) -> List[Any]: ...
    def get_manual_fields(self, path: str, method: str) -> List[Any]: ...
    @staticmethod
    def update_fields(fields: List[Any], update_with: List[Any]) -> List[Any]: ...
    def get_encoding(self, path: str, method: str) -> Optional[str]: ...

class ManualSchema(ViewInspector):
    def __init__(self, fields: Sequence[Any], description: str = ..., encoding: Optional[str] = ...) -> None: ...

class DefaultSchema(ViewInspector): ...
