Skip to content

Commit

Permalink
Auto-Updated OpenAPI Clients
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 22, 2024
1 parent 124b0d5 commit e2b46be
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .updater/api/api-docs-enums.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .updater/api/api-docs-strings.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client-api_python/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ PySirius/models/spectral_library_match_summary.py
PySirius/models/spectral_library_search.py
PySirius/models/spectral_matching_type.py
PySirius/models/spectrum_annotation.py
PySirius/models/stored_job_submission.py
PySirius/models/structure_candidate.py
PySirius/models/structure_candidate_formula.py
PySirius/models/structure_candidate_opt_field.py
Expand Down Expand Up @@ -235,6 +236,7 @@ docs/SpectralLibraryMatchSummary.md
docs/SpectralLibrarySearch.md
docs/SpectralMatchingType.md
docs/SpectrumAnnotation.md
docs/StoredJobSubmission.md
docs/StructureCandidate.md
docs/StructureCandidateFormula.md
docs/StructureCandidateOptField.md
Expand Down
1 change: 1 addition & 0 deletions client-api_python/generated/PySirius/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
from PySirius.models.spectral_library_search import SpectralLibrarySearch
from PySirius.models.spectral_matching_type import SpectralMatchingType
from PySirius.models.spectrum_annotation import SpectrumAnnotation
from PySirius.models.stored_job_submission import StoredJobSubmission
from PySirius.models.structure_candidate import StructureCandidate
from PySirius.models.structure_candidate_formula import StructureCandidateFormula
from PySirius.models.structure_candidate_opt_field import StructureCandidateOptField
Expand Down
51 changes: 34 additions & 17 deletions client-api_python/generated/PySirius/api/jobs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from PySirius.models.job_opt_field import JobOptField
from PySirius.models.job_submission import JobSubmission
from PySirius.models.paged_model_job import PagedModelJob
from PySirius.models.stored_job_submission import StoredJobSubmission

