Skip to content

Commit 78cf8a0

Browse files
57669eaff2f3e281c8b84ef48f65c1e9be658331
1 parent f3adf36 commit 78cf8a0

11 files changed

+211
-4
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ docs/StudysetRequestRelationshipsStudiesInnerAnyOf.md
106106
docs/StudysetReturn.md
107107
docs/StudysetReturnRelationships.md
108108
docs/StudysetReturnRelationshipsStudies.md
109+
docs/StudysetReturnRelationshipsStudysetStudiesInner.md
109110
docs/StudysetsApi.md
110111
docs/TableCommon.md
111112
docs/TableList.md
@@ -232,6 +233,7 @@ neurostore_sdk/models/studyset_request_relationships_studies_inner_any_of.py
232233
neurostore_sdk/models/studyset_return.py
233234
neurostore_sdk/models/studyset_return_relationships.py
234235
neurostore_sdk/models/studyset_return_relationships_studies.py
236+
neurostore_sdk/models/studyset_return_relationships_studyset_studies_inner.py
235237
neurostore_sdk/models/table_common.py
236238
neurostore_sdk/models/table_list.py
237239
neurostore_sdk/models/table_request.py
@@ -249,5 +251,5 @@ setup.cfg
249251
setup.py
250252
test-requirements.txt
251253
test/__init__.py
252-
test/test_studyset_request_relationships_studies_inner_any_of.py
254+
test/test_studyset_return_relationships_studyset_studies_inner.py
253255
tox.ini

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ Class | Method | HTTP request | Description
310310
- [StudysetReturn](docs/StudysetReturn.md)
311311
- [StudysetReturnRelationships](docs/StudysetReturnRelationships.md)
312312
- [StudysetReturnRelationshipsStudies](docs/StudysetReturnRelationshipsStudies.md)
313+
- [StudysetReturnRelationshipsStudysetStudiesInner](docs/StudysetReturnRelationshipsStudysetStudiesInner.md)
313314
- [TableCommon](docs/TableCommon.md)
314315
- [TableList](docs/TableList.md)
315316
- [TableRequest](docs/TableRequest.md)

docs/StudysetReturn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Name | Type | Description | Notes
1919
**source** | **str** | | [optional]
2020
**source_id** | **str** | | [optional]
2121
**source_updated_at** | **str** | | [optional] [readonly]
22+
**studyset_studies** | [**List[StudysetReturnRelationshipsStudysetStudiesInner]**](StudysetReturnRelationshipsStudysetStudiesInner.md) | Association records for studies in this studyset (includes stub UUIDs for mapping). | [optional]
2223
**studies** | [**StudysetReturnRelationshipsStudies**](StudysetReturnRelationshipsStudies.md) | | [optional]
2324
**level** | **str** | | [optional]
2425

docs/StudysetReturnRelationships.md

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

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8+
**studyset_studies** | [**List[StudysetReturnRelationshipsStudysetStudiesInner]**](StudysetReturnRelationshipsStudysetStudiesInner.md) | Association records for studies in this studyset (includes stub UUIDs for mapping). | [optional]
89
**studies** | [**StudysetReturnRelationshipsStudies**](StudysetReturnRelationshipsStudies.md) | | [optional]
910

