Skip to content

Commit 7e6d494

Browse files
committed
chore: update openapi specs
1 parent a5265bc commit 7e6d494

File tree

7 files changed

+110
-7
lines changed

7 files changed

+110
-7
lines changed

src/jaqpot_api_client/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from jaqpot_api_client.models.dataset_type import DatasetType
5555
from jaqpot_api_client.models.doa import Doa
5656
from jaqpot_api_client.models.doa_method import DoaMethod
57+
from jaqpot_api_client.models.docker_config import DockerConfig
5758
from jaqpot_api_client.models.error_code import ErrorCode
5859
from jaqpot_api_client.models.error_response import ErrorResponse
5960
from jaqpot_api_client.models.feature import Feature

src/jaqpot_api_client/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from jaqpot_api_client.models.dataset_type import DatasetType
2828
from jaqpot_api_client.models.doa import Doa
2929
from jaqpot_api_client.models.doa_method import DoaMethod
30+
from jaqpot_api_client.models.docker_config import DockerConfig
3031
from jaqpot_api_client.models.error_code import ErrorCode
3132
from jaqpot_api_client.models.error_response import ErrorResponse
3233
from jaqpot_api_client.models.feature import Feature
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# coding: utf-8
2+
3+
"""
4+
Jaqpot API
5+
6+
A modern RESTful API for model management and prediction services, built using Spring Boot and Kotlin. Supports seamless integration with machine learning workflows.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Contact: upci.ntua@gmail.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
22+
from typing import Any, ClassVar, Dict, List, Optional
23+
from typing_extensions import Annotated
24+
from typing import Optional, Set
25+
from typing_extensions import Self
26+
27+
class DockerConfig(BaseModel):
28+
"""
29+
DockerConfig
30+
""" # noqa: E501
31+
app_name: Annotated[str, Field(strict=True, max_length=63)] = Field(description="Unique identifier used for internal service discovery", alias="appName")
32+
docker_image: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Reference to the Docker image (for admin documentation)", alias="dockerImage")
33+
__properties: ClassVar[List[str]] = ["appName", "dockerImage"]
34+
35+
@field_validator('app_name')
36+
def app_name_validate_regular_expression(cls, value):
37+
"""Validates the regular expression"""
38+
if not re.match(r"^[a-z0-9][a-z0-9-]*[a-z0-9]$", value):
39+
raise ValueError(r"must validate the regular expression /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")
40+
return value
41+
42+
model_config = ConfigDict(
43+
populate_by_name=True,
44+
validate_assignment=True,
45+
protected_namespaces=(),
46+
)
47+
48+
49+
def to_str(self) -> str:
50+
"""Returns the string representation of the model using alias"""
51+
return pprint.pformat(self.model_dump(by_alias=True))
52+
53+
def to_json(self) -> str:
54+
"""Returns the JSON representation of the model using alias"""
55+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56+
return json.dumps(self.to_dict())
57+
58+
@classmethod
59+
def from_json(cls, json_str: str) -> Optional[Self]:
60+
"""Create an instance of DockerConfig from a JSON string"""
61+
return cls.from_dict(json.loads(json_str))
62+
63+
def to_dict(self) -> Dict[str, Any]:
64+
"""Return the dictionary representation of the model using alias.
65+
66+
This has the following differences from calling pydantic's
67+
`self.model_dump(by_alias=True)`:
68+
69+
* `None` is only added to the output dict for nullable fields that
70+
were set at model initialization. Other fields with value `None`
71+
are ignored.
72+
"""
73+
excluded_fields: Set[str] = set([
74+
])
75+
76+
_dict = self.model_dump(
77+
by_alias=True,
78+
exclude=excluded_fields,
79+
exclude_none=True,
80+
)
81+
return _dict
82+
83+
@classmethod
84+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85+
"""Create an instance of DockerConfig from a dict"""
86+
if obj is None:
87+
return None
88+
89+
if not isinstance(obj, dict):
90+
return cls.model_validate(obj)
91+
92+
_obj = cls.model_validate({
93+
"appName": obj.get("appName"),
94+
"dockerImage": obj.get("dockerImage")
95+
})
96+
return _obj
97+
98+

src/jaqpot_api_client/models/feature_type.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class FeatureType(str, Enum):
3333
SMILES = 'SMILES'
3434
STRING = 'STRING'
3535
TEXT = 'TEXT'
36+
BOOLEAN = 'BOOLEAN'
3637
FLOAT_ARRAY = 'FLOAT_ARRAY'
3738
STRING_ARRAY = 'STRING_ARRAY'
3839

src/jaqpot_api_client/models/model.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from typing import Any, ClassVar, Dict, List, Optional, Union
2424
from typing_extensions import Annotated
2525
from jaqpot_api_client.models.doa import Doa
26+
from jaqpot_api_client.models.docker_config import DockerConfig
2627
from jaqpot_api_client.models.feature import Feature
2728
from jaqpot_api_client.models.library import Library
2829
from jaqpot_api_client.models.model_scores import ModelScores
@@ -67,9 +68,10 @@ class Model(BaseModel):
6768
legacy_prediction_service: Optional[StrictStr] = Field(default=None, alias="legacyPredictionService")
6869
scores: Optional[ModelScores] = None
6970
r_pbpk_config: Optional[RPbpkConfig] = Field(default=None, alias="rPbpkConfig")
71+
docker_config: Optional[DockerConfig] = Field(default=None, alias="dockerConfig")
7072
created_at: Optional[datetime] = Field(default=None, description="The date and time when the feature was created.", alias="createdAt")
7173
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the model was last updated.", alias="updatedAt")
72-
__properties: ClassVar[List[str]] = ["id", "name", "description", "type", "jaqpotpyVersion", "doas", "libraries", "dependentFeatures", "independentFeatures", "sharedWithOrganizations", "visibility", "task", "archived", "archivedAt", "torchConfig", "preprocessors", "featurizers", "rawPreprocessor", "rawModel", "creator", "canEdit", "isAdmin", "selectedFeatures", "tags", "legacyPredictionService", "scores", "rPbpkConfig", "createdAt", "updatedAt"]
74+
__properties: ClassVar[List[str]] = ["id", "name", "description", "type", "jaqpotpyVersion", "doas", "libraries", "dependentFeatures", "independentFeatures", "sharedWithOrganizations", "visibility", "task", "archived", "archivedAt", "torchConfig", "preprocessors", "featurizers", "rawPreprocessor", "rawModel", "creator", "canEdit", "isAdmin", "selectedFeatures", "tags", "legacyPredictionService", "scores", "rPbpkConfig", "dockerConfig", "createdAt", "updatedAt"]
7375

7476
model_config = ConfigDict(
7577
populate_by_name=True,
@@ -168,6 +170,9 @@ def to_dict(self) -> Dict[str, Any]:
168170
# override the default output from pydantic by calling `to_dict()` of r_pbpk_config
169171
if self.r_pbpk_config:
170172
_dict['rPbpkConfig'] = self.r_pbpk_config.to_dict()
173+
# override the default output from pydantic by calling `to_dict()` of docker_config
174+
if self.docker_config:
175+
_dict['dockerConfig'] = self.docker_config.to_dict()
171176
return _dict
172177

173178
@classmethod
@@ -207,6 +212,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
207212
"legacyPredictionService": obj.get("legacyPredictionService"),
208213
"scores": ModelScores.from_dict(obj["scores"]) if obj.get("scores") is not None else None,
209214
"rPbpkConfig": RPbpkConfig.from_dict(obj["rPbpkConfig"]) if obj.get("rPbpkConfig") is not None else None,
215+
"dockerConfig": DockerConfig.from_dict(obj["dockerConfig"]) if obj.get("dockerConfig") is not None else None,
210216
"createdAt": obj.get("createdAt"),
211217
"updatedAt": obj.get("updatedAt")
212218
})

src/jaqpot_api_client/models/model_type.py

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class ModelType(str, Enum):
4141
R_SVM = 'R_SVM'
4242
R_TREE_CLASS = 'R_TREE_CLASS'
4343
R_TREE_REGR = 'R_TREE_REGR'
44+
DOCKER = 'DOCKER'
4445
QSAR_TOOLBOX_CALCULATOR = 'QSAR_TOOLBOX_CALCULATOR'
4546
QSAR_TOOLBOX_QSAR_MODEL = 'QSAR_TOOLBOX_QSAR_MODEL'
4647
QSAR_TOOLBOX_PROFILER = 'QSAR_TOOLBOX_PROFILER'

src/jaqpot_api_client/models/prediction_model.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PredictionModel(BaseModel):
3232
"""
3333
PredictionModel
3434
""" # noqa: E501
35-
id: Optional[StrictInt] = Field(default=None, description="Unique identifier for the prediction model")
35+
id: StrictInt = Field(description="Unique identifier for the prediction model")
3636
dependent_features: List[Feature] = Field(description="List of dependent features for the model", alias="dependentFeatures")
3737
independent_features: List[Feature] = Field(description="List of independent features for the model", alias="independentFeatures")
3838
type: ModelType
@@ -123,11 +123,6 @@ def to_dict(self) -> Dict[str, Any]:
123123
if _item_preprocessors:
124124
_items.append(_item_preprocessors.to_dict())
125125
_dict['preprocessors'] = _items
126-
# set to None if id (nullable) is None
127-
# and model_fields_set contains the field
128-
if self.id is None and "id" in self.model_fields_set:
129-
_dict['id'] = None
130-
131126
# set to None if torch_config (nullable) is None
132127
# and model_fields_set contains the field
133128
if self.torch_config is None and "torch_config" in self.model_fields_set:

0 commit comments

Comments
 (0)