from PySirius.api_client import ApiClient, RequestSerialized
from PySirius.api_response import ApiResponse
Expand Down Expand Up @@ -1476,7 +1477,7 @@ def get_job_config(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> JobSubmission:
) -> StoredJobSubmission:
"""Request job configuration with given name.
Request job configuration with given name.
Expand Down Expand Up @@ -1517,7 +1518,7 @@ def get_job_config(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "JobSubmission",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -1547,7 +1548,7 @@ def get_job_config_with_http_info(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[JobSubmission]:
) -> ApiResponse[StoredJobSubmission]:
"""Request job configuration with given name.
Request job configuration with given name.
Expand Down Expand Up @@ -1588,7 +1589,7 @@ def get_job_config_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "JobSubmission",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -1659,7 +1660,7 @@ def get_job_config_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "JobSubmission",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -1990,7 +1991,7 @@ def get_job_configs(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[JobSubmission]:
) -> List[StoredJobSubmission]:
"""Request all available job configurations
Request all available job configurations
Expand Down Expand Up @@ -2025,7 +2026,7 @@ def get_job_configs(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "List[JobSubmission]",
'200': "List[StoredJobSubmission]",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -2053,7 +2054,7 @@ def get_job_configs_with_http_info(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[JobSubmission]]:
) -> ApiResponse[List[StoredJobSubmission]]:
"""Request all available job configurations
Request all available job configurations
Expand Down Expand Up @@ -2088,7 +2089,7 @@ def get_job_configs_with_http_info(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "List[JobSubmission]",
'200': "List[StoredJobSubmission]",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -2151,7 +2152,7 @@ def get_job_configs_without_preload_content(
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "List[JobSubmission]",
'200': "List[StoredJobSubmission]",
}
response_data = self.api_client.call_api(
*_param,
Expand Down Expand Up @@ -3096,6 +3097,7 @@ def save_job_config(
name: Annotated[StrictStr, Field(description="name of the job-config to add")],
job_submission: Annotated[JobSubmission, Field(description="to add")],
override_existing: Optional[StrictBool] = None,
move_parameters_to_config_map: Annotated[Optional[StrictBool], Field(description="if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3108,7 +3110,7 @@ def save_job_config(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> str:
) -> StoredJobSubmission:
"""Add new job configuration with given name.
Add new job configuration with given name.
Expand All @@ -3119,6 +3121,8 @@ def save_job_config(
:type job_submission: JobSubmission
:param override_existing:
:type override_existing: bool
:param move_parameters_to_config_map: if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object
:type move_parameters_to_config_map: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3145,14 +3149,15 @@ def save_job_config(
name=name,
job_submission=job_submission,
override_existing=override_existing,
move_parameters_to_config_map=move_parameters_to_config_map,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand All @@ -3171,6 +3176,7 @@ def save_job_config_with_http_info(
name: Annotated[StrictStr, Field(description="name of the job-config to add")],
job_submission: Annotated[JobSubmission, Field(description="to add")],
override_existing: Optional[StrictBool] = None,
move_parameters_to_config_map: Annotated[Optional[StrictBool], Field(description="if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3183,7 +3189,7 @@ def save_job_config_with_http_info(
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[str]:
) -> ApiResponse[StoredJobSubmission]:
"""Add new job configuration with given name.
Add new job configuration with given name.
Expand All @@ -3194,6 +3200,8 @@ def save_job_config_with_http_info(
:type job_submission: JobSubmission
:param override_existing:
:type override_existing: bool
:param move_parameters_to_config_map: if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object
:type move_parameters_to_config_map: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3220,14 +3228,15 @@ def save_job_config_with_http_info(
name=name,
job_submission=job_submission,
override_existing=override_existing,
move_parameters_to_config_map=move_parameters_to_config_map,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand All @@ -3246,6 +3255,7 @@ def save_job_config_without_preload_content(
name: Annotated[StrictStr, Field(description="name of the job-config to add")],
job_submission: Annotated[JobSubmission, Field(description="to add")],
override_existing: Optional[StrictBool] = None,
move_parameters_to_config_map: Annotated[Optional[StrictBool], Field(description="if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -3269,6 +3279,8 @@ def save_job_config_without_preload_content(
:type job_submission: JobSubmission
:param override_existing:
:type override_existing: bool
:param move_parameters_to_config_map: if true, object-based parameters will be converted to and added to the generic configMap parameters in the return object
:type move_parameters_to_config_map: bool
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -3295,14 +3307,15 @@ def save_job_config_without_preload_content(
name=name,
job_submission=job_submission,
override_existing=override_existing,
move_parameters_to_config_map=move_parameters_to_config_map,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'200': "StoredJobSubmission",
}
response_data = self.api_client.call_api(
*_param,
Expand All @@ -3316,6 +3329,7 @@ def _save_job_config_serialize(
name,
job_submission,
override_existing,
move_parameters_to_config_map,
_request_auth,
_content_type,
_headers,
Expand All @@ -3342,6 +3356,10 @@ def _save_job_config_serialize(

_query_params.append(('overrideExisting', override_existing))

if move_parameters_to_config_map is not None:

_query_params.append(('moveParametersToConfigMap', move_parameters_to_config_map))

# process the header parameters
# process the form parameters
# process the body parameter
Expand All @@ -3352,8 +3370,7 @@ def _save_job_config_serialize(
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/problem+json',
'text/plain'
'application/json'
]
)

Expand Down
1 change: 1 addition & 0 deletions client-api_python/generated/PySirius/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
from PySirius.models.spectral_library_search import SpectralLibrarySearch
from PySirius.models.spectral_matching_type import SpectralMatchingType
from PySirius.models.spectrum_annotation import SpectrumAnnotation
from PySirius.models.stored_job_submission import StoredJobSubmission
from PySirius.models.structure_candidate import StructureCandidate
from PySirius.models.structure_candidate_formula import StructureCandidateFormula
from PySirius.models.structure_candidate_opt_field import StructureCandidateOptField
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# coding: utf-8

"""
SIRIUS Nightsky API
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List
from PySirius.models.job_submission import JobSubmission
from typing import Optional, Set
from typing_extensions import Self

class StoredJobSubmission(BaseModel):
"""
StoredJobSubmission
""" # noqa: E501
name: StrictStr = Field(description="Unique name to identify this JobSubmission (job config).")
job_submission: JobSubmission = Field(alias="jobSubmission")
__properties: ClassVar[List[str]] = ["name", "jobSubmission"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of StoredJobSubmission from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of job_submission
if self.job_submission:
_dict['jobSubmission'] = self.job_submission.to_dict()
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of StoredJobSubmission from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"name": obj.get("name"),
"jobSubmission": JobSubmission.from_dict(obj["jobSubmission"]) if obj.get("jobSubmission") is not None else None
})
return _obj


1 change: 1 addition & 0 deletions client-api_python/generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Class | Method | HTTP request | Description
- [SpectralLibrarySearch](docs/SpectralLibrarySearch.md)
- [SpectralMatchingType](docs/SpectralMatchingType.md)
- [SpectrumAnnotation](docs/SpectrumAnnotation.md)
- [StoredJobSubmission](docs/StoredJobSubmission.md)
- [StructureCandidate](docs/StructureCandidate.md)
- [StructureCandidateFormula](docs/StructureCandidateFormula.md)
- [StructureCandidateOptField](docs/StructureCandidateOptField.md)
Expand Down
Loading

0 comments on commit e2b46be

Please sign in to comment.