Skip to content

Commit c9a0211

Browse files
Change BioModel Save Input
1 parent feb7097 commit c9a0211

23 files changed

Lines changed: 220 additions & 159 deletions

File tree

python-restclient/.openapi-generator/FILES

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ docs/Origin.md
3636
docs/Publication.md
3737
docs/PublicationInfo.md
3838
docs/PublicationResourceApi.md
39-
docs/SaveBioModel.md
4039
docs/SchedulerStatus.md
4140
docs/SimulationExecutionStatusRecord.md
4241
docs/SimulationJobStatusRecord.md
@@ -110,7 +109,6 @@ vcell_client/models/model_type.py
110109
vcell_client/models/origin.py
111110
vcell_client/models/publication.py
112111
vcell_client/models/publication_info.py
113-
vcell_client/models/save_bio_model.py
114112
vcell_client/models/scheduler_status.py
115113
vcell_client/models/simulation_execution_status_record.py
116114
vcell_client/models/simulation_job_status_record.py

python-restclient/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ Class | Method | HTTP request | Description
160160
- [Origin](docs/Origin.md)
161161
- [Publication](docs/Publication.md)
162162
- [PublicationInfo](docs/PublicationInfo.md)
163-
- [SaveBioModel](docs/SaveBioModel.md)
164163
- [SchedulerStatus](docs/SchedulerStatus.md)
165164
- [SimulationExecutionStatusRecord](docs/SimulationExecutionStatusRecord.md)
166165
- [SimulationJobStatusRecord](docs/SimulationJobStatusRecord.md)

python-restclient/docs/BioModelResourceApi.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ No authorization required
346346
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
347347

348348
# **save_bio_model**
349-
> str save_bio_model(save_bio_model=save_bio_model)
349+
> str save_bio_model(body, new_name=new_name, sims_requiring_updates=sims_requiring_updates)
350350
351351
Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML.
352352

@@ -356,7 +356,6 @@ Save's the given BioModel. Optional parameters of name and simulations to update
356356
import time
357357
import os
358358
import vcell_client
359-
from vcell_client.models.save_bio_model import SaveBioModel
360359
from vcell_client.rest import ApiException
361360
from pprint import pprint
362361

