Skip to content

Commit 9784999

Browse files
ef9aa435efd368113b25a436dbb425467a973fb7
1 parent dd24e91 commit 9784999

6 files changed

Lines changed: 32 additions & 4 deletions

File tree

docs/Project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**meta_analyses** | [**ProjectMetaAnalyses**](ProjectMetaAnalyses.md) | | [optional]
1010
**name** | **str** | | [optional]
1111
**description** | **str** | | [optional]
12+
**type** | **str** | | [optional]
1213
**neurostore_studyset_id** | **str** | ID of the project’s linked Neurostore studyset reference. | [optional]
1314
**neurostore_annotation_id** | **str** | ID of the project’s linked Neurostore annotation reference. | [optional]
1415
**public** | **bool** | whether the project is public or private | [optional]

docs/ProjectReturn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
1414
**meta_analyses** | [**ProjectMetaAnalyses**](ProjectMetaAnalyses.md) | | [optional]
1515
**name** | **str** | | [optional]
1616
**description** | **str** | | [optional]
17+
**type** | **str** | | [optional]
1718
**neurostore_studyset_id** | **str** | ID of the project’s linked Neurostore studyset reference. | [optional]
1819
**neurostore_annotation_id** | **str** | ID of the project’s linked Neurostore annotation reference. | [optional]
1920
**public** | **bool** | whether the project is public or private | [optional]

neurosynth_compose_sdk/models/project.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
import json
2020

21-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
2222
from typing import Any, ClassVar, Dict, List, Optional
2323
from neurosynth_compose_sdk.models.neurostore_study import NeurostoreStudy
2424
from neurosynth_compose_sdk.models.project_meta_analyses import ProjectMetaAnalyses
@@ -33,13 +33,24 @@ class Project(BaseModel):
3333
meta_analyses: Optional[ProjectMetaAnalyses] = None
3434
name: Optional[StrictStr] = None
3535
description: Optional[StrictStr] = None
36+
type: Optional[StrictStr] = None
3637
neurostore_studyset_id: Optional[StrictStr] = Field(default=None, description="ID of the project’s linked Neurostore studyset reference.")
3738
neurostore_annotation_id: Optional[StrictStr] = Field(default=None, description="ID of the project’s linked Neurostore annotation reference.")
3839
public: Optional[StrictBool] = Field(default=None, description="whether the project is public or private")
3940
neurostore_study: Optional[NeurostoreStudy] = None
4041
neurostore_url: Optional[StrictStr] = None
4142
draft: Optional[StrictBool] = None
42-
__properties: ClassVar[List[str]] = ["provenance", "meta_analyses", "name", "description", "neurostore_studyset_id", "neurostore_annotation_id", "public", "neurostore_study", "neurostore_url", "draft"]
43+
__properties: ClassVar[List[str]] = ["provenance", "meta_analyses", "name", "description", "type", "neurostore_studyset_id", "neurostore_annotation_id", "public", "neurostore_study", "neurostore_url", "draft"]
44+
45+
@field_validator('type')
46+
def type_validate_enum(cls, value):
47+
"""Validates the enum"""
48+
if value is None:
49+
return value
50+
51+
if value not in set(['CBMA', 'IBMA']):
52+
raise ValueError("must be one of enum values ('CBMA', 'IBMA')")
53+
return value
4354

4455
model_config = ConfigDict(
4556
populate_by_name=True,
@@ -132,6 +143,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
132143
"meta_analyses": ProjectMetaAnalyses.from_dict(obj["meta_analyses"]) if obj.get("meta_analyses") is not None else None,
133144
"name": obj.get("name"),
134145
"description": obj.get("description"),
146+
"type": obj.get("type"),
135147
"neurostore_studyset_id": obj.get("neurostore_studyset_id"),
136148
"neurostore_annotation_id": obj.get("neurostore_annotation_id"),
137149
"public": obj.get("public"),

neurosynth_compose_sdk/models/project_return.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import json
2020

2121
from datetime import datetime
22-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
2323
from typing import Any, ClassVar, Dict, List, Optional
2424
from neurosynth_compose_sdk.models.neurostore_study import NeurostoreStudy
2525
from neurosynth_compose_sdk.models.project_meta_analyses import ProjectMetaAnalyses
@@ -39,13 +39,24 @@ class ProjectReturn(BaseModel):
3939
meta_analyses: Optional[ProjectMetaAnalyses] = None
4040
name: Optional[StrictStr] = None
4141
description: Optional[StrictStr] = None
42+
type: Optional[StrictStr] = None
4243
neurostore_studyset_id: Optional[StrictStr] = Field(default=None, description="ID of the project’s linked Neurostore studyset reference.")
4344
neurostore_annotation_id: Optional[StrictStr] = Field(default=None, description="ID of the project’s linked Neurostore annotation reference.")
4445
public: Optional[StrictBool] = Field(default=None, description="whether the project is public or private")
4546
neurostore_study: Optional[NeurostoreStudy] = None
4647
neurostore_url: Optional[StrictStr] = None
4748
draft: Optional[StrictBool] = None
48-
__properties: ClassVar[List[str]] = ["id", "updated_at", "created_at", "user", "username", "provenance", "meta_analyses", "name", "description", "neurostore_studyset_id", "neurostore_annotation_id", "public", "neurostore_study", "neurostore_url", "draft"]
49+
__properties: ClassVar[List[str]] = ["id", "updated_at", "created_at", "user", "username", "provenance", "meta_analyses", "name", "description", "type", "neurostore_studyset_id", "neurostore_annotation_id", "public", "neurostore_study", "neurostore_url", "draft"]
50+
51+
@field_validator('type')
52+
def type_validate_enum(cls, value):
53+
"""Validates the enum"""
54+
if value is None:
55+
return value
56+
57+
if value not in set(['CBMA', 'IBMA']):
58+
raise ValueError("must be one of enum values ('CBMA', 'IBMA')")
59+
return value
4960

5061
model_config = ConfigDict(
5162
populate_by_name=True,
@@ -161,6 +172,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
161172
"meta_analyses": ProjectMetaAnalyses.from_dict(obj["meta_analyses"]) if obj.get("meta_analyses") is not None else None,
162173
"name": obj.get("name"),
163174
"description": obj.get("description"),
175+
"type": obj.get("type"),
164176
"neurostore_studyset_id": obj.get("neurostore_studyset_id"),
165177
"neurostore_annotation_id": obj.get("neurostore_annotation_id"),
166178
"public": obj.get("public"),

test/test_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def make_instance(self, include_optional) -> Project:
4040
meta_analyses = None,
4141
name = '',
4242
description = '',
43+
type = 'CBMA',
4344
neurostore_studyset_id = '',
4445
neurostore_annotation_id = '',
4546
public = True,

test/test_project_return.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def make_instance(self, include_optional) -> ProjectReturn:
4545
meta_analyses = None,
4646
name = '',
4747
description = '',
48+
type = 'CBMA',
4849
neurostore_studyset_id = '',
4950
neurostore_annotation_id = '',
5051
public = True,

0 commit comments

Comments
 (0)