Skip to content

Commit b48070c

Browse files
63f99b39199d93a391f108e917b721212cd038aa
1 parent ee9e8cd commit b48070c

14 files changed

+313
-65
lines changed

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ docs/StudysetBase.md
102102
docs/StudysetList.md
103103
docs/StudysetRequest.md
104104
docs/StudysetRequestRelationships.md
105+
docs/StudysetRequestRelationshipsStudiesInner.md
106+
docs/StudysetRequestRelationshipsStudiesInnerOneOf.md
105107
docs/StudysetReturn.md
106108
docs/StudysetReturnRelationships.md
107109
docs/StudysetReturnRelationshipsStudies.md
@@ -227,6 +229,8 @@ neurostore_sdk/models/studyset_base.py
227229
neurostore_sdk/models/studyset_list.py
228230
neurostore_sdk/models/studyset_request.py
229231
neurostore_sdk/models/studyset_request_relationships.py
232+
neurostore_sdk/models/studyset_request_relationships_studies_inner.py
233+
neurostore_sdk/models/studyset_request_relationships_studies_inner_one_of.py
230234
neurostore_sdk/models/studyset_return.py
231235
neurostore_sdk/models/studyset_return_relationships.py
232236
neurostore_sdk/models/studyset_return_relationships_studies.py
@@ -247,4 +251,6 @@ setup.cfg
247251
setup.py
248252
test-requirements.txt
249253
test/__init__.py
254+
test/test_studyset_request_relationships_studies_inner.py
255+
test/test_studyset_request_relationships_studies_inner_one_of.py
250256
tox.ini

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ Class | Method | HTTP request | Description
306306
- [StudysetList](docs/StudysetList.md)
307307
- [StudysetRequest](docs/StudysetRequest.md)
308308
- [StudysetRequestRelationships](docs/StudysetRequestRelationships.md)
309+
- [StudysetRequestRelationshipsStudiesInner](docs/StudysetRequestRelationshipsStudiesInner.md)
310+
- [StudysetRequestRelationshipsStudiesInnerOneOf](docs/StudysetRequestRelationshipsStudiesInnerOneOf.md)
309311
- [StudysetReturn](docs/StudysetReturn.md)
310312
- [StudysetReturnRelationships](docs/StudysetReturnRelationships.md)
311313
- [StudysetReturnRelationshipsStudies](docs/StudysetReturnRelationshipsStudies.md)

docs/StudysetRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
1010
**publication** | **str** | The journal/source the studyset is connected to if the studyset was published. | [optional]
1111
**doi** | **str** | A DOI connected to the published studyset (may change to being automatically created so each studyset connected to a successful meta-analysis gets a DOI). | [optional]
1212
**pmid** | **str** | If the article connected to the studyset was published on PubMed, then link the ID here. | [optional]
13-
**studies** | **List[object]** | | [optional]
13+
**studies** | [**List[StudysetRequestRelationshipsStudiesInner]**](StudysetRequestRelationshipsStudiesInner.md) | Accepts study IDs or objects containing an ID and an optional curation stub UUID used to keep curation/extraction alignment. | [optional]
1414
**id** | **str** | short UUID specifying the location of this resource | [optional]
1515
**public** | **bool** | whether the resource is listed in public searches or not | [optional] [default to True]
1616
**level** | **str** | | [optional]

docs/StudysetRequestRelationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**studies** | **List[object]** | | [optional]
8+
**studies** | [**List[StudysetRequestRelationshipsStudiesInner]**](StudysetRequestRelationshipsStudiesInner.md) | Accepts study IDs or objects containing an ID and an optional curation stub UUID used to keep curation/extraction alignment. | [optional]
99

1010
## Example
1111

docs/StudysetRequestRelationshipsStudiesInner.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@
22

33

