Skip to content

Commit cc7dcef

Browse files
7dbd3b64084130ae479f0d95daa659220d54fce7
1 parent b238af5 commit cc7dcef

119 files changed

Lines changed: 262 additions & 376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

neurostore_sdk/api_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,12 @@ def response_deserialize(
327327
data=return_data,
328328
)
329329

330+
raw_headers = response_data.getheaders()
331+
headers = dict(raw_headers) if raw_headers is not None else None
330332
return ApiResponse(
331333
status_code = response_data.status,
332334
data = return_data,
333-
headers = response_data.getheaders(),
335+
headers = headers,
334336
raw_data = response_data.data
335337
)
336338

neurostore_sdk/models/analysis_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]:
6363
were set at model initialization. Other fields with value `None`
6464
are ignored.
6565
"""
66-
excluded_fields: Set[str] = set([
67-
])
66+
excluded_fields: Set[str] = set([])
6867

6968
_dict = self.model_dump(
7069
by_alias=True,

neurostore_sdk/models/analysis_common.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]:
6666
were set at model initialization. Other fields with value `None`
6767
are ignored.
6868
"""
69-
excluded_fields: Set[str] = set([
70-
])
69+
excluded_fields: Set[str] = set([])
7170

7271
_dict = self.model_dump(
7372
by_alias=True,
@@ -76,9 +75,9 @@ def to_dict(self) -> Dict[str, Any]:
7675
)
7776
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
7877
_items = []
79-
if self.entities:
78+
if self.entities is not None:
8079
for _item_entities in self.entities:
81-
if _item_entities:
80+
if _item_entities is not None:
8281
_items.append(_item_entities.to_dict())
8382
_dict['entities'] = _items
8483
# set to None if table_id (nullable) is None

neurostore_sdk/models/analysis_list.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,21 @@ def to_dict(self) -> Dict[str, Any]:
6464
were set at model initialization. Other fields with value `None`
6565
are ignored.
6666
"""
67-
excluded_fields: Set[str] = set([
68-
])
67+
excluded_fields: Set[str] = set([])
6968

7069
_dict = self.model_dump(
7170
by_alias=True,
7271
exclude=excluded_fields,
7372
exclude_none=True,
7473
)
7574
# override the default output from pydantic by calling `to_dict()` of metadata
76-
if self.metadata:
75+
if self.metadata is not None:
7776
_dict['metadata'] = self.metadata.to_dict()
7877
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
7978
_items = []
80-
if self.results:
79+
if self.results is not None:
8180
for _item_results in self.results:
82-
if _item_results:
81+
if _item_results is not None:
8382
_items.append(_item_results.to_dict())
8483
_dict['results'] = _items
8584
return _dict

neurostore_sdk/models/analysis_request.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,27 @@ def to_dict(self) -> Dict[str, Any]:
7878
were set at model initialization. Other fields with value `None`
7979
are ignored.
8080
"""
81-
excluded_fields: Set[str] = set([
82-
])
81+
excluded_fields: Set[str] = set([])
8382

8483
_dict = self.model_dump(
8584
by_alias=True,
8685
exclude=excluded_fields,
8786
exclude_none=True,
8887
)
8988
# override the default output from pydantic by calling `to_dict()` of images
90-
if self.images:
89+
if self.images is not None:
9190
_dict['images'] = self.images.to_dict()
9291
# override the default output from pydantic by calling `to_dict()` of points
93-
if self.points:
92+
if self.points is not None:
9493
_dict['points'] = self.points.to_dict()
9594
# override the default output from pydantic by calling `to_dict()` of conditions
96-
if self.conditions:
95+
if self.conditions is not None:
9796
_dict['conditions'] = self.conditions.to_dict()
9897
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
9998
_items = []
100-
if self.entities:
99+
if self.entities is not None:
101100
for _item_entities in self.entities:
102-
if _item_entities:
101+
if _item_entities is not None:
103102
_items.append(_item_entities.to_dict())
104103
_dict['entities'] = _items
105104
# set to None if name (nullable) is None

neurostore_sdk/models/analysis_request_relationships.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,21 @@ def to_dict(self) -> Dict[str, Any]:
6767
were set at model initialization. Other fields with value `None`
6868
are ignored.
6969
"""
70-
excluded_fields: Set[str] = set([
71-
])
70+
excluded_fields: Set[str] = set([])
7271

7372
_dict = self.model_dump(
7473
by_alias=True,
7574
exclude=excluded_fields,
7675
exclude_none=True,
7776
)
7877
# override the default output from pydantic by calling `to_dict()` of images
79-
if self.images:
78+
if self.images is not None:
8079
_dict['images'] = self.images.to_dict()
8180
# override the default output from pydantic by calling `to_dict()` of points
82-
if self.points:
81+
if self.points is not None:
8382
_dict['points'] = self.points.to_dict()
8483
# override the default output from pydantic by calling `to_dict()` of conditions
85-
if self.conditions:
84+
if self.conditions is not None:
8685
_dict['conditions'] = self.conditions.to_dict()
8786
return _dict
8887

neurostore_sdk/models/analysis_request_relationships_conditions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], List[ConditionRequest], List
168168

169169
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
170170
return self.actual_instance.to_dict()
171+
elif isinstance(self.actual_instance, list):
172+
return [item.to_dict() if hasattr(item, "to_dict") else item for item in self.actual_instance]
171173
else:
172174
# primitive type
173175
return self.actual_instance

neurostore_sdk/models/analysis_request_relationships_images.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], List[ImageRequest], List[str
168168

169169
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
170170
return self.actual_instance.to_dict()
171+
elif isinstance(self.actual_instance, list):
172+
return [item.to_dict() if hasattr(item, "to_dict") else item for item in self.actual_instance]
171173
else:
172174
# primitive type
173175
return self.actual_instance

neurostore_sdk/models/analysis_request_relationships_points.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], List[PointRequest], List[str
168168

169169
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
170170
return self.actual_instance.to_dict()
171+
elif isinstance(self.actual_instance, list):
172+
return [item.to_dict() if hasattr(item, "to_dict") else item for item in self.actual_instance]
171173
else:
172174
# primitive type
173175
return self.actual_instance

neurostore_sdk/models/analysis_return.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,27 @@ def to_dict(self) -> Dict[str, Any]:
9292
* OpenAPI `readOnly` fields are excluded.
9393
* OpenAPI `readOnly` fields are excluded.
9494
"""
95-
excluded_fields: Set[str] = set([
96-
"created_at",
97-
"updated_at",
98-
"user",
99-
])
95+
excluded_fields: Set[str] = set([])
10096

10197
_dict = self.model_dump(
10298
by_alias=True,
10399
exclude=excluded_fields,
104100
exclude_none=True,
105101
)
106102
# override the default output from pydantic by calling `to_dict()` of images
107-
if self.images:
103+
if self.images is not None:
108104
_dict['images'] = self.images.to_dict()
109105
# override the default output from pydantic by calling `to_dict()` of points
110-
if self.points:
106+
if self.points is not None:
111107
_dict['points'] = self.points.to_dict()
112108
# override the default output from pydantic by calling `to_dict()` of conditions
113-
if self.conditions:
109+
if self.conditions is not None:
114110
_dict['conditions'] = self.conditions.to_dict()
115111
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
116112
_items = []
117-
if self.entities:
113+
if self.entities is not None:
118114
for _item_entities in self.entities:
119-
if _item_entities:
115+
if _item_entities is not None:
120116
_items.append(_item_entities.to_dict())
121117
_dict['entities'] = _items
122118
# set to None if name (nullable) is None

0 commit comments

Comments
 (0)