|
26 | 26 | ] |
27 | 27 |
|
28 | 28 |
|
29 | | -# class BaseService(BaseModel): |
30 | | -# id: Annotated[str, Field(..., description="Resource identifier")] |
31 | | -# version: Annotated[ |
32 | | -# VersionStr, Field(..., description="Semantic version number of the resource") |
33 | | -# ] |
34 | | -# title: Annotated[ |
35 | | -# str, |
36 | | -# StringConstraints(max_length=100), |
37 | | -# Field(..., description="Human readable name"), |
38 | | -# ] |
39 | | -# description: Annotated[ |
40 | | -# str | None, |
41 | | -# StringConstraints(max_length=500), |
42 | | -# Field(default=None, description="Description of the resource"), |
43 | | -# ] |
44 | | -# url: Annotated[ |
45 | | -# HttpUrl | None, UriSchema(), Field(..., description="Link to get this resource") |
46 | | -# ] |
47 | | - |
48 | | -# @property |
49 | | -# def pep404_version(self) -> Version: |
50 | | -# """Rich version type that can be used e.g. to compare""" |
51 | | -# return packaging.version.parse(self.version) |
52 | | - |
53 | | -# @property |
54 | | -# def url_friendly_id(self) -> str: |
55 | | -# """Use to pass id as parameter in URLs""" |
56 | | -# return urllib.parse.quote_plus(self.id) |
57 | | - |
58 | | -# @property |
59 | | -# def resource_name(self) -> str: |
60 | | -# """Relative resource name""" |
61 | | -# return self.compose_resource_name(self.id, self.version) |
62 | | - |
63 | | -# @property |
64 | | -# def name(self) -> str: |
65 | | -# """API standards notation (see api_resources.py)""" |
66 | | -# return self.resource_name |
67 | | - |
68 | | -# @classmethod |
69 | | -# def compose_resource_name(cls, key: str, version: str) -> str: |
70 | | -# raise NotImplementedError("Subclasses must implement this method") |
71 | | - |
72 | | - |
73 | 29 | class Program(BaseService, ApiServerOutputSchema): |
74 | 30 | """A released program with a specific version""" |
75 | 31 |
|
|
0 commit comments