44
## Properties
5+
56
Name | Type | Description | Notes
67
------------ | ------------- | ------------- | -------------
7-
**doi** | **str** | Digital object identifier of the study. | [optional]
8-
**name** | **str** | Title of the study. | [optional]
9-
**metadata** | **object** | Metadata associated with the study not covered by the other study attributes. | [optional]
10-
**description** | **str** | Long form description of the study, typically the abstract. | [optional]
11-
**publication** | **str** | The journal/place of publication for the study. | [optional]
12-
**pmid** | **str** | If the study was published on PubMed, place the PubMed ID here. | [optional]
13-
**authors** | **str** | The authors on the publication of this study. | [optional]
14-
**year** | **int** | The year this study was published. | [optional]
15-
**analyses** | [**List[StudyRequestRelationshipsAnalysesInner]**](StudyRequestRelationshipsAnalysesInner.md) | | [optional]
16-
**id** | **str** | short UUID specifying the location of this resource | [optional]
17-
**public** | **bool** | whether the resource is listed in public searches or not | [optional] [default to True]
8+
**id** | **str** | |
9+
**curation_stub_uuid** | **str** | | [optional]
1810

1911
## Example
2012

@@ -26,12 +18,12 @@ json = "{}"
2618
# create an instance of StudysetRequestRelationshipsStudiesInner from a JSON string
2719
studyset_request_relationships_studies_inner_instance = StudysetRequestRelationshipsStudiesInner.from_json(json)
2820
# print the JSON string representation of the object
29-
print StudysetRequestRelationshipsStudiesInner.to_json()
21+
print(StudysetRequestRelationshipsStudiesInner.to_json())
3022

