Skip to content

Commit 16381cf

Browse files
Update BioModel and MathModel Endpoints
Default booleans of true for summary retrieval, and updated descriptions.
1 parent d993bf9 commit 16381cf

17 files changed

Lines changed: 78 additions & 49 deletions

File tree

python-restclient/docs/BioModelResourceApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ configuration = vcell_client.Configuration(
171171
with vcell_client.ApiClient(configuration) as api_client:
172172
# Create an instance of the API class
173173
api_instance = vcell_client.BioModelResourceApi(api_client)
174-
include_public_and_shared = True # bool | Includes BioModel summaries that are public or shared with requester. (optional)
174+
include_public_and_shared = True # bool | Includes BioModel summaries that are public or shared with requester. Default is true. (optional)
175175

176176
try:
177177
# Return BioModel summaries.
@@ -188,7 +188,7 @@ with vcell_client.ApiClient(configuration) as api_client:
188188

189189
Name | Type | Description | Notes
190190
------------- | ------------- | ------------- | -------------
191-
**include_public_and_shared** | **bool**| Includes BioModel summaries that are public or shared with requester. | [optional]
191+
**include_public_and_shared** | **bool**| Includes BioModel summaries that are public or shared with requester. Default is true. | [optional]
192192

193193
### Return type
194194

python-restclient/docs/MathModelResourceApi.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Method | HTTP request | Description
1616
1717

1818

19+
Remove specific Math Model.
20+
1921
### Example
2022

2123
```python
@@ -104,7 +106,7 @@ configuration = vcell_client.Configuration(
104106
with vcell_client.ApiClient(configuration) as api_client:
105107
# Create an instance of the API class
106108
api_instance = vcell_client.MathModelResourceApi(api_client)
107-
include_public_and_shared = True # bool | Include MathModel summaries that are public and shared with the requester. (optional)
109+
include_public_and_shared = True # bool | Include MathModel summaries that are public and shared with the requester. Default is true. (optional)
108110

109111
try:
110112
api_response = api_instance.get_summaries(include_public_and_shared=include_public_and_shared)
@@ -120,7 +122,7 @@ with vcell_client.ApiClient(configuration) as api_client:
120122

121123
Name | Type | Description | Notes
122124
------------- | ------------- | ------------- | -------------
123-
**include_public_and_shared** | **bool**| Include MathModel summaries that are public and shared with the requester. | [optional]
125+
**include_public_and_shared** | **bool**| Include MathModel summaries that are public and shared with the requester. Default is true. | [optional]
124126

125127
### Return type
126128

@@ -217,6 +219,8 @@ No authorization required
217219
218220

219221

222+
Returns MathModel in VCML format.
223+
220224
### Example
221225

222226
```python

python-restclient/examples/scratch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from vcell_client import Publication, HelloWorldMessage, BioModel, FieldDataResourceApi
2+
from vcell_client import Publication, HelloWorldMessage, BioModel, FieldDataResourceApi, MathModelResourceApi
33
from vcell_client.api.publication_resource_api import PublicationResourceApi
44
from datetime import date
55
import pandas as pd # for pretty printing only
@@ -55,6 +55,7 @@
5555
print(f"final publications: {final_pubs}")
5656

5757
BioModelResourceApi(api_client).save_bio_model("")
58+
MathModelResourceApi(api_client).get_summaries()
5859

5960
field = FieldDataResourceApi(api_client)
6061

python-restclient/vcell_client/api/bio_model_resource_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ def _get_bio_model_serialize(
576576
@validate_call
577577
def get_bio_model_summaries(
578578
self,
579-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester.")] = None,
579+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester. Default is true.")] = None,
580580
_request_timeout: Union[
581581
None,
582582
Annotated[StrictFloat, Field(gt=0)],
@@ -593,7 +593,7 @@ def get_bio_model_summaries(
593593
"""Return BioModel summaries.
594594
595595
596-
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester.
596+
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester. Default is true.
597597
:type include_public_and_shared: bool
598598
:param _request_timeout: timeout setting for this request. If one
599599
number provided, it will be total request
@@ -644,7 +644,7 @@ def get_bio_model_summaries(
644644
@validate_call
645645
def get_bio_model_summaries_with_http_info(
646646
self,
647-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester.")] = None,
647+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester. Default is true.")] = None,
648648
_request_timeout: Union[
649649
None,
650650
Annotated[StrictFloat, Field(gt=0)],
@@ -661,7 +661,7 @@ def get_bio_model_summaries_with_http_info(
661661
"""Return BioModel summaries.
662662
663663
664-
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester.
664+
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester. Default is true.
665665
:type include_public_and_shared: bool
666666
:param _request_timeout: timeout setting for this request. If one
667667
number provided, it will be total request
@@ -712,7 +712,7 @@ def get_bio_model_summaries_with_http_info(
712712
@validate_call
713713
def get_bio_model_summaries_without_preload_content(
714714
self,
715-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester.")] = None,
715+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Includes BioModel summaries that are public or shared with requester. Default is true.")] = None,
716716
_request_timeout: Union[
717717
None,
718718
Annotated[StrictFloat, Field(gt=0)],
@@ -729,7 +729,7 @@ def get_bio_model_summaries_without_preload_content(
729729
"""Return BioModel summaries.
730730
731731
732-
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester.
732+
:param include_public_and_shared: Includes BioModel summaries that are public or shared with requester. Default is true.
733733
:type include_public_and_shared: bool
734734
:param _request_timeout: timeout setting for this request. If one
735735
number provided, it will be total request

python-restclient/vcell_client/api/math_model_resource_api.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def delete_math_model(
6969
) -> None:
7070
"""delete_math_model
7171
72+
Remove specific Math Model.
7273
7374
:param id: (required)
7475
:type id: str
@@ -135,6 +136,7 @@ def delete_math_model_with_http_info(
135136
) -> ApiResponse[None]:
136137
"""delete_math_model
137138
139+
Remove specific Math Model.
138140
139141
:param id: (required)
140142
:type id: str
@@ -201,6 +203,7 @@ def delete_math_model_without_preload_content(
201203
) -> RESTResponseType:
202204
"""delete_math_model
203205
206+
Remove specific Math Model.
204207
205208
:param id: (required)
206209
:type id: str
@@ -308,7 +311,7 @@ def _delete_math_model_serialize(
308311
@validate_call
309312
def get_summaries(
310313
self,
311-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester.")] = None,
314+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester. Default is true.")] = None,
312315
_request_timeout: Union[
313316
None,
314317
Annotated[StrictFloat, Field(gt=0)],
@@ -326,7 +329,7 @@ def get_summaries(
326329
327330
Return MathModel summaries.
328331
329-
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester.
332+
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester. Default is true.
330333
:type include_public_and_shared: bool
331334
:param _request_timeout: timeout setting for this request. If one
332335
number provided, it will be total request
@@ -377,7 +380,7 @@ def get_summaries(
377380
@validate_call
378381
def get_summaries_with_http_info(
379382
self,
380-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester.")] = None,
383+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester. Default is true.")] = None,
381384
_request_timeout: Union[
382385
None,
383386
Annotated[StrictFloat, Field(gt=0)],
@@ -395,7 +398,7 @@ def get_summaries_with_http_info(
395398
396399
Return MathModel summaries.
397400
398-
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester.
401+
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester. Default is true.
399402
:type include_public_and_shared: bool
400403
:param _request_timeout: timeout setting for this request. If one
401404
number provided, it will be total request
@@ -446,7 +449,7 @@ def get_summaries_with_http_info(
446449
@validate_call
447450
def get_summaries_without_preload_content(
448451
self,
449-
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester.")] = None,
452+
include_public_and_shared: Annotated[Optional[StrictBool], Field(description="Include MathModel summaries that are public and shared with the requester. Default is true.")] = None,
450453
_request_timeout: Union[
451454
None,
452455
Annotated[StrictFloat, Field(gt=0)],
@@ -464,7 +467,7 @@ def get_summaries_without_preload_content(
464467
465468
Return MathModel summaries.
466469
467-
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester.
470+
:param include_public_and_shared: Include MathModel summaries that are public and shared with the requester. Default is true.
468471
:type include_public_and_shared: bool
469472
:param _request_timeout: timeout setting for this request. If one
470473
number provided, it will be total request
@@ -860,6 +863,7 @@ def get_vcml(
860863
) -> str:
861864
"""get_vcml
862865
866+
Returns MathModel in VCML format.
863867
864868
:param id: (required)
865869
:type id: str
@@ -930,6 +934,7 @@ def get_vcml_with_http_info(
930934
) -> ApiResponse[str]:
931935
"""get_vcml
932936
937+
Returns MathModel in VCML format.
933938
934939
:param id: (required)
935940
:type id: str
@@ -1000,6 +1005,7 @@ def get_vcml_without_preload_content(
10001005
) -> RESTResponseType:
10011006
"""get_vcml
10021007
1008+
Returns MathModel in VCML format.
10031009
10041010
:param id: (required)
10051011
:type id: str

tools/openapi.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ paths:
254254
- name: includePublicAndShared
255255
in: query
256256
description: Includes BioModel summaries that are public or shared with requester.
257+
Default is true.
258+
required: false
257259
schema:
258260
type: boolean
259261
responses:
@@ -924,7 +926,8 @@ paths:
924926
- name: includePublicAndShared
925927
in: query
926928
description: Include MathModel summaries that are public and shared with the
927-
requester.
929+
requester. Default is true.
930+
required: false
928931
schema:
929932
type: boolean
930933
responses:
@@ -984,6 +987,7 @@ paths:
984987
get:
985988
tags:
986989
- Math Model Resource
990+
description: Returns MathModel in VCML format.
987991
operationId: getVCML
988992
parameters:
989993
- name: id
@@ -1019,6 +1023,7 @@ paths:
10191023
delete:
10201024
tags:
10211025
- Math Model Resource
1026+
description: Remove specific Math Model.
10221027
operationId: deleteMathModel
10231028
parameters:
10241029
- name: id

vcell-rest/src/main/java/org/vcell/restq/handlers/BioModelResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ public BioModelSummary getBioModelContext(@PathParam("bioModelID") String bioMod
8585
@Operation(operationId = "getBioModelSummaries", summary = "Return BioModel summaries.")
8686
@Produces(MediaType.APPLICATION_JSON)
8787
public BioModelSummary[] getBioModelContexts(
88-
@Parameter(description = "Includes BioModel summaries that are public or shared with requester.")
89-
@QueryParam("includePublicAndShared") boolean includePublicAndShared) throws DataAccessWebException {
88+
@Parameter(description = "Includes BioModel summaries that are public or shared with requester. Default is true.")
89+
@QueryParam("includePublicAndShared") Optional<Boolean> includePublicAndShared) throws DataAccessWebException {
9090
try{
9191
User vcellUser = userRestService.getUserOrAnonymousFromIdentity(securityIdentity);
92-
BioModelInfo[] infos = bioModelRestService.getBioModelInfos(vcellUser, includePublicAndShared);
92+
BioModelInfo[] infos = bioModelRestService.getBioModelInfos(vcellUser, includePublicAndShared.orElse(true));
9393
BioModelSummary[] contexts = new BioModelSummary[infos.length];
9494
for (int i = 0; i < infos.length; i ++){
9595
contexts[i] = new BioModelSummary(infos[i].getVersion(), infos[i].getBioModelChildSummary(), infos[i].getPublicationInfos(), infos[i].getSoftwareVersion());

vcell-rest/src/main/java/org/vcell/restq/handlers/MathModelResource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class MathModelResource {
3737

3838
@DELETE
3939
@Path("/{id}")
40-
@Operation(operationId = "deleteMathModel")
40+
@Operation(operationId = "deleteMathModel", description = "Remove specific Math Model.")
4141
public void deleteMathModel(@PathParam("id") String id) throws DataAccessWebException, NotAuthenticatedWebException, NotFoundWebException, PermissionWebException {
4242
User user = userRestService.getUserFromIdentity(securityIdentity);
4343
try{
@@ -54,7 +54,7 @@ public void deleteMathModel(@PathParam("id") String id) throws DataAccessWebExce
5454
@GET
5555
@Produces({MediaType.APPLICATION_XML})
5656
@Path("/{id}")
57-
@Operation(operationId = "getVCML")
57+
@Operation(operationId = "getVCML", description = "Returns MathModel in VCML format.")
5858
public String getMathModel(@PathParam("id") String id) throws DataAccessWebException, NotFoundWebException, PermissionWebException {
5959
User user = userRestService.getUserOrAnonymousFromIdentity(securityIdentity);
6060
try{
@@ -96,11 +96,11 @@ public MathModelSummary getMathModelSummary(@PathParam("id") String id) throws D
9696
@Produces(MediaType.APPLICATION_JSON)
9797
@Operation(operationId = "getSummaries", description = "Return MathModel summaries.")
9898
public List<MathModelSummary> getMathModelSummaries(
99-
@Parameter(description = "Include MathModel summaries that are public and shared with the requester.")
100-
@QueryParam("includePublicAndShared") boolean includePublicAndShared) throws DataAccessWebException, ObjectNotFoundException {
99+
@Parameter(required = false, description = "Include MathModel summaries that are public and shared with the requester. Default is true.")
100+
@QueryParam("includePublicAndShared") Optional<Boolean> includePublicAndShared) throws DataAccessWebException, ObjectNotFoundException {
101101
User user = userRestService.getUserOrAnonymousFromIdentity(securityIdentity);
102102
try{
103-
MathModelInfo[] infos = mathModelService.getMathModelInfos(user, includePublicAndShared);
103+
MathModelInfo[] infos = mathModelService.getMathModelInfos(user, includePublicAndShared.orElse(true));
104104
ArrayList<MathModelSummary> summaries = new ArrayList<>();
105105
for (MathModelInfo info : infos) {
106106
MathModelChildSummary childSummary = info.getMathModelChildSummary();

vcell-restclient/api/openapi.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ paths:
270270
operationId: getBioModelSummaries
271271
parameters:
272272
- description: Includes BioModel summaries that are public or shared with requester.
273+
Default is true.
273274
explode: true
274275
in: query
275276
name: includePublicAndShared
@@ -949,7 +950,7 @@ paths:
949950
operationId: getSummaries
950951
parameters:
951952
- description: Include MathModel summaries that are public and shared with the
952-
requester.
953+
requester. Default is true.
953954
explode: true
954955
in: query
955956
name: includePublicAndShared
@@ -1018,6 +1019,7 @@ paths:
10181019
x-accepts: application/json
10191020
/api/v1/mathModel/{id}:
10201021
delete:
1022+
description: Remove specific Math Model.
10211023
operationId: deleteMathModel
10221024
parameters:
10231025
- explode: false
@@ -1058,6 +1060,7 @@ paths:
10581060
- Math Model Resource
10591061
x-accepts: application/json
10601062
get:
1063+
description: Returns MathModel in VCML format.
10611064
operationId: getVCML
10621065
parameters:
10631066
- explode: false

vcell-restclient/docs/BioModelResourceApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public class Example {
311311
defaultClient.setBasePath("https://vcell.cam.uchc.edu");
312312

313313
BioModelResourceApi apiInstance = new BioModelResourceApi(defaultClient);
314-
Boolean includePublicAndShared = true; // Boolean | Includes BioModel summaries that are public or shared with requester.
314+
Boolean includePublicAndShared = true; // Boolean | Includes BioModel summaries that are public or shared with requester. Default is true.
315315
try {
316316
List<BioModelSummary> result = apiInstance.getBioModelSummaries(includePublicAndShared);
317317
System.out.println(result);
@@ -331,7 +331,7 @@ public class Example {
331331

332332
| Name | Type | Description | Notes |
333333
|------------- | ------------- | ------------- | -------------|
334-
| **includePublicAndShared** | **Boolean**| Includes BioModel summaries that are public or shared with requester. | [optional] |
334+
| **includePublicAndShared** | **Boolean**| Includes BioModel summaries that are public or shared with requester. Default is true. | [optional] |
335335

336336
### Return type
337337

@@ -376,7 +376,7 @@ public class Example {
376376
defaultClient.setBasePath("https://vcell.cam.uchc.edu");
377377

378378
BioModelResourceApi apiInstance = new BioModelResourceApi(defaultClient);
379-
Boolean includePublicAndShared = true; // Boolean | Includes BioModel summaries that are public or shared with requester.
379+
Boolean includePublicAndShared = true; // Boolean | Includes BioModel summaries that are public or shared with requester. Default is true.
380380
try {
381381
ApiResponse<List<BioModelSummary>> response = apiInstance.getBioModelSummariesWithHttpInfo(includePublicAndShared);
382382
System.out.println("Status code: " + response.getStatusCode());
@@ -398,7 +398,7 @@ public class Example {
398398

399399
| Name | Type | Description | Notes |
400400
|------------- | ------------- | ------------- | -------------|
401-
| **includePublicAndShared** | **Boolean**| Includes BioModel summaries that are public or shared with requester. | [optional] |
401+
| **includePublicAndShared** | **Boolean**| Includes BioModel summaries that are public or shared with requester. Default is true. | [optional] |
402402

403403
### Return type
404404

0 commit comments

Comments
 (0)