1011
## Example
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# StudysetReturnRelationshipsStudysetStudiesInner
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**id** | **str** | | [optional]
9+
**curation_stub_uuid** | **str** | | [optional]
10+
11+
## Example
12+
13+
```python
14+
from neurostore_sdk.models.studyset_return_relationships_studyset_studies_inner import StudysetReturnRelationshipsStudysetStudiesInner
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of StudysetReturnRelationshipsStudysetStudiesInner from a JSON string
19+
studyset_return_relationships_studyset_studies_inner_instance = StudysetReturnRelationshipsStudysetStudiesInner.from_json(json)
20+
# print the JSON string representation of the object
21+
print(StudysetReturnRelationshipsStudysetStudiesInner.to_json())
22+
23+
# convert the object into a dict
24+
studyset_return_relationships_studyset_studies_inner_dict = studyset_return_relationships_studyset_studies_inner_instance.to_dict()
25+
# create an instance of StudysetReturnRelationshipsStudysetStudiesInner from a dict
26+
studyset_return_relationships_studyset_studies_inner_from_dict = StudysetReturnRelationshipsStudysetStudiesInner.from_dict(studyset_return_relationships_studyset_studies_inner_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
@@ -134,6 +134,7 @@
134134
"StudysetReturn",
135135
"StudysetReturnRelationships",
136136
"StudysetReturnRelationshipsStudies",
137+
"StudysetReturnRelationshipsStudysetStudiesInner",
137138
"TableCommon",
138139
"TableList",
139140
"TableRequest",
@@ -265,6 +266,7 @@
265266
from neurostore_sdk.models.studyset_return import StudysetReturn as StudysetReturn
266267
from neurostore_sdk.models.studyset_return_relationships import StudysetReturnRelationships as StudysetReturnRelationships
267268
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies as StudysetReturnRelationshipsStudies
269+
from neurostore_sdk.models.studyset_return_relationships_studyset_studies_inner import StudysetReturnRelationshipsStudysetStudiesInner as StudysetReturnRelationshipsStudysetStudiesInner
268270
from neurostore_sdk.models.table_common import TableCommon as TableCommon
269271
from neurostore_sdk.models.table_list import TableList as TableList
270272
from neurostore_sdk.models.table_request import TableRequest as TableRequest

neurostore_sdk/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
from neurostore_sdk.models.studyset_return import StudysetReturn
107107
from neurostore_sdk.models.studyset_return_relationships import StudysetReturnRelationships
108108
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies
109+
from neurostore_sdk.models.studyset_return_relationships_studyset_studies_inner import StudysetReturnRelationshipsStudysetStudiesInner
109110
from neurostore_sdk.models.table_common import TableCommon
110111
from neurostore_sdk.models.table_list import TableList
111112
from neurostore_sdk.models.table_request import TableRequest

neurostore_sdk/models/studyset_return.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from typing import Any, ClassVar, Dict, List, Optional
2424
from typing_extensions import Annotated
2525
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies
26+
from neurostore_sdk.models.studyset_return_relationships_studyset_studies_inner import StudysetReturnRelationshipsStudysetStudiesInner
2627
from typing import Optional, Set
2728
from typing_extensions import Self
2829

@@ -44,9 +45,10 @@ class StudysetReturn(BaseModel):
4445
source: Optional[StrictStr] = None
4546
source_id: Optional[StrictStr] = None
4647
source_updated_at: Optional[StrictStr] = None
48+
studyset_studies: Optional[List[StudysetReturnRelationshipsStudysetStudiesInner]] = Field(default=None, description="Association records for studies in this studyset (includes stub UUIDs for mapping).")
4749
studies: Optional[StudysetReturnRelationshipsStudies] = None
4850
level: Optional[StrictStr] = None
49-
__properties: ClassVar[List[str]] = ["name", "description", "publication", "doi", "pmid", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "studies", "level"]
51+
__properties: ClassVar[List[str]] = ["name", "description", "publication", "doi", "pmid", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "studyset_studies", "studies", "level"]
5052

5153
@field_validator('level')
5254
def level_validate_enum(cls, value):
@@ -105,6 +107,13 @@ def to_dict(self) -> Dict[str, Any]:
105107
exclude=excluded_fields,
106108
exclude_none=True,
107109
)
110+
# override the default output from pydantic by calling `to_dict()` of each item in studyset_studies (list)
111+
_items = []
112+
if self.studyset_studies:
113+
for _item_studyset_studies in self.studyset_studies:
114+
if _item_studyset_studies:
115+
_items.append(_item_studyset_studies.to_dict())
116+
_dict['studyset_studies'] = _items
108117
# override the default output from pydantic by calling `to_dict()` of studies
109118
if self.studies:
110119
_dict['studies'] = self.studies.to_dict()
@@ -189,6 +198,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
189198
"source": obj.get("source"),
190199
"source_id": obj.get("source_id"),
191200
"source_updated_at": obj.get("source_updated_at"),
201+
"studyset_studies": [StudysetReturnRelationshipsStudysetStudiesInner.from_dict(_item) for _item in obj["studyset_studies"]] if obj.get("studyset_studies") is not None else None,
192202
"studies": StudysetReturnRelationshipsStudies.from_dict(obj["studies"]) if obj.get("studies") is not None else None,
193203
"level": obj.get("level")
194204
})

neurostore_sdk/models/studyset_return_relationships.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@
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
2323
from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies
24+
from neurostore_sdk.models.studyset_return_relationships_studyset_studies_inner import StudysetReturnRelationshipsStudysetStudiesInner
2425
from typing import Optional, Set
2526
from typing_extensions import Self
2627

2728
class StudysetReturnRelationships(BaseModel):
2829
"""
2930
StudysetReturnRelationships
3031
""" # noqa: E501
32+
studyset_studies: Optional[List[StudysetReturnRelationshipsStudysetStudiesInner]] = Field(default=None, description="Association records for studies in this studyset (includes stub UUIDs for mapping).")
3133
studies: Optional[StudysetReturnRelationshipsStudies] = None
32-
__properties: ClassVar[List[str]] = ["studies"]
34+
__properties: ClassVar[List[str]] = ["studyset_studies", "studies"]
3335

3436
model_config = ConfigDict(
3537
populate_by_name=True,
@@ -70,6 +72,13 @@ def to_dict(self) -> Dict[str, Any]:
7072
exclude=excluded_fields,
7173
exclude_none=True,
7274
)
75+
# override the default output from pydantic by calling `to_dict()` of each item in studyset_studies (list)
76+
_items = []
77+
if self.studyset_studies:
78+
for _item_studyset_studies in self.studyset_studies:
79+
if _item_studyset_studies:
80+
_items.append(_item_studyset_studies.to_dict())
81+
_dict['studyset_studies'] = _items
7382
# override the default output from pydantic by calling `to_dict()` of studies
7483
if self.studies:
7584
_dict['studies'] = self.studies.to_dict()
@@ -85,6 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8594
return cls.model_validate(obj)
8695

8796
_obj = cls.model_validate({
97+
"studyset_studies": [StudysetReturnRelationshipsStudysetStudiesInner.from_dict(_item) for _item in obj["studyset_studies"]] if obj.get("studyset_studies") is not None else None,
8898
"studies": StudysetReturnRelationshipsStudies.from_dict(obj["studies"]) if obj.get("studies") is not None else None
8999
})
90100
return _obj
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# coding: utf-8
2+
3+
"""
4+
neurostore api
5+
6+
Create studysets for meta-analysis
7+
8+
The version of the OpenAPI document: 1.0
9+
Contact: jamesdkent21@gmail.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import BaseModel, ConfigDict, StrictStr
22+
from typing import Any, ClassVar, Dict, List, Optional
23+
from uuid import UUID
24+
from typing import Optional, Set
25+
from typing_extensions import Self
26+
27+
class StudysetReturnRelationshipsStudysetStudiesInner(BaseModel):
28+
"""
29+
StudysetReturnRelationshipsStudysetStudiesInner
30+
""" # noqa: E501
31+
id: Optional[StrictStr] = None
32+
curation_stub_uuid: Optional[UUID] = None
33+
__properties: ClassVar[List[str]] = ["id", "curation_stub_uuid"]
34+
35+
model_config = ConfigDict(
36+
populate_by_name=True,
37+
validate_assignment=True,
38+
protected_namespaces=(),
39+
)
40+
41+
42+
def to_str(self) -> str:
43+
"""Returns the string representation of the model using alias"""
44+
return pprint.pformat(self.model_dump(by_alias=True))
45+
46+
def to_json(self) -> str:
47+
"""Returns the JSON representation of the model using alias"""
48+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49+
return json.dumps(self.to_dict())
50+
51+
@classmethod
52+
def from_json(cls, json_str: str) -> Optional[Self]:
53+
"""Create an instance of StudysetReturnRelationshipsStudysetStudiesInner from a JSON string"""
54+
return cls.from_dict(json.loads(json_str))
55+
56+
def to_dict(self) -> Dict[str, Any]:
57+
"""Return the dictionary representation of the model using alias.
58+
59+
This has the following differences from calling pydantic's
60+
`self.model_dump(by_alias=True)`:
61+
62+
* `None` is only added to the output dict for nullable fields that
63+
were set at model initialization. Other fields with value `None`
64+
are ignored.
65+
"""
66+
excluded_fields: Set[str] = set([
67+
])
68+
69+
_dict = self.model_dump(
70+
by_alias=True,
71+
exclude=excluded_fields,
72+
exclude_none=True,
73+
)
74+
# set to None if curation_stub_uuid (nullable) is None
75+
# and model_fields_set contains the field
76+
if self.curation_stub_uuid is None and "curation_stub_uuid" in self.model_fields_set:
77+
_dict['curation_stub_uuid'] = None
78+
79+
return _dict
80+
81+
@classmethod
82+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83+
"""Create an instance of StudysetReturnRelationshipsStudysetStudiesInner from a dict"""
84+
if obj is None:
85+
return None
86+
87+
if not isinstance(obj, dict):
88+
return cls.model_validate(obj)
89+
90+
_obj = cls.model_validate({
91+
"id": obj.get("id"),
92+
"curation_stub_uuid": obj.get("curation_stub_uuid")
93+
})
94+
return _obj
95+
96+

0 commit comments

Comments
 (0)