Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /dislovelhl_enhanced-agent-bus /_compat /api_versioning.py
| """Shim for src.core.shared.api_versioning.""" | |
| from __future__ import annotations | |
| from typing import Any | |
| try: | |
| from src.core.shared.api_versioning import * # noqa: F403 | |
| except ImportError: | |
| DEFAULT_API_VERSION = "v1" | |
| class APIVersion: | |
| def __init__(self, version: str = DEFAULT_API_VERSION) -> None: | |
| self.version = version | |
| self.major = int(version.lstrip("v").split(".")[0]) if version else 1 | |
| def __str__(self) -> str: | |
| return self.version | |
| def __repr__(self) -> str: | |
| return f"APIVersion({self.version!r})" | |
| def get_api_version() -> str: | |
| return DEFAULT_API_VERSION | |
| def version_prefix(version: str = DEFAULT_API_VERSION) -> str: | |
| return f"/api/{version}" | |
| class VersionedRouter: | |
| """Stub versioned router.""" | |
| def __init__(self, version: str = DEFAULT_API_VERSION, **kwargs: Any) -> None: | |
| self.version = version | |
| self.prefix = f"/api/{version}" | |
Xet Storage Details
- Size:
- 996 Bytes
- Xet hash:
- f0af9221b89656c4c52a584a9c8303e4e367c8ce99f056a7f75a5e46451364a7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.