@@ -375,11 +374,13 @@ configuration = vcell_client.Configuration(
375374
with vcell_client.ApiClient(configuration) as api_client:
376375
# Create an instance of the API class
377376
api_instance = vcell_client.BioModelResourceApi(api_client)
378-
save_bio_model = vcell_client.SaveBioModel() # SaveBioModel | (optional)
377+
body = 'body_example' # str | BioModelVCML which will be saved.
378+
new_name = 'new_name_example' # str | Name to save new BioModel under. Leave blank if re-saving existing BioModel. (optional)
379+
sims_requiring_updates = ['sims_requiring_updates_example'] # List[str] | The name of simulations that will be prepared for future execution. (optional)
379380

380381
try:
381382
# Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML.
382-
api_response = api_instance.save_bio_model(save_bio_model=save_bio_model)
383+
api_response = api_instance.save_bio_model(body, new_name=new_name, sims_requiring_updates=sims_requiring_updates)
383384
print("The response of BioModelResourceApi->save_bio_model:\n")
384385
pprint(api_response)
385386
except Exception as e:
@@ -392,7 +393,9 @@ with vcell_client.ApiClient(configuration) as api_client:
392393

393394
Name | Type | Description | Notes
394395
------------- | ------------- | ------------- | -------------
395-
**save_bio_model** | [**SaveBioModel**](SaveBioModel.md)| | [optional]
396+
**body** | **str**| BioModelVCML which will be saved. |
397+
**new_name** | **str**| Name to save new BioModel under. Leave blank if re-saving existing BioModel. | [optional]
398+
**sims_requiring_updates** | [**List[str]**](str.md)| The name of simulations that will be prepared for future execution. | [optional]
396399

397400
### Return type
398401

@@ -404,7 +407,7 @@ Name | Type | Description | Notes
404407

405408
### HTTP request headers
406409

407-
- **Content-Type**: application/json
410+
- **Content-Type**: application/xml
408411
- **Accept**: application/xml, application/json
409412

410413
### HTTP response details

python-restclient/examples/scratch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
final_pubs: list[Publication] = publication_api.get_publications()
5555
print(f"final publications: {final_pubs}")
5656

57+
BioModelResourceApi(api_client).save_bio_model("")
5758

5859
field = FieldDataResourceApi(api_client)
5960

python-restclient/vcell_client/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
from vcell_client.models.origin import Origin
7070
from vcell_client.models.publication import Publication
7171
from vcell_client.models.publication_info import PublicationInfo
72-
from vcell_client.models.save_bio_model import SaveBioModel
7372
from vcell_client.models.scheduler_status import SchedulerStatus
7473
from vcell_client.models.simulation_execution_status_record import SimulationExecutionStatusRecord
7574
from vcell_client.models.simulation_job_status_record import SimulationJobStatusRecord

python-restclient/vcell_client/api/bio_model_resource_api.py

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
from vcell_client.models.bio_model import BioModel
3434
from vcell_client.models.bio_model_summary import BioModelSummary
35-
from vcell_client.models.save_bio_model import SaveBioModel
3635

3736
from vcell_client.api_client import ApiClient
3837
from vcell_client.api_response import ApiResponse
@@ -1372,7 +1371,9 @@ def _get_bio_model_vcml_serialize(
13721371
@validate_call
13731372
def save_bio_model(
13741373
self,
1375-
save_bio_model: Optional[SaveBioModel] = None,
1374+
body: Annotated[StrictStr, Field(description="BioModelVCML which will be saved.")],
1375+
new_name: Annotated[Optional[StrictStr], Field(description="Name to save new BioModel under. Leave blank if re-saving existing BioModel.")] = None,
1376+
sims_requiring_updates: Annotated[Optional[List[StrictStr]], Field(description="The name of simulations that will be prepared for future execution.")] = None,
13761377
_request_timeout: Union[
13771378
None,
13781379
Annotated[StrictFloat, Field(gt=0)],
@@ -1389,8 +1390,12 @@ def save_bio_model(
13891390
"""Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML.
13901391
13911392
1392-
:param save_bio_model:
1393-
:type save_bio_model: SaveBioModel
1393+
:param body: BioModelVCML which will be saved. (required)
1394+
:type body: str
1395+
:param new_name: Name to save new BioModel under. Leave blank if re-saving existing BioModel.
1396+
:type new_name: str
1397+
:param sims_requiring_updates: The name of simulations that will be prepared for future execution.
1398+
:type sims_requiring_updates: List[str]
13941399
:param _request_timeout: timeout setting for this request. If one
13951400
number provided, it will be total request
13961401
timeout. It can also be a pair (tuple) of
@@ -1414,7 +1419,9 @@ def save_bio_model(
14141419
""" # noqa: E501
14151420

14161421
_param = self._save_bio_model_serialize(
1417-
save_bio_model=save_bio_model,
1422+
body=body,
1423+
new_name=new_name,
1424+
sims_requiring_updates=sims_requiring_updates,
14181425
_request_auth=_request_auth,
14191426
_content_type=_content_type,
14201427
_headers=_headers,
@@ -1443,7 +1450,9 @@ def save_bio_model(
14431450
@validate_call
14441451
def save_bio_model_with_http_info(
14451452
self,
1446-
save_bio_model: Optional[SaveBioModel] = None,
1453+
body: Annotated[StrictStr, Field(description="BioModelVCML which will be saved.")],
1454+
new_name: Annotated[Optional[StrictStr], Field(description="Name to save new BioModel under. Leave blank if re-saving existing BioModel.")] = None,
1455+
sims_requiring_updates: Annotated[Optional[List[StrictStr]], Field(description="The name of simulations that will be prepared for future execution.")] = None,
14471456
_request_timeout: Union[
14481457
None,
14491458
Annotated[StrictFloat, Field(gt=0)],
@@ -1460,8 +1469,12 @@ def save_bio_model_with_http_info(
14601469
"""Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML.
14611470
14621471
1463-
:param save_bio_model:
1464-
:type save_bio_model: SaveBioModel
1472+
:param body: BioModelVCML which will be saved. (required)
1473+
:type body: str
1474+
:param new_name: Name to save new BioModel under. Leave blank if re-saving existing BioModel.
1475+
:type new_name: str
1476+
:param sims_requiring_updates: The name of simulations that will be prepared for future execution.
1477+
:type sims_requiring_updates: List[str]
14651478
:param _request_timeout: timeout setting for this request. If one
14661479
number provided, it will be total request
14671480
timeout. It can also be a pair (tuple) of
@@ -1485,7 +1498,9 @@ def save_bio_model_with_http_info(
14851498
""" # noqa: E501
14861499

14871500
_param = self._save_bio_model_serialize(
1488-
save_bio_model=save_bio_model,
1501+
body=body,
1502+
new_name=new_name,
1503+
sims_requiring_updates=sims_requiring_updates,
14891504
_request_auth=_request_auth,
14901505
_content_type=_content_type,
14911506
_headers=_headers,
@@ -1514,7 +1529,9 @@ def save_bio_model_with_http_info(
15141529
@validate_call
15151530
def save_bio_model_without_preload_content(
15161531
self,
1517-
save_bio_model: Optional[SaveBioModel] = None,
1532+
body: Annotated[StrictStr, Field(description="BioModelVCML which will be saved.")],
1533+
new_name: Annotated[Optional[StrictStr], Field(description="Name to save new BioModel under. Leave blank if re-saving existing BioModel.")] = None,
1534+
sims_requiring_updates: Annotated[Optional[List[StrictStr]], Field(description="The name of simulations that will be prepared for future execution.")] = None,
15181535
_request_timeout: Union[
15191536
None,
15201537
Annotated[StrictFloat, Field(gt=0)],
@@ -1531,8 +1548,12 @@ def save_bio_model_without_preload_content(
15311548
"""Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML.
15321549
15331550
1534-
:param save_bio_model:
1535-
:type save_bio_model: SaveBioModel
1551+
:param body: BioModelVCML which will be saved. (required)
1552+
:type body: str
1553+
:param new_name: Name to save new BioModel under. Leave blank if re-saving existing BioModel.
1554+
:type new_name: str
1555+
:param sims_requiring_updates: The name of simulations that will be prepared for future execution.
1556+
:type sims_requiring_updates: List[str]
15361557
:param _request_timeout: timeout setting for this request. If one
15371558
number provided, it will be total request
15381559
timeout. It can also be a pair (tuple) of
@@ -1556,7 +1577,9 @@ def save_bio_model_without_preload_content(
15561577
""" # noqa: E501
15571578

15581579
_param = self._save_bio_model_serialize(
1559-
save_bio_model=save_bio_model,
1580+
body=body,
1581+
new_name=new_name,
1582+
sims_requiring_updates=sims_requiring_updates,
15601583
_request_auth=_request_auth,
15611584
_content_type=_content_type,
15621585
_headers=_headers,
@@ -1580,7 +1603,9 @@ def save_bio_model_without_preload_content(
15801603

15811604
def _save_bio_model_serialize(
15821605
self,
1583-
save_bio_model,
1606+
body,
1607+
new_name,
1608+
sims_requiring_updates,
15841609
_request_auth,
15851610
_content_type,
15861611
_headers,
@@ -1591,6 +1616,7 @@ def _save_bio_model_serialize(
15911616

15921617
_collection_formats: Dict[str, str] = {
15931618

1619+
'simsRequiringUpdates': 'multi',
15941620
}
15951621

15961622
_path_params: Dict[str, str] = {}
@@ -1602,11 +1628,19 @@ def _save_bio_model_serialize(
16021628

16031629
# process the path parameters
16041630
# process the query parameters
1631+
if new_name is not None:
1632+
1633+
_query_params.append(('newName', new_name))
1634+
1635+
if sims_requiring_updates is not None:
1636+
1637+
_query_params.append(('simsRequiringUpdates', sims_requiring_updates))
1638+
16051639
# process the header parameters
16061640
# process the form parameters
16071641
# process the body parameter
1608-
if save_bio_model is not None:
1609-
_body_params = save_bio_model
1642+
if body is not None:
1643+
_body_params = body
16101644

16111645

16121646
# set the HTTP header `Accept`
@@ -1624,7 +1658,7 @@ def _save_bio_model_serialize(
16241658
_default_content_type = (
16251659
self.api_client.select_header_content_type(
16261660
[
1627-
'application/json'
1661+
'application/xml'
16281662
]
16291663
)
16301664
)

python-restclient/vcell_client/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
from vcell_client.models.origin import Origin
4646
from vcell_client.models.publication import Publication
4747
from vcell_client.models.publication_info import PublicationInfo
48-
from vcell_client.models.save_bio_model import SaveBioModel
4948
from vcell_client.models.scheduler_status import SchedulerStatus
5049
from vcell_client.models.simulation_execution_status_record import SimulationExecutionStatusRecord
5150
from vcell_client.models.simulation_job_status_record import SimulationJobStatusRecord

tools/openapi.yaml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,31 @@ paths:
189189
summary: Save's the given BioModel. Optional parameters of name and simulations
190190
to update due to math changes. Returns saved BioModel as VCML.
191191
operationId: saveBioModel
192+
parameters:
193+
- name: newName
194+
in: query
195+
description: Name to save new BioModel under. Leave blank if re-saving existing
196+
BioModel.
197+
required: false
198+
schema:
199+
type: string
200+
allowEmptyValue: true
201+
- name: simsRequiringUpdates
202+
in: query
203+
description: The name of simulations that will be prepared for future execution.
204+
required: false
205+
schema:
206+
type: array
207+
items:
208+
type: string
209+
allowEmptyValue: true
192210
requestBody:
211+
description: BioModelVCML which will be saved.
193212
content:
194-
application/json:
213+
application/xml:
195214
schema:
196-
$ref: '#/components/schemas/SaveBioModel'
215+
type: string
216+
required: true
197217
responses:
198218
"200":
199219
description: OK
@@ -1965,22 +1985,6 @@ components:
19651985
theHashCode:
19661986
format: int32
19671987
type: integer
1968-
SaveBioModel:
1969-
required:
1970-
- bioModelXML
1971-
type: object
1972-
properties:
1973-
bioModelXML:
1974-
pattern: \S
1975-
type: string
1976-
name:
1977-
type: string
1978-
nullable: true
1979-
simsRequiringUpdates:
1980-
type: array
1981-
items:
1982-
type: string
1983-
nullable: true
19841988
SchedulerStatus:
19851989
enum:
19861990
- WAITING

vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalUserMetaDbServerMessaging.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,9 @@ public BigString saveBioModel(BigString bioModelXML, String independentSims[]) t
889889
String savedBioModelXML = null;
890890
try {
891891
savedBioModelXML = vCellApiClient.getBioModelApi().saveBioModel(
892-
new SaveBioModel().bioModelXML(bioModelXML.toString())
893-
.simsRequiringUpdates(independentSims == null ? null : Arrays.asList(independentSims))
892+
bioModelXML.toString(),
893+
null,
894+
independentSims == null ? null : Arrays.asList(independentSims)
894895
);
895896
} catch (ApiException e) {
896897
ExceptionHandler.onlyDataAccessException(e);
@@ -909,9 +910,10 @@ public BigString saveBioModelAs(BigString bioModelXML, String newName, String in
909910
String savedBioModelXML = null;
910911
try {
911912
savedBioModelXML = vCellApiClient.getBioModelApi().saveBioModel(
912-
new SaveBioModel().bioModelXML(bioModelXML.toString())
913-
.name(newName)
914-
.simsRequiringUpdates(independentSims == null ? null : Arrays.asList(independentSims)));
913+
bioModelXML.toString(),
914+
newName,
915+
independentSims == null ? null : Arrays.asList(independentSims)
916+
);
915917
} catch (ApiException e) {
916918
ExceptionHandler.onlyDataAccessException(e);
917919
}

0 commit comments

Comments
 (0)