Skip to content

Commit

Permalink
4ccde1b596b4e2ab78376e19f99a78daf5d46b71
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 1, 2024
1 parent 08bb1c8 commit b407f27
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ docs/StudyBase.md
docs/StudyCommon.md
docs/StudyList.md
docs/StudyRequest.md
docs/StudyRequestAllOf.md
docs/StudyRequestRelationships.md
docs/StudyRequestRelationshipsAnalyses.md
docs/StudyReturn.md
Expand Down Expand Up @@ -185,6 +186,7 @@ neurostore_sdk/models/study_base.py
neurostore_sdk/models/study_common.py
neurostore_sdk/models/study_list.py
neurostore_sdk/models/study_request.py
neurostore_sdk/models/study_request_all_of.py
neurostore_sdk/models/study_request_relationships.py
neurostore_sdk/models/study_request_relationships_analyses.py
neurostore_sdk/models/study_return.py
Expand Down Expand Up @@ -214,4 +216,5 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_study_request_all_of.py
tox.ini
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ Class | Method | HTTP request | Description
- [StudyCommon](docs/StudyCommon.md)
- [StudyList](docs/StudyList.md)
- [StudyRequest](docs/StudyRequest.md)
- [StudyRequestAllOf](docs/StudyRequestAllOf.md)
- [StudyRequestRelationships](docs/StudyRequestRelationships.md)
- [StudyRequestRelationshipsAnalyses](docs/StudyRequestRelationshipsAnalyses.md)
- [StudyReturn](docs/StudyReturn.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/StudyRequest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# StudyRequest



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

## Example

Expand Down
28 changes: 28 additions & 0 deletions docs/StudyRequestAllOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# StudyRequestAllOf


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pmcid** | **str** | | [optional]

## Example

```python
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf

# TODO update the JSON string below
json = "{}"
# create an instance of StudyRequestAllOf from a JSON string
study_request_all_of_instance = StudyRequestAllOf.from_json(json)
# print the JSON string representation of the object
print StudyRequestAllOf.to_json()

# convert the object into a dict
study_request_all_of_dict = study_request_all_of_instance.to_dict()
# create an instance of StudyRequestAllOf from a dict
study_request_all_of_form_dict = study_request_all_of.from_dict(study_request_all_of_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions neurostore_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
from neurostore_sdk.models.study_common import StudyCommon
from neurostore_sdk.models.study_list import StudyList
from neurostore_sdk.models.study_request import StudyRequest
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf
from neurostore_sdk.models.study_request_relationships import StudyRequestRelationships
from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses
from neurostore_sdk.models.study_return import StudyReturn
Expand Down
1 change: 1 addition & 0 deletions neurostore_sdk/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
from neurostore_sdk.models.study_common import StudyCommon
from neurostore_sdk.models.study_list import StudyList
from neurostore_sdk.models.study_request import StudyRequest
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf
from neurostore_sdk.models.study_request_relationships import StudyRequestRelationships
from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses
from neurostore_sdk.models.study_return import StudyReturn
Expand Down
13 changes: 10 additions & 3 deletions neurostore_sdk/models/study_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

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

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

# set to None if pmcid (nullable) is None
# and __fields_set__ contains the field
if self.pmcid is None and "pmcid" in self.__fields_set__:
_dict['pmcid'] = None

return _dict

@classmethod
Expand All @@ -129,7 +135,8 @@ def from_dict(cls, obj: dict) -> StudyRequest:
"year": obj.get("year"),
"analyses": StudyRequestRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None,
"id": obj.get("id"),
"public": obj.get("public") if obj.get("public") is not None else True
"public": obj.get("public") if obj.get("public") is not None else True,
"pmcid": obj.get("pmcid")
})
return _obj

76 changes: 76 additions & 0 deletions neurostore_sdk/models/study_request_all_of.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding: utf-8

"""
neurostore api
Create studysets for meta-analysis # noqa: E501
The version of the OpenAPI document: 1.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re # noqa: F401
import json


from typing import Optional
from pydantic import BaseModel, StrictStr

class StudyRequestAllOf(BaseModel):
"""
StudyRequestAllOf
"""
pmcid: Optional[StrictStr] = None
__properties = ["pmcid"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> StudyRequestAllOf:
"""Create an instance of StudyRequestAllOf from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
},
exclude_none=True)
# set to None if pmcid (nullable) is None
# and __fields_set__ contains the field
if self.pmcid is None and "pmcid" in self.__fields_set__:
_dict['pmcid'] = None

return _dict

@classmethod
def from_dict(cls, obj: dict) -> StudyRequestAllOf:
"""Create an instance of StudyRequestAllOf from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return StudyRequestAllOf.parse_obj(obj)

_obj = StudyRequestAllOf.parse_obj({
"pmcid": obj.get("pmcid")
})
return _obj

55 changes: 55 additions & 0 deletions test/test_study_request_all_of.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# coding: utf-8

"""
neurostore api
Create studysets for meta-analysis # noqa: E501
The version of the OpenAPI document: 1.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


import unittest
import datetime

import neurostore_sdk
from neurostore_sdk.models.study_request_all_of import StudyRequestAllOf # noqa: E501
from neurostore_sdk.rest import ApiException

class TestStudyRequestAllOf(unittest.TestCase):
"""StudyRequestAllOf unit test stubs"""

def setUp(self):
pass

def tearDown(self):
pass

def make_instance(self, include_optional):
"""Test StudyRequestAllOf
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `StudyRequestAllOf`
"""
model = neurostore_sdk.models.study_request_all_of.StudyRequestAllOf() # noqa: E501
if include_optional :
return StudyRequestAllOf(
pmcid = ''
)
else :
return StudyRequestAllOf(
)
"""

def testStudyRequestAllOf(self):
"""Test StudyRequestAllOf"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)

if __name__ == '__main__':
unittest.main()

0 comments on commit b407f27

Please sign in to comment.