3123
# convert the object into a dict
3224
studyset_request_relationships_studies_inner_dict = studyset_request_relationships_studies_inner_instance.to_dict()
3325
# create an instance of StudysetRequestRelationshipsStudiesInner from a dict
34-
studyset_request_relationships_studies_inner_form_dict = studyset_request_relationships_studies_inner.from_dict(studyset_request_relationships_studies_inner_dict)
26+
studyset_request_relationships_studies_inner_from_dict = StudysetRequestRelationshipsStudiesInner.from_dict(studyset_request_relationships_studies_inner_dict)
3527
```
3628
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
3729

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

neurostore_sdk/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
from neurostore_sdk.models.studyset_list import StudysetList
134134
from neurostore_sdk.models.studyset_request import StudysetRequest
135135
from neurostore_sdk.models.studyset_request_relationships import StudysetRequestRelationships
136+
from neurostore_sdk.models.studyset_request_relationships_studies_inner import StudysetRequestRelationshipsStudiesInner
137+
from neurostore_sdk.models.studyset_request_relationships_studies_inner_one_of import StudysetRequestRelationshipsStudiesInnerOneOf
136138
from neurostore_sdk.models.studyset_return import StudysetReturn
137139
from neurostore_sdk.models.studyset_return_relationships import StudysetReturnRelationships
138140
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies

neurostore_sdk/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
from neurostore_sdk.models.studyset_list import StudysetList
104104
from neurostore_sdk.models.studyset_request import StudysetRequest
105105
from neurostore_sdk.models.studyset_request_relationships import StudysetRequestRelationships
106+
from neurostore_sdk.models.studyset_request_relationships_studies_inner import StudysetRequestRelationshipsStudiesInner
107+
from neurostore_sdk.models.studyset_request_relationships_studies_inner_one_of import StudysetRequestRelationshipsStudiesInnerOneOf
106108
from neurostore_sdk.models.studyset_return import StudysetReturn
107109
from neurostore_sdk.models.studyset_return_relationships import StudysetReturnRelationships
108110
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies

neurostore_sdk/models/studyset_request.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
2222
from typing import Any, ClassVar, Dict, List, Optional
2323
from typing_extensions import Annotated
24+
from neurostore_sdk.models.studyset_request_relationships_studies_inner import StudysetRequestRelationshipsStudiesInner
2425
from typing import Optional, Set
2526
from typing_extensions import Self
2627

@@ -33,7 +34,7 @@ class StudysetRequest(BaseModel):
3334
publication: Optional[StrictStr] = Field(default=None, description="The journal/source the studyset is connected to if the studyset was published.")
3435
doi: Optional[StrictStr] = Field(default=None, description="A DOI connected to the published studyset (may change to being automatically created so each studyset connected to a successful meta-analysis gets a DOI).")
3536
pmid: Optional[StrictStr] = Field(default=None, description="If the article connected to the studyset was published on PubMed, then link the ID here.")
36-
studies: Optional[List[Dict[str, Any]]] = None
37+
studies: Optional[List[StudysetRequestRelationshipsStudiesInner]] = Field(default=None, description="Accepts study IDs or objects containing an ID and an optional curation stub UUID used to keep curation/extraction alignment. ")
3738
id: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=30)]] = Field(default=None, description="short UUID specifying the location of this resource")
3839
public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not")
3940
level: Optional[StrictStr] = None
@@ -88,6 +89,13 @@ def to_dict(self) -> Dict[str, Any]:
8889
exclude=excluded_fields,
8990
exclude_none=True,
9091
)
92+
# override the default output from pydantic by calling `to_dict()` of each item in studies (list)
93+
_items = []
94+
if self.studies:
95+
for _item_studies in self.studies:
96+
if _item_studies:
97+
_items.append(_item_studies.to_dict())
98+
_dict['studies'] = _items
9199
# set to None if name (nullable) is None
92100
# and model_fields_set contains the field
93101
if self.name is None and "name" in self.model_fields_set:
@@ -130,7 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
130138
"publication": obj.get("publication"),
131139
"doi": obj.get("doi"),
132140
"pmid": obj.get("pmid"),
133-
"studies": obj.get("studies"),
141+
"studies": [StudysetRequestRelationshipsStudiesInner.from_dict(_item) for _item in obj["studies"]] if obj.get("studies") is not None else None,
134142
"id": obj.get("id"),
135143
"public": obj.get("public") if obj.get("public") is not None else True,
136144
"level": obj.get("level")

neurostore_sdk/models/studyset_request_relationships.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
import re # noqa: F401
1919
import json
2020

21-
from pydantic import BaseModel, ConfigDict
21+
from pydantic import BaseModel, ConfigDict, Field
2222
from typing import Any, ClassVar, Dict, List, Optional
23+
from neurostore_sdk.models.studyset_request_relationships_studies_inner import StudysetRequestRelationshipsStudiesInner
2324
from typing import Optional, Set
2425
from typing_extensions import Self
2526

2627
class StudysetRequestRelationships(BaseModel):
2728
"""
2829
StudysetRequestRelationships
2930
""" # noqa: E501
30-
studies: Optional[List[Any]] = None
31+
studies: Optional[List[StudysetRequestRelationshipsStudiesInner]] = Field(default=None, description="Accepts study IDs or objects containing an ID and an optional curation stub UUID used to keep curation/extraction alignment. ")
3132
__properties: ClassVar[List[str]] = ["studies"]
3233

3334
model_config = ConfigDict(
@@ -69,6 +70,13 @@ def to_dict(self) -> Dict[str, Any]:
6970
exclude=excluded_fields,
7071
exclude_none=True,
7172
)
73+
# override the default output from pydantic by calling `to_dict()` of each item in studies (list)
74+
_items = []
75+
if self.studies:
76+
for _item_studies in self.studies:
77+
if _item_studies:
78+
_items.append(_item_studies.to_dict())
79+
_dict['studies'] = _items
7280
return _dict
7381

7482
@classmethod
@@ -81,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8189
return cls.model_validate(obj)
8290

8391
_obj = cls.model_validate({
84-
"studies": obj.get("studies")
92+
"studies": [StudysetRequestRelationshipsStudiesInner.from_dict(_item) for _item in obj["studies"]] if obj.get("studies") is not None else None
8593
})
8694
return _obj
8795

0 commit comments

Comments
 (0)