Skip to content

Commit 46a05e5

Browse files
bfec839996a4bcbefd3ac9f3a948e8cb7fa90349
1 parent 561b102 commit 46a05e5

File tree

9 files changed

+176
-4
lines changed

9 files changed

+176
-4
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ docs/StudyBase.md
7777
docs/StudyCommon.md
7878
docs/StudyList.md
7979
docs/StudyRequest.md
80+
docs/StudyRequestAllOf.md
8081
docs/StudyRequestRelationships.md
8182
docs/StudyRequestRelationshipsAnalyses.md
8283
docs/StudyReturn.md
@@ -185,6 +186,7 @@ neurostore_sdk/models/study_base.py
185186
neurostore_sdk/models/study_common.py
186187
neurostore_sdk/models/study_list.py
187188
neurostore_sdk/models/study_request.py
189+
neurostore_sdk/models/study_request_all_of.py
188190
neurostore_sdk/models/study_request_relationships.py
189191
neurostore_sdk/models/study_request_relationships_analyses.py
190192
neurostore_sdk/models/study_return.py
@@ -214,4 +216,5 @@ setup.cfg
214216
setup.py
215217
test-requirements.txt
216218
test/__init__.py
219+
test/test_study_request_all_of.py
217220
tox.ini

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Class | Method | HTTP request | Description
240240
- [StudyCommon](docs/StudyCommon.md)
241241
- [StudyList](docs/StudyList.md)
242242
- [StudyRequest](docs/StudyRequest.md)
243+
- [StudyRequestAllOf](docs/StudyRequestAllOf.md)
243244
- [StudyRequestRelationships](docs/StudyRequestRelationships.md)
244245
- [StudyRequestRelationshipsAnalyses](docs/StudyRequestRelationshipsAnalyses.md)
245246
- [StudyReturn](docs/StudyReturn.md)

docs/StudyRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# StudyRequest
22

33

4-
54
## Properties
65
Name | Type | Description | Notes
76
------------ | ------------- | ------------- | -------------
@@ -16,6 +15,7 @@ Name | Type | Description | Notes
1615
**analyses** | [**StudyRequestRelationshipsAnalyses**](StudyRequestRelationshipsAnalyses.md) | | [optional]
1716
**id** | **str** | short UUID specifying the location of this resource | [optional]
1817
**public** | **bool** | whether the resource is listed in public searches or not | [optional] [default to True]
18+
**pmcid** | **str** | | [optional]
1919

2020
## Example
2121

docs/StudyRequestAllOf.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# StudyRequestAllOf
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**pmcid** | **str** | | [optional]
8+
9+
## Example
10+
11+
```python
12+
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf
13+
14+
# TODO update the JSON string below
15+
json = "{}"
16+
# create an instance of StudyRequestAllOf from a JSON string
17+
study_request_all_of_instance = StudyRequestAllOf.from_json(json)
18+
# print the JSON string representation of the object
19+
print StudyRequestAllOf.to_json()
20+
21+
# convert the object into a dict
22+
study_request_all_of_dict = study_request_all_of_instance.to_dict()
23+
# create an instance of StudyRequestAllOf from a dict
24+
study_request_all_of_form_dict = study_request_all_of.from_dict(study_request_all_of_dict)
25+
```
26+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
27+
28+

neurostore_sdk/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
from neurostore_sdk.models.study_common import StudyCommon
108108
from neurostore_sdk.models.study_list import StudyList
109109
from neurostore_sdk.models.study_request import StudyRequest
110+
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf
110111
from neurostore_sdk.models.study_request_relationships import StudyRequestRelationships
111112
from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses
112113
from neurostore_sdk.models.study_return import StudyReturn

neurostore_sdk/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
from neurostore_sdk.models.study_common import StudyCommon
8282
from neurostore_sdk.models.study_list import StudyList
8383
from neurostore_sdk.models.study_request import StudyRequest
84+
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf
8485
from neurostore_sdk.models.study_request_relationships import StudyRequestRelationships
8586
from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses
8687
from neurostore_sdk.models.study_return import StudyReturn

neurostore_sdk/models/study_request.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class StudyRequest(BaseModel):
2727
"""
28-
28+
StudyRequest
2929
"""
3030
doi: Optional[StrictStr] = Field(None, description="Digital object identifier of the study.")
3131
name: Optional[StrictStr] = Field(None, description="Title of the study.")
@@ -38,7 +38,8 @@ class StudyRequest(BaseModel):
3838
analyses: Optional[StudyRequestRelationshipsAnalyses] = None
3939
id: Optional[constr(strict=True, max_length=12, min_length=12)] = Field(None, description="short UUID specifying the location of this resource")
4040
public: Optional[StrictBool] = Field(True, description="whether the resource is listed in public searches or not")
41-
__properties = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "analyses", "id", "public"]
41+
pmcid: Optional[StrictStr] = None
42+
__properties = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "analyses", "id", "public", "pmcid"]
4243

4344
class Config:
4445
"""Pydantic configuration"""
@@ -107,6 +108,11 @@ def to_dict(self):
107108
if self.year is None and "year" in self.__fields_set__:
108109
_dict['year'] = None
109110

111+
# set to None if pmcid (nullable) is None
112+
# and __fields_set__ contains the field
113+
if self.pmcid is None and "pmcid" in self.__fields_set__:
114+
_dict['pmcid'] = None
115+
110116
return _dict
111117

112118
@classmethod
@@ -129,7 +135,8 @@ def from_dict(cls, obj: dict) -> StudyRequest:
129135
"year": obj.get("year"),
130136
"analyses": StudyRequestRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None,
131137
"id": obj.get("id"),
132-
"public": obj.get("public") if obj.get("public") is not None else True
138+
"public": obj.get("public") if obj.get("public") is not None else True,
139+
"pmcid": obj.get("pmcid")
133140
})
134141
return _obj
135142

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# coding: utf-8
2+
3+
"""
4+
neurostore api
5+
6+
Create studysets for meta-analysis # noqa: E501
7+
8+
The version of the OpenAPI document: 1.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
"""
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
22+
from typing import Optional
23+
from pydantic import BaseModel, StrictStr
24+
25+
class StudyRequestAllOf(BaseModel):
26+
"""
27+
StudyRequestAllOf
28+
"""
29+
pmcid: Optional[StrictStr] = None
30+
__properties = ["pmcid"]
31+
32+
class Config:
33+
"""Pydantic configuration"""
34+
allow_population_by_field_name = True
35+
validate_assignment = True
36+
37+
def to_str(self) -> str:
38+
"""Returns the string representation of the model using alias"""
39+
return pprint.pformat(self.dict(by_alias=True))
40+
41+
def to_json(self) -> str:
42+
"""Returns the JSON representation of the model using alias"""
43+
return json.dumps(self.to_dict())
44+
45+
@classmethod
46+
def from_json(cls, json_str: str) -> StudyRequestAllOf:
47+
"""Create an instance of StudyRequestAllOf from a JSON string"""
48+
return cls.from_dict(json.loads(json_str))
49+
50+
def to_dict(self):
51+
"""Returns the dictionary representation of the model using alias"""
52+
_dict = self.dict(by_alias=True,
53+
exclude={
54+
},
55+
exclude_none=True)
56+
# set to None if pmcid (nullable) is None
57+
# and __fields_set__ contains the field
58+
if self.pmcid is None and "pmcid" in self.__fields_set__:
59+
_dict['pmcid'] = None
60+
61+
return _dict
62+
63+
@classmethod
64+
def from_dict(cls, obj: dict) -> StudyRequestAllOf:
65+
"""Create an instance of StudyRequestAllOf from a dict"""
66+
if obj is None:
67+
return None
68+
69+
if not isinstance(obj, dict):
70+
return StudyRequestAllOf.parse_obj(obj)
71+
72+
_obj = StudyRequestAllOf.parse_obj({
73+
"pmcid": obj.get("pmcid")
74+
})
75+
return _obj
76+

test/test_study_request_all_of.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# coding: utf-8
2+
3+
"""
4+
neurostore api
5+
6+
Create studysets for meta-analysis # noqa: E501
7+
8+
The version of the OpenAPI document: 1.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
"""
14+
15+
16+
import unittest
17+
import datetime
18+
19+
import neurostore_sdk
20+
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf # noqa: E501
21+
from neurostore_sdk.rest import ApiException
22+
23+
class TestStudyRequestAllOf(unittest.TestCase):
24+
"""StudyRequestAllOf unit test stubs"""
25+
26+
def setUp(self):
27+
pass
28+
29+
def tearDown(self):
30+
pass
31+
32+
def make_instance(self, include_optional):
33+
"""Test StudyRequestAllOf
34+
include_option is a boolean, when False only required
35+
params are included, when True both required and
36+
optional params are included """
37+
# uncomment below to create an instance of `StudyRequestAllOf`
38+
"""
39+
model = neurostore_sdk.models.study_request_all_of.StudyRequestAllOf() # noqa: E501
40+
if include_optional :
41+
return StudyRequestAllOf(
42+
pmcid = ''
43+
)
44+
else :
45+
return StudyRequestAllOf(
46+
)
47+
"""
48+
49+
def testStudyRequestAllOf(self):
50+
"""Test StudyRequestAllOf"""
51+
# inst_req_only = self.make_instance(include_optional=False)
52+
# inst_req_and_optional = self.make_instance(include_optional=True)
53+
54+
if __name__ == '__main__':
55+
unittest.main()

0 commit comments

Comments